Add custom data to your Fintoc Objects

Some Fintoc objects (currently Charges and Payment Intents) have a Metadata parameter. You can use this parameter to add custom key-value pairs to them.

Metadata is useful to hold arbitrary structured data of the objects you interact with. This can help ease the integration of your system with Fintoc. As an example, you could store your user's full name and corresponding unique identifier from your system on a Fintoc Payment Intent object. Metadata is not used or modified by Fintoc in any way.

Here's a create Payment Intent request with an order_id added to it.

curl --request POST "https://api.fintoc.com/v1/payment_intents" \
-- header 'Authorization: sk_live_0000000000000000' \
-- header 'Content-Type: application/json' \
--data-raw '{
  "amount": 1000,
  "currency": "CLP",
  "recipient_account": {
    "holder_id": "111111111",
    "number": "123123123",
    "type": "checking_account",
    "institution_id": "cl_banco_de_chile"
  },
  "metadata": {
  	"order_id": "4321"
  }
}'

The response would look something like this:

{
  "id": "pi_BO381oEATXonG6bj",
  "object": "payment_intent",
  "amount": 1000,
  "currency": "CLP",
  "widget_token": "pi_BO381oEATXonG6bj_sec_a4xK32BanKWYn",
  "status": "created",
  "reference_id": null,
  "recipient_account": {
    "holder_id": "183917137",
    "number": "123456",
    "type": "checking_account",
    "institution_id": "cl_banco_de_chile"
  },
  "sender_account": null,
  "metadata": {
  	"order_id": "4321"
  },
  "created_at": "2021-10-15T15:23:11.474Z"
}

📘

Limitations

Metadata can hold up to 50 keys, with names up to 40 characters of length and values up to 500 characters long. Only strings, boolean and numbers are permitted as metadata values.