POST
/
credit
/
approve
curl --request POST \
  --url https://api.openformat.tech/v1/credit/approve \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "chain": "arbitrum-sepolia",
  "token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
  "holder_address": "0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9",
  "spender_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
  "amount": 123
}'
{
  "success": true,
  "unsignedTransaction": {
    "to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
    "data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
    "maxPriorityFeePerGas": "1020840008",
    "maxFeePerGas": "1035102698",
    "gas": "476358",
    "gasLimit": "476358",
    "nonce": 36,
    "chainId": 31337,
    "type": 2
  }
}
{
  "success": true,
  "unsignedTransaction": {
    "to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
    "data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
    "maxPriorityFeePerGas": "1020840008",
    "maxFeePerGas": "1035102698",
    "gas": "476358",
    "gasLimit": "476358",
    "nonce": 36,
    "chainId": 31337,
    "type": 2
  }
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
chain
string
required

Blockchain network to use

Required string length: 1 - 255
Example:

"arbitrum-sepolia"

token_id
string
required

Ethereum address of the credit token

Example:

"0xd1f09c70f6f2838a3ab6209c1465af68594667ec"

holder_address
string
required

Ethereum address of the token holder account

Example:

"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9"

spender_address
string
required

Ethereum address of the spender account

Example:

"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

amount
number
required

Amount of credit tokens to approve

Required range: x > 0
Example:

123

Response

200
application/json
Transfer transaction to sign
success
boolean
required

Success response

Example:

true

unsignedTransaction
any | null

Unsigned transaction object for the user to sign