Create a Payment Intent

Request to create a bank transfer

To create a bank transfer, you need to make a request to create a Payment Intent resource.

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"
  }
}'
const fetch = require('node-fetch');

const payment_intent = {
  amount: 1000,
  recipient_accout: {
    holder_id: "111111111",
    number: "123123123",
    type: "checking_account",
    institution_id: "cl_banco_de_chile"
  },
}

fetch('https://api.fintoc.com/v1/payment_intents', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
      'Authorization': 'sk_live_000000000000'
    },
    body: JSON.stringify(payment_intent),
  },
)
import requests

payment_intent = {
  'amount': 1000,
  'currency': 'clp',
  'recipient_account': {
    'holder_id': '111111111',
    'number': '123123123',
    'type': 'checking_account',
    'institution_id': 'cl_banco_de_chile'
  }
}

headers = {
  'Accept': 'application/json', 'Authorization': 'sk_live_000000000000'
}

r = requests.post(
  'https://api.fintoc.com/v1/payment_intents',
  data=payment_intent,
  headers=headers
)
require 'net/http'
require 'uri'
require 'json'

payment_intent = {
  amount: 1000,
  currency: 'clp',
  recipient_account: {
    holder_id: '111111111',
    number: '123123123',
    type: 'checking_account',
    institution_id: 'cl_banco_de_chile'
  }
}

uri = URI("https://api.fintoc.com/v1/payment_intents")

header = {
  Accept: 'application/json', Authorization: 'sk_live_000000000000'
}

http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = payment_intent.to_json

response = http.request(request)

In your request you must send 3 very important fields: amount, currency and recipient_account.

Parameter

Example

Explanation

amount

10000

Amount of money that needs to be transferred

currency

CLP

Currency that is being used for the bank transfer

recipient_account

Account Object

Account receiving the bank transfer

The recipient_account field corresponds to an Account object, which needs to be conformed by 4 attributes: holder_id, number, type, institution_id.

Parameter

Example

Explanation

holder_id

193426816

Account holder's RUT

number

1836027172

Account number

type

checking_account

Type of account. Supported types are checking_account and sight_account.

institution_id

cl_banco_de_chile

Fintoc institution id for the bank receiving the bank transfer. You can see the code for each bank here.

Response when creating a bank transfer

After making the request to create the Payment Intent, Fintoc should respond with 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,
  "created_at": "2021-10-15T15:23:11.474Z",
}

The values of the attributes reference_id and sender_account will be null. Once the bank transfer starts to be processed, these fields will populate.

Once the transfer is completed successfully, the reference_id field will correspond to the operation number that the bank assigned to the transfer.

📘

Widget Token

You will only receive the widget_token field when creating the Payment Intent. After that, every request to get an existing Payment Intent from Fintoc will return with that field empty. Remember that you need to use the widget_token to instantiate the widget on the client side!

❗️

Expiration

A Payment Intent expires after 10 minutes. After 10 minutes of the Payment Intent being created, the widget won't accept the widget_token of the expired Payment Intent, and you will have to create a new one.


Did this page help you?