cURL
curl --request POST \
--url https://api.openformat.tech/v1/credit/permit-data \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}
'import requests
url = "https://api.openformat.tech/v1/credit/permit-data"
payload = {
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'arbitrum-sepolia',
token_id: '0xd1f09c70f6f2838a3ab6209c1465af68594667ec',
holder_address: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
receiver_address: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
amount: 123
})
};
fetch('https://api.openformat.tech/v1/credit/permit-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openformat.tech/v1/credit/permit-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'arbitrum-sepolia',
'token_id' => '0xd1f09c70f6f2838a3ab6209c1465af68594667ec',
'holder_address' => '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
'receiver_address' => '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openformat.tech/v1/credit/permit-data"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.openformat.tech/v1/credit/permit-data")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/permit-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"permitData": {
"nonce": "123",
"domainSeparator": "0x193363de76294f014e224981928e1e2fae58895ff731778504e61d93fc4805e8",
"deadline": 1700766991,
"hashToSign": "0x67a58ea20b44c0f6984a58efdd57b171fa1717dfc7cbe193dc22f5af64cd9c67"
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than 0",
"parameter": "amount",
"path": "amount"
}
]
}
}
{
"success": false,
"error": {
"code": "token_not_found",
"message": "Credit token not found"
}
}
Credit
Request Permit Data
This endpoint returns the necessary data for a Credit token holder to create a permit signature. This permit is used to allow a third party to transfer tokens on behalf of the token holder. Once this permit is signed it is sent to the Transfer Credit Token endpoint to get a transfer transaction.
POST
/
credit
/
permit-data
cURL
curl --request POST \
--url https://api.openformat.tech/v1/credit/permit-data \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}
'import requests
url = "https://api.openformat.tech/v1/credit/permit-data"
payload = {
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'arbitrum-sepolia',
token_id: '0xd1f09c70f6f2838a3ab6209c1465af68594667ec',
holder_address: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
receiver_address: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
amount: 123
})
};
fetch('https://api.openformat.tech/v1/credit/permit-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openformat.tech/v1/credit/permit-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'arbitrum-sepolia',
'token_id' => '0xd1f09c70f6f2838a3ab6209c1465af68594667ec',
'holder_address' => '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
'receiver_address' => '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openformat.tech/v1/credit/permit-data"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.openformat.tech/v1/credit/permit-data")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/permit-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"permitData": {
"nonce": "123",
"domainSeparator": "0x193363de76294f014e224981928e1e2fae58895ff731778504e61d93fc4805e8",
"deadline": 1700766991,
"hashToSign": "0x67a58ea20b44c0f6984a58efdd57b171fa1717dfc7cbe193dc22f5af64cd9c67"
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than 0",
"parameter": "amount",
"path": "amount"
}
]
}
}
{
"success": false,
"error": {
"code": "token_not_found",
"message": "Credit token not found"
}
}
{
"success": true,
"permitData": {
"nonce": "123",
"domainSeparator": "0x193363de76294f014e224981928e1e2fae58895ff731778504e61d93fc4805e8",
"deadline": 1700766991,
"hashToSign": "0x67a58ea20b44c0f6984a58efdd57b171fa1717dfc7cbe193dc22f5af64cd9c67"
}
}
{
"success": false,
"error": {
"code": "validation_error",
"message": "Some parameters are invalid",
"issues": [
{
"code": "too_small",
"message": "Number must be greater than 0",
"parameter": "amount",
"path": "amount"
}
]
}
}
{
"success": false,
"error": {
"code": "token_not_found",
"message": "Credit token not found"
}
}
Authorizations
Body
application/json
Blockchain network to use
Required string length:
1 - 255Example:
"arbitrum-sepolia"
Ethereum address of the credit token
Example:
"0xd1f09c70f6f2838a3ab6209c1465af68594667ec"
Ethereum address of the user that holds the credit tokens
Example:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
Ethereum address of the user that will receive cthe redit tokens
Example:
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
Amount of credit tokens to transfer
Required range:
x > 0Example:
123
⌘I