Process Token Payment
https://api-sandbox.letpay.io/token
Request Fields
method
(optional/string): Payment Method. Valid options:CREDITCARD
,DEBITCARD
. Default:CREDITCARD
.amount
(required/string): Total amount of the payment. Value must have a maximum of two decimal places and must not be less thanBRL 1.00
.asset
(required/string): Reference code for asset for the sale's amount.reference_id
(required/string/max 45 chars): External code created by the merchant to reference this payment (e.g. order number). Pattern is free and is used in reports and callbacks.contract_id
(required/string): Merchant's contract id.public_person_id
(required/string): Person identification.public_card_id
(required/string): Card identification.card_installments
(optional/int): Number of installments. 0 or 1 values are considered as without installments. Default: 1.delay_capture
(optional/boolean):true
to pre-authorize payment for later capture. Default: false. Pre-auth cancelation has a TTL of 5 days.notification_url
(optional/string): URL to post callbacks to this payment.extra_data
(optional/JSON): Any data pertinent to the merchant.soft_descriptor
(optional/string): Soft descriptor to use at transaction.ip_address
(optional/string): Remote IP Address(IPv4/IPv6).fraud_protection_token
: (optional/string/min 32 chars/max 128 chars): Unique token to identify the payment for fraud protection.payment_currency
(required/string): Currency code in ISO-4217.payment_country
(required/string): Country code in ISO 3166-2.
Debit Card Request Fields
authentication
(object): The 3DS authentication data:cavv
(required/string): Card holder Authentication Verification Value.xid
(required/string): Transaction identifier resulting from authentication processing.eci
(required/string): Electronic Commerce Indicator.version
(required/string): 3DS version used for authentication.dstrans_id
(required/string): Unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction.
Response Fields
payment_token
(string): Token to identify this payment.refresh_token
(string): Updated access token for next calls.transaction_status
(string): Status of this payment.public_person_id
(string): Unique Person identification for future actions.public_card_id
(string): Unique Credit Card identification for future actions.totals
(object): The payment totals:amount
(float): Amount in default region asset.asset
(string): Asset used in this amount.original_amount
(float): Amount as informed by merchant.original_asset
(string): Asset used in this originalAmount.customer_fees
(float): Total calculated fee assigned to customer.customer_amount
(float): Total amount for customer (amount + customer_fees).
customer_fees
(object): List of incident customer fees and respective values.
AUTHORIZATION | API Key |
---|---|
Key | X-Auth-Token |
Value | MY_ACCESS_TOKEN |
Body Raw(json)
json
{
"amount": 123.45,
"method": "CREDITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "MY_CONTRACT_ID",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": false,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
},
"authentication": {
"cavv": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"xid": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"eci": "05",
"version": "2.1.0",
"dstrans_id": "DIR_SERVER_TID"
}
}
Example Request
- 200 - Credit Card (2DS)
- 200 - Credit Card (2DS) With Pre-Auth
- 200 - Credit Card (3DS)
- 200 - Debit Card (3DS)
- 401 - Unauthorized
Example Request
200 - Credit Card (2DS)
curl --location 'https://api-sandbox.letpay.io/token' \
--header 'X-Auth-Token;' \
--data '{
"amount": 123.45,
"method": "CREDITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "b4ce7d96-e813-4012-80a8-c5d950dc5c94",
"public_person_id": "",
"public_card_id": "",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": false,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
}
}'
Example Response
Header
Content-Type: application/json
Body
{
"refresh_token": "MY_ACCESS_TOKEN",
"transaction_status": "PROCESSING",
"payment_token": "fa5ec5cc-d4d5-439e-8fb5-0368d409dc9b",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"totals": {
"amount": 123.45,
"original_amount": 123.45,
"original_asset": "BRL",
"customer_fees": 0,
"customer_amount": 123.45,
"asset": "BRL"
},
"customer_fees": {}
}
Example Request
200 - Credit Card (2DS) With Pre-Auth
curl --location 'https://api-sandbox.letpay.io/token/' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"amount": 123.45,
"method": "CREDITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "MY_CONTRACT_ID",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": true,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
}
}'
Example Response
Header
Content-Type: application/json
Body
{
"refresh_token": "MY_ACCESS_TOKEN",
"transaction_status": "PROCESSING",
"payment_token": "MY_PAYMENT_TOKEN",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"totals": {
"amount": 123.45,
"original_amount": 123.45,
"original_asset": "BRL",
"customer_fees": 0,
"customer_amount": 123.45,
"asset": "BRL"
},
"customer_fees": {}
}
Example Request
200 - Credit Card (3DS)
curl --location 'https://api-sandbox.letpay.io/token' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"amount": 123.45,
"method": "CREDITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "MY_CONTRACT_ID",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": false,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
},
"authentication": {
"cavv": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"xid": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"eci": "05",
"version": "2.1.0",
"dstrans_id": "DIR_SERVER_TID"
}
}'
Example Response
Header
Content-Type: application/json
Body
{
"refresh_token": "MY_ACCESS_TOKEN",
"transaction_status": "PROCESSING",
"payment_token": "MY_PAYMENT_TOKEN",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"totals": {
"amount": 123.45,
"original_amount": 123.45,
"original_asset": "BRL",
"customer_fees": 0,
"customer_amount": 123.45,
"asset": "BRL"
},
"customer_fees": {}
}
Example Request
200 - Debit Card (3DS)
curl --location 'https://api-sandbox.letpay.io/token' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"amount": 123.45,
"method": "DEBITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "MY_CONTRACT_ID",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": false,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
},
"authentication": {
"cavv": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"xid": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"eci": "05",
"version": "2.1.0",
"dstrans_id": "DIR_SERVER_TID"
}
}'
Example Response
Header
Content-Type: application/json
Body
{
"refresh_token": "MY_ACCESS_TOKEN",
"transaction_status": "PROCESSING",
"payment_token": "MY_PAYMENT_TOKEN",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"totals": {
"amount": 123.45,
"original_amount": 123.45,
"original_asset": "BRL",
"customer_fees": 0,
"customer_amount": 123.45,
"asset": "BRL"
},
"customer_fees": {}
}
Example Request
401 - Unauthorized
curl --location 'https://api-sandbox.letpay.io/token' \
--header 'X-Auth-Token: INVALID_ACCESS_TOKEN' \
--data '{
"amount": 123.45,
"method": "DEBITCARD",
"asset": "BRL",
"reference_id": "MY_REFERENCE_ID",
"contract_id": "MY_CONTRACT_ID",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"card_installments": 1,
"notification_url": "https://my.notitication.url/callback/",
"delay_capture": false,
"soft_descriptor": "SOFT_DESCRIPTOR",
"ip_address": "0.0.0.0",
"payment_currency": "BRL",
"payment_country": "BR",
"extra_data": {
"my-conciliation-number": "xxxxxx"
},
"authentication": {
"cavv": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"xid": "BwABBylVaQAAAAFwllVpAAAAAAA=",
"eci": "05",
"version": "2.1.0",
"dstrans_id": "DIR_SERVER_TID"
}
}'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-18T19:36:08.362+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/token"
}