curl --request POST \
--url https://api.openformat.tech/v1/credit/transfer \
--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,
"deadline": 1700766991,
"signedPermit": {
"r": "0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0",
"s": "0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f",
"v": 28
}
}
'import requests
url = "https://api.openformat.tech/v1/credit/transfer"
payload = {
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123,
"deadline": 1700766991,
"signedPermit": {
"r": "0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0",
"s": "0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f",
"v": 28
}
}
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,
deadline: 1700766991,
signedPermit: {
r: '0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0',
s: '0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f',
v: 28
}
})
};
fetch('https://api.openformat.tech/v1/credit/transfer', 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/transfer",
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,
'deadline' => 1700766991,
'signedPermit' => [
'r' => '0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0',
's' => '0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f',
'v' => 28
]
]),
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/transfer"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123,\n \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\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/transfer")
.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 \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/transfer")
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 \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"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"
}
}
Transfer Credit Token
This is endpoint receives transfer information, a permit signature and returns an unsigned transaction that executes the transfer. Permit data is obtained by calling the Request Permit Data endpoint and it is signed using the private key of the token holder. Transfer information needs to match the used to generate the permit. The unsigned transaction should be signed using your private key and can be broadcasted using Execute Transaction or Execute Transaction and Wait endpoints.
curl --request POST \
--url https://api.openformat.tech/v1/credit/transfer \
--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,
"deadline": 1700766991,
"signedPermit": {
"r": "0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0",
"s": "0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f",
"v": 28
}
}
'import requests
url = "https://api.openformat.tech/v1/credit/transfer"
payload = {
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"receiver_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123,
"deadline": 1700766991,
"signedPermit": {
"r": "0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0",
"s": "0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f",
"v": 28
}
}
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,
deadline: 1700766991,
signedPermit: {
r: '0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0',
s: '0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f',
v: 28
}
})
};
fetch('https://api.openformat.tech/v1/credit/transfer', 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/transfer",
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,
'deadline' => 1700766991,
'signedPermit' => [
'r' => '0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0',
's' => '0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f',
'v' => 28
]
]),
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/transfer"
payload := strings.NewReader("{\n \"chain\": \"arbitrum-sepolia\",\n \"token_id\": \"0xd1f09c70f6f2838a3ab6209c1465af68594667ec\",\n \"holder_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"receiver_address\": \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\n \"amount\": 123,\n \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\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/transfer")
.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 \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openformat.tech/v1/credit/transfer")
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 \"deadline\": 1700766991,\n \"signedPermit\": {\n \"r\": \"0xab26c603cc459019835a3872bf1d8b4142f23c40f952f208e8c1dfacf857b9f0\",\n \"s\": \"0x61d6e5f463437afd2a541fb88d806f8e71718a6af5227043be06b0dd59b3503f\",\n \"v\": 28\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"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,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"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
Blockchain network to use
1 - 255"arbitrum-sepolia"
Ethereum address of the credit token
"0xd1f09c70f6f2838a3ab6209c1465af68594667ec"
Ethereum address of the user that holds the credit tokens
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
Ethereum address of the user that will receive cthe redit tokens
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
Amount of credit tokens to transfer
x > 0123
Deadline timestamp in seconds
x > 01700766991
Show child attributes
Show child attributes