---
title: "Approve the transfer of an asset from a gas pump address"
method: POST
path: "/v3/blockchain/sc/custodial/approve"
tags: ["Gas pump"]
---

# Approve the transfer of an asset from a gas pump address

`POST /v3/blockchain/sc/custodial/approve`

## Request

- Base URL: `https://api.tatum.io`
- URL: `https://api.tatum.io/v3/blockchain/sc/custodial/approve`
- Auth: API key in header `x-api-key`

/v3/blockchain/sc/custodial/approve

**2 credits per API call**

Allow another blockchain address (the `spender` parameter in the request body) to transfer the asset from a gas pump address on behalf of the master address.

Use this API when the customer using the gas pump address sells assets on a marketplace or auction. After the customer creates a listing of the asset, they have to allow the marketplace/auction smart contract to transfer the asset to the buyer after the asset has been bought.

The asset can be one of the following types:

*   Fungible token (ERC-20 or equivalent)
*   NFT (ERC-721 or equivalent)
*   Multi Token (ERC-1155 or equivalent)

This API is supported for the following blockchains:

*   BNB Smart Chain
*   Celo
*   Ethereum
*   Harmony
*   Klaytn
*   Polygon
*   XinFin

**Signing a transaction**  
When approving the transfer of an asset, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.

Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the **testnet** of a blockchain.

For signing transactions on the **mainnet**, we strongly recommend that you use the Tatum [Key Management System (KMS)](https://github.com/tatumio/tatum-kms) and provide the signature ID instead of the private key in the API. Alternatively, you can use the [Tatum JavaScript client](https://github.com/tatumio/tatum-js/tree/v2).

## Request body

- union
  - ApproveTransferCustodialWallet
    - `chain` 'BSC' | 'ETH' | 'KLAY' | 'MATIC' | 'ONE' | 'XDC', required: The blockchain to work with
    - `custodialAddress` string, required: The gas pump address that holds the asset
    - `spender` string, required: The blockchain address to allow the transfer of the asset from the gas pump address
    - `contractType` 0 | 1 | 2, required: The type of the asset to transfer. Set <code>0</code> for fungible tokens (ERC-20 or equivalent), <code>1</code> for NFTs (ERC-721 or equivalent), or <code>2</code> for Multi Tokens (ERC-1155 or equivalent).
    - `tokenAddress` string, required: The address of the asset to transfer
    - `amount` string: (Only if the asset is a fungible token or Multi Token) The amount of the asset to transfer. Do not use if the asset is an NFT.
    - `tokenId` string: (Only if the asset is a Multi Token or NFT) The ID of the token to transfer. Do not use if the asset is a fungible token.
    - `fromPrivateKey` string, required: The private key of the blockchain address that owns the gas pump address ("master address")
    - `nonce` number: The nonce to be set to the transfer transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price
  - ApproveTransferCustodialWalletKMS
    - `chain` 'BSC' | 'ETH' | 'KLAY' | 'MATIC' | 'ONE' | 'XDC', required: The blockchain to work with
    - `custodialAddress` string, required: The gas pump address that holds the asset
    - `spender` string, required: The blockchain address to allow the transfer of the asset from the gas pump address
    - `contractType` 0 | 1 | 2, required: The type of the asset to transfer. Set <code>0</code> for fungible tokens (ERC-20 or equivalent), <code>1</code> for NFTs (ERC-721 or equivalent), or <code>2</code> for Multi Tokens (ERC-1155 or equivalent).
    - `tokenAddress` string, required: The address of the asset to transfer
    - `amount` string: (Only if the asset is a fungible token or Multi Token) The amount of the asset to transfer. Do not use if the asset is an NFT.
    - `tokenId` string: (Only if the asset is a Multi Token or NFT) The ID of the token to transfer. Do not use if the asset is a fungible token.
    - `signatureId` string, uuid, required: The KMS identifier of the private key of the blockchain address that owns the gas pump address key ("master address")
    - `index` number: (Only if the signature ID is mnemonic-based) The index of the "master address"
    - `nonce` number: The nonce to be set to the transfer transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price
  - ApproveTransferCustodialWalletCelo
    - `chain` 'CELO', required: The blockchain to work with
    - `custodialAddress` string, required: The gas pump address that holds the asset
    - `spender` string, required: The blockchain address to allow the transfer of the asset from the gas pump address
    - `contractType` 0 | 1 | 2, required: The type of the asset to transfer. Set <code>0</code> for fungible tokens (ERC-20 or equivalent), <code>1</code> for NFTs (ERC-721 or equivalent), or <code>2</code> for Multi Tokens (ERC-1155 or equivalent).
    - `tokenAddress` string, required: The address of the asset to transfer
    - `amount` string: (Only if the asset is a fungible token or Multi Token) The amount of the asset to transfer. Do not use if the asset is an NFT.
    - `tokenId` string: (Only if the asset is a Multi Token or NFT) The ID of the token to transfer. Do not use if the asset is a fungible token.
    - `fromPrivateKey` string, required: The private key of the blockchain address that owns the gas pump address ("master address")
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR': The currency in which the gas fee will be paid
    - `nonce` number: The nonce to be set to the transfer transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price
  - ApproveTransferCustodialWalletCeloKMS
    - `chain` 'CELO', required: The blockchain to work with
    - `custodialAddress` string, required: The gas pump address that holds the asset
    - `spender` string, required: The blockchain address to allow the transfer of the asset from the gas pump address
    - `contractType` 0 | 1 | 2, required: The type of the asset to transfer. Set <code>0</code> for fungible tokens (ERC-20 or equivalent), <code>1</code> for NFTs (ERC-721 or equivalent), or <code>2</code> for Multi Tokens (ERC-1155 or equivalent).
    - `tokenAddress` string, required: The address of the asset to transfer
    - `amount` string: (Only if the asset is a fungible token or Multi Token) The amount of the asset to transfer. Do not use if the asset is an NFT.
    - `tokenId` string: (Only if the asset is a Multi Token or NFT) The ID of the token to transfer. Do not use if the asset is a fungible token.
    - `signatureId` string, uuid, required: The KMS identifier of the private key of the blockchain address that owns the gas pump address key ("master address")
    - `index` number: (Only if the signature ID is mnemonic-based) The index of the "master address"
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR': The currency in which the gas fee will be paid
    - `nonce` number: The nonce to be set to the transfer transaction; if not present, the last known nonce will be used
    - `fee` CustomFee: The custom defined fee; if not present, will be calculated automatically
      - `gasPrice` string, required: The price for one gas unit (in Gwei)
      - `gasLimit` string, required: The maximum number of gas units that you are willing to spend on processing the transaction at the provided gas price

## Response `200`

OK

- union
  - TransactionHash
    - `txId` string, required: The hash (ID) of the transaction
  - SignatureId
    - `signatureId` string, uuid, required: The internal Tatum ID of the prepared transaction for Key Management Sysytem (KMS) to sign<br/>This is different from the <code>signatureId</code> parameter that you provided in the request body. The <code>signatureId</code> parameter in the request body specifies the signature ID associated with the private key in KMS.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
- `403`: Forbidden. The request is authenticated, but it is not possible to perform the operation due to logical error or invalid permissions.
- `500`: Internal server error. There was an error on the server during the processing of the request.

---

[API](https://skmtc.dev/tatum/apis/smart-contracts.md) - [All operations](https://skmtc.dev/tatum/apis/smart-contracts/llms.txt) - [OpenAPI document](https://skmtc.dev/tatum/apis/smart-contracts/revisions/c0146043bb37?raw)
