---
title: "Invoke a method in a smart contract on Celo"
method: POST
path: "/v3/celo/smartcontract"
tags: ["Celo - Tatum API"]
---

# Invoke a method in a smart contract on Celo

`POST /v3/celo/smartcontract`

/v3/celo/smartcontract

**2 credits per API call**

Invoke a method in an existing smart contract on Celo.

You can call a read-only or write method.

*   For **read-only** methods, the output of the invoked method is returned.
*   For **write** methods, the ID of the associated transaction is returned.

**Troubleshooting a failed transaction**  
Tatum ensures that this API works against the blockchain (accesses the blockchain, finds the specified smart contract, and executes the specified ABI method with the provided parameters).  
However, because this API can be run against any smart contract on the blockchain, Tatum cannot in any way guarantee that the method itself will be executed successfully.

If you have issues with invoking the method, refer to the user documentation for this method, or contact the author of the smart contract.

For more information about invoking methods in smart contracts, see [this article](https://support.tatum.io/support/solutions/articles/80001052441) on our Support Portal.

**Signing a transaction**  
When invoking a method in a smart contract, 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
  - CallCeloReadSmartContractMethod
    - `contractAddress` string, required — The address of the smart contract
    - `methodName` string, required — Name of the method to invoke on smart contract.
    - `methodABI` object, required — ABI of the method to invoke.
    - `params` string[], required — Parameters of the method to be invoked.
  - CallCeloSmartContractMethod
    - `contractAddress` string, required — The address of the smart contract
    - `methodName` string, required — Name of the method to invoke on smart contract.
    - `methodABI` object, required — ABI of the method to invoke.
    - `params` string[], required — Parameters of the method to be invoked.
    - `amount` string — Amount of the assets to be sent.
    - `fromPrivateKey` string, required — Private key of sender address. Private key, or signature Id must be present.
    - `nonce` number — Nonce to be set to transaction. If not present, last known nonce will be used.
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR', required — Currency to pay for transaction gas
    - `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
  - CallCeloSmartContractMethodKMS
    - `contractAddress` string, required — The address of the smart contract
    - `methodName` string, required — Name of the method to invoke on smart contract.
    - `methodABI` object, required — ABI of the method to invoke.
    - `params` string[], required — Parameters of the method to be invoked.
    - `index` number — If signatureId is mnemonic-based, this is the index to the specific address from that mnemonic.
    - `signatureId` string, uuid, required — Identifier of the private key associated in signing application. Private key, or signature Id must be present.
    - `nonce` number — Nonce to be set to transaction. If not present, last known nonce will be used.
    - `feeCurrency` 'CELO' | 'CUSD' | 'CEUR', required — Currency to pay for transaction gas
    - `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.
  - Data
    - `data` union, required — Result of the method, if the method was read only.
      - object
      - string
      - number
      - boolean

## 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 required perform 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.net/tatum/apis/blockchain-data.md) · [All operations](https://skmtc.net/tatum/apis/blockchain-data/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tatum/blockchain-data/versions/8622ee4b8fae/schema)
