What is Checkout?

Checkout is the final stage of the purchasing process in an online store. It refers to the last part during the customer's browsing stage. This is the time when the customer needs to enter their personal details to make the payment, such as their card number and CPF (Cadastro Nacional de Pessoa Física): Brazilian Individual Taxpayer’s Identification Number (equivalent to Social Security Number USA).

Note that cart abandonment can occur at this stage. This occurs when the buyer decides to abandon the purchase when it comes time to make the payment. This can happen for various reasons. If a website is not well structured, the chances of losing the sale increase significantly. When buying online, consumers don't have to leave the house and queue for hours. All it takes is a few clicks for the purchase to be completed and the goods to arrive in a few days.

Today, e-commerce is one of the easiest and simplest ways to buy a product. It is therefore essential to ensure that this process is safe, agile and efficient. For this, the page where the checkout takes place needs to have a good system, so that the customer can complete the purchase quickly and without any major setbacks. Since there's no point in attracting customers to your e-commerce, but having a checkout process that leaves the customer confused when it comes to concluding the purchase.

Overview – Adiq Checkout

The purpose of this documentation is to guide the developer on how to integrate with the Adiq Ecommerce API, describing the functionalities and methods to be used, listing information to be sent and received and providing examples.

In this manual you will find references to all the operations related to creation, consultation and webhook. These operations must be performed using your specific key on the respective environment endpoints:

Attention: Transactions pre-authorized by the checkout must be captured in PUT /v1/payments/(paymentId)/capture, please follow this link.

Homologation Production
Requests https://ecommerce-hml.adiq.io https://ecommerce.adiq.io

In order to perform an operation, combine the environment's base URL with the URL of the desired operation and send it using the HTTP verb as described in the operation.

Adiq Checkout Navigation Flow

Start Screen

Presents the order items and the customer's personal details.

Start Screen of checkout

Address Screen

Presents the addresses to be confirmed for the purchase.

Tela de endereços do Checkout

Payment Method Selection Screen

Presents debit, credit and pix payment methods.

Payment Method Selection Screen

Registered Card Screen

The customer must provide their card details.

Card Registration Screen

Registered Card Screen

The customer must provide their card details.

Card Registration Screen Image

Pix Selection Screen

Customers will see the value and expiry time of the Pix.

Pix Selection Screen Image

Pix Payment Screen via QR Code

Customers must follow the instructions to pay for the pix via the QR Code.

Pix Payment Screen via QR Code

Pix Expiration Screen

Screen with instructions related to expired pix.

Pix Expiration Screen Image

Receipt Screen – Payment performed

Presents a receipt that the transaction has been authorized.

Receipt Screen – Payment performed Image

Payment Failure Screen when Payment Method is Denied

Presents the message that the payment was not authorized and will be asked to make a new attempt with the payment methods offered.

Payment Failure Screen when Payment Method is Denied Image

Checkout will be blocked

Checkout may be blocked for the following reasons:

  • Exceed payment attempts by a maximum of 5 or less, depending on how it was configured when creating the checkout via the POST v1/checkout.
  • Rejected by the anti-fraud process.
Tela de bloqueio do Checkout

Access to a Non-Existing or Expired Checkout

Presents the screen with the alert that the checkout does not exist or is expired.

Tela de Checkout não encontrado

Access to a Checkout that has Already been Paid For

Presents the purchase receipt screen with the order data.

Tela de Checkout já pago

Customization of the Checkout Layout

Customization of the layout offers several options for adapting the appearance of your store to your specific preferences and needs. You can change the colors, allowing the color scheme to reflect your brand's visual identity. You can also modify the fonts, choosing type styles that best match the tone and personality of your business.

In addition to the colors and fonts, it is also possible to add your store's logo, ensuring that the brand identity is clearly visible throughout the layout. Other customizable aspects include the layout of the pages, where you can organize and reorganize sections such as headers and navigation menus and content areas to improve the user experience and usability of the site.

With all these customization options, you can create a layout that not only meets your functional needs, but also reflects your brand's personality and values, providing an engaging and memorable experience for your store's visitors.

In order to customize your layout, please contact us at atendimento@adiq.com.br

Tela de Checkout customizado

Create a Checkout

Authentication

The APIs listed in this documentation use Basic Auth authentication, which means that in all requests it is mandatory to enter an access token that will be obtained through authentication with your Client ID and Client Secret

Generation of the access token

In order to create an access token, you need to send a Request using HTTP Basic Authentication via the POST method as shown in the example:

Request

                    
                        
{
    "grantType": "client_credentials"
}	
                        
                    

                
Property Description Type Location Mandatory
GrantType Use fixed value “client_credentials.” string body yes
Authorization Concatenation of your Client ID, followed by “:” (colon) plus your Client Secret, converted to base64.
Example: Authorization: Basic ZGV2ZWxvcGVycy5hZGlxLmlv
string header yes

Response

                    
                        
{
    "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6WyJBRElRIiwiQURJUQ",
    "tokenType": "Bearer",
    "expiresIn": "36000",
    "scope": "GatewayEcommerce"
}
                        			
                    
                
Property Description Type
AccessToken API access token to be submitted with all requests. string
TokenType Type of token, must be submitted in the header along with the token. string
ExpiresIn Token expiration time in seconds. integer
Scope Scope of the token. string

Payment with Credit/Debit Card and Pix

Request

                    
                        
{
    "view": "modal",
    "payment": {
        "checkoutOrderNumber": "12345646546456456456",
        "softDescriptor": "PAG*TESTE",
        "successPostUrl": "https://empresa.com.br/sucesso/12345646546456456456",
        "failPostUrl": "https://empresa.com.br/falha/12345646546456456456",
        "expireInMinutes": 4320,
        "captureType": "ac",
        "cardAttemps": 2,
        "types": [
            "credit",
            "debit",
            "pix"
            ],
        "maxInstallment": 1,
        "returnSuccessUrl": "https://empresa.com.br/sucesso/12345646546456456456",
        "returnFailUrl": "https://empresa.com.br/falha/12345646546456456456",
    },
    "customer": {
        "firstName": "Josh",
        "lastName": "Joe",
        "cpfCnpj": "43538559058",
        "email": "customer@empresa.com",
        "phone": "5511911112222"
    },
    "billTo": {
        "address": "rua expedito",
        "number": "12454",
        "neighborhood": "vila clementina",
        "complement": "",
        "city": "São Paulo",
        "state": "SP",
        "zipCode": "45454545",
        "country": "BR"
    },
    "shipTo": {
        "address": "rua expedito",
        "number": "12454",
        "neighborhood": "vila clementina",
        "complement": "",
        "city": "São Paulo",
        "state": "SP",
        "zipCode": "45454545",
        "country": "BR",
        "firstName": "Josh",
        "lastName": "Joe",
        "phone": "5511911112222"
    },
    "threeDs": {
        "urlSite": "lojavirtual.com.br",
        "creditEnabled": true
    },
    "antifraud": {
        "checkDocBearer": false
    },
    "shipping": {
        "description": "Sedex",
        "type": "delivery",
        "price": 1549
    },
    "lineItems": [
        {
            "code": "012121",
            "sku": "CALCALCAL42",
            "name": "t-shirt",
            "qty": 1,
            "unitPrice": 5900
        },
        {
            "code": "012155",
            "sku": "PANPAN51",
            "name": "pants",
            "qty": 2,
            "unitPrice": 9900
        }
    ]
}	
                        
                    
                
Property Description Type Location Mandatory Maximum Size
view How the checkout will be opened on the store page
Value Description
redirect When the customer completes the purchase, they will be redirected to payment.returnSuccessUrl
modal Checkout should be opened as a modal window on the store page and the user will close the modal via the X in the modal.
string body yes Fixed
payment.checkoutOrderNumber Checkout Order Number Unique numeric alpha field that is the order code. string body yes 30
payment.softDescriptor

Text shown on the buyer's card bill.

  • Must not contain special characters, except '*';
  • Must not start with *;
  • Must contain only one '*';
  • Maximum length of 22 characters;

E.g.: PAG*LOJAXPTO
string body yes 22
payment.successPostUrl Url for the webhook to report the checkout status. string body yes 300
payment.failPostUrl Url for the webhook to report the status of the checkout in case of payment failure, expiration or blocking due to fraud. string body yes 300
payment.expireInMinutes Inform in minutes the validity of the checkout, after the deadline the checkout will be inactivated. integer body yes 43199
payment.captureType
Value Description
pa Pre-Authorize
ac Authorize and capture
string body Yes, if payment.types has a 'credit' and/or 'debit' payment method. 2
payment.cardAttemps Maximum number of attempts for the user to pay, possible value is minimum 1 and maximum 4. This will be counted when an attempt is made to authorize a payment but the operation is denied. integer body yes From 1 to 4
payment.types Array of string [“credit”,“debit”,“pix”] in this field should inform which payment methods will be enabled for the checkout.
Value Description
credit Credit
debit Debit
pix Pix
string[] body yes Fixed
payment.maxInstallment Maximum amount of installment that can be offered for a Credit operation. integer body yes From 1 to 12
payment.returnSuccessUrl For the checkout, when the view is redirected and the payment is made, the home button will be directed to this url. string body yes 300
payment.returnFailUrl For the checkout, when the view is redirected and there is an authorization failure, the home button will be directed to this url. string body yes 300
customer.firstName Customer's name without surname. string body yes 60
customer.lastName Customer's surname. string body yes 60
customer.cpfCnpj Document number cpf or cnpj. string body yes 14
customer.email Email must be valid. string body yes 255
customer.phone Telephone number. Include the prefix 55 to indicate that it is from Brazil. string body yes 15
billTo.address Street name of the buyer's address. string body yes 60
billTo.number Buyer's street number. string body yes 15
billTo.neighborhood Name of the buyer's neighborhood. string body yes 60
billTo.complement Complement of the buyer's address. string body no 30
billTo.city Name of the buyer's city. string body yes 50
billTo.state Name of the buyer's state. string body yes 20
billTo.zipCode Buyer's zip code. string body yes 10
billTo.country Buyer's country. string body yes Fixed 2
shipTo.address Name of the delivery address. string body Depends on Delivery Type 60
shipTo.number Delivery address number. string body Depends on Delivery Type 15
shipTo.neighborhood Name of the delivery district. string body Depends on Delivery Type 60
shipTo.complement Delivery address complement. string body no 30
shipTo.city Name of delivery city. string body Depends on Delivery Type 50
shipTo.state Name of the delivery state. string body Depends on Delivery Type 20
shipTo.zipCode Delivery ZIP code. string body Depends on Delivery Type 10
shipTo.country Country of delivery. string body Depends on Delivery Type Fixed 2
shipTo.firstName Name of the person who will receive the product without surname. string body Depends on Delivery Type 60
shipTo.lastName Surname of the person who will receive the product. string body Depends on Delivery Type 60
shipTo.phone Telephone number of the person who will receive the product. Include the prefix 55 to indicate that it is from Brazil. string body Depends on Delivery Type 15
threeDs.urlSite URL of the site offering the products, for example, the site is https://mycompany.com.br so you must enter [mycompany.com.br] without entering [https://]. string body Yes, when 3ds authentication is available 255
threeDs.creditEnabled For credit operations it is possible to inactivate 3ds. boolean body yes Fixed
antifraude.checkDocBearer Contracted anti-fraud service to verify that the document belongs to the card. If you enter true and have not contracted, you will receive a validation error. boolean body yes Fixed
shipping.description Name of the delivery service. string body no 60
shipping.type Type of delivery for the product.
Value Description
delivery Delivery
pickup Collection point
digital When there is no physical product but a digital one or a service.
string body yes Fixed
shipping.price Cost of delivery in cents, all other delivery types must be entered as 0 (Zero). integer body no Max(integer)
lineItems_#_code Store product code. string body No, but recommended 20
lineItems_#_sku A SKU (Stock Keeping Unit) is a unique code assigned to a product for tracking and inventory management purposes. string body No, but recommended to process anti-fraud 50
lineItems_#_name Product name. string body yes 60
lineItems_#_qty Product quantity. integer body yes Max(integer)
lineItems_#_unitPrice Unit price in cents of the product. integer body yes Max(integer)

Response Status Code 200

                    
                        
{
    "url": "https://checkout.adiq.io/37ccd769-a4f5-4201-bcb7-f45c5d0b1ebc",
    "checkoutId": "37ccd769-a4f5-4201-bcb7-f45c5d0b1ebc",
    "checkoutOrderNumber": "12345646546456456456",
    "status": "created",
    "totalProductAmount": 257,
    "shippingPrice": 15.49,
    "expiredAt": "2024-06-22T10:27:01.7429831-03:00"
}
                        
                    
                
Property Description Type Location Mandatory Maximum Size
url Payment checkout url. string body yes 255
checkoutId Id of the checkout which is used to search for the status of the operation and will inform the webhook of the actions that occur such as failed payment attempt, expiration, blocking or payment made. guid body yes Fixed
checkoutOrderNumber Order number entered when creating the checkout. string body yes 30
status Transaction status
Value Description
created created
string body yes Fixed
totalProductAmount Total value of the products in Reais, excluding shipping. decimal body yes Max(decimal)
shippingPrice Shipping costs in reais. decimal body yes Max(decimal)
expiredAt Checkout time zone expiration date São Paulo/Brazil. datetime body yes 40

Response Status Code 400

                    
                        
[
    {
    "tag": "Campo",
    "description": "Não pode ser nulo ou vazio"
    }
]
                        
                    
                
Property Description Type Location Mandatory Maximum size
tag Name of the criticized field. string body yes 100
description Description of the failure/fault. string body yes 300

Consult a Checkout

The consultation will tell you if it has already been paid, expired, blocked, being processed or checked.

Provides a history of the events that have occurred in the customer's actions on the checkout.

Request

                    
                        
{
    "status": "paid",
    "checkoutOrderNumber": "TESTE-123472",
    "transaction": {
        "pix": { 
            "status": "Pago", 
            "amount": 400,  
            "qrCode": "00020126420014br.gov.bcb.pix0120adiqplus@adiq.com.br520400005303986540510.005802BR5908ADIQPLUS600", 
            "qrCodeId": "xRC35GjYIcz+ATVq90Q6mib+VQPD23xExYPY0UzinIY=",	 
            "endToEndId":"E245475545454654754654545P", 
            "orderNumber": "c72fcad9-bfa7-4316-b48a-31c11cea303e", 
            "posTransactionId": "05c5eacd-5712-49b5-b4b5-3feb6aa90119", 
            "paymentDate": "2024-07-15T15:43:07.8291734-03:00", 
            “payer”: { 
                     “name”: “Joe Doe”, 
                     “documentType”: “cpf”, 
                     “document”: “79319845018” 
            } 
        }
        "card": {
            "numberMasked": "40000000****1091",
            "returnCode": "0",
            "description": "Sucesso",
            "authorizationCode": "953715",
            "orderNumber": "5175d8c9ed2d4",
            "amount": 400,
            "releaseAt": "2024-06-19T18:40:15.7046589-03:00",
            "installment": 1,
            "captureType": "ac",
            "transactionType": "credit",
            "threeDs": {
                "status": "Challenge",
                "eci": "05",
                "threeDsversion": "2.1.0",
                "paresStatus": "Y",
                "threeDsStatus": "AUTHENTICATION_SUCCESSFUL"
            }
        }
    },
    "transactionHistory": [
        {
            "transactionDate": "2024-06-19T18:39:57.2044224-03:00",
            "paymentType": "credit",
            "transactionOrderNumber": "5175d8c9ed2d4",
            "code": "status awaiting treatment",
            "description": "Challenge transaction"
        },
        {
            "transactionDate": "2024-06-19T18:40:12.3969634-03:00",
            "paymentType": "credit",
            "transactionOrderNumber": "5175d8c9ed2d4",
            "code": "0",
            "description": "Sucesso"
        },
        {
            "transactionDate": "2024-06-19T18:38:12.3969634-03:00",
            "paymentDate" "2024-06-19T18:41:12.3969634-03:00",
            "paymentType": "pix",
            "transactionOrderNumber": "d1bcf03b429e437ab29262f0315cc73a",
            "status": "success"
        }
    ]
}
                        
                    
                
Property Description Type Location Mandatory Maximum Size
checkoutId Identification of the checkout to be consulted. string path yes 36
status Checkout state
Value Description
created Checkout created
pending Waiting for payment
checking Processing Payment
pendingPayment Waiting for Pix payment
paid Paid
expired Checkout expired
blocked Checkout blocked due to suspected fraud or number of attemps
failed Checkout payment failed
string body yes 20
checkoutOrderNumber Checkout Order Number Unique numeric alpha field that is the order code. string body yes 30
transaction.card.numberMasked Masked card number. string body Yes, if payment is authorized by card. 20
transaction.card.returnCode Response code from ecommerce. string body Yes, if payment is authorized by card. 2
transaction.card.description Transaction status description. string body Yes, if payment is authorized by card. 50
transaction.card.authorizationCode Authorization code. string body Yes, if payment is authorized by card. 6
transaction.card.orderNumber Order number in ecommerce. string body Yes, if payment is authorized by card. 13
transaction.card.amount Value in cents in ecommerce. string body Yes, if payment is authorized by card. Max(integer)
transaction.card.releaseAt For pre-authorized transactions, you are informed of how long it will take to be captured in ecommerce. datetime body Yes, if payment is authorized by card. 33
transaction.card.installment How many installments have been authorized. integer body Yes, if payment is authorized by card. From 1 to 12
transaction.card.captureType Type of capture
Value Description
pa Pre-authorized
ac Captured

If pre-authorized, the store must request the capture in adiq's ecommerce via the api.
string body Yes, if payment is authorized by card. 2
transaction.card.transactionType Transaction type
Value Description
credit Credit
debit Debit
string body Yes, if payment is authorized by card. Fixed, credit or debit
transaction.card.threeDs.status 3ds state. string body Yes, if the operation authorizes 3ds 30
transaction.card.threeDs.eci ECI code
Value Description
00 Failure
01 Attempt
02 Success
05 Success
06 Attempt
07 Failure
string body Yes, if the operation authorizes 3ds 2
transaction.card.threeDs.threeDsversion Version that the 3ds was processed in. string body Yes, if the operation authorizes 3ds 10
transaction.card.threeDs.veresEnrolled Availability of 3ds. string body Yes, if the operation authorizes 3ds 1
transaction.card.threeDs.paresStatus Result of the authentication check.. string body Yes, if the operation authorizes 3ds 1
transaction.card.threeDs.threeDsStatus Description of 3ds. string body Yes, if the operation authorizes 3ds 50
transaction.pix.status Description of the operation status. string body Yes, if payment is authorized via Pix. 30
transaction.pix.amount Value in cents of the pix. int body Yes, if payment is authorized via Pix. Max(integer)
transaction.pix.qrCode QrCode for the pix. string body Yes, if payment is authorized via Pix. 500
transaction.pix.qrCodeId QrCode. string body Yes, if payment is authorized via Pix. 255
transaction.pix.endToEndId Id end to end of the pix. string body Yes, if payment is authorized via Pix. 50
transaction.pix.orderNumber Pix generation number. string body Yes, if payment is authorized via Pix. 50
transaction.pix.posTransactionId PIX authorization transaction code. string body Yes, if payment is authorized via Pix. 50
transaction.pix.paymentDate Time of payment. datetime body Yes, if payment is authorized via Pix. 33
transaction.pix.payer.name Name of payer. string body Yes, if payment is authorized via Pix. 200
transaction.pix.payer.documentType Type of document. string body Yes, if payment is authorized via Pix. 5
transaction.pix.payer.document Document number. string body Yes, if payment is authorized via Pix. 30
transactionHistory_#_transactionDate Date of the event. datetime body Yes, if there was any customer action at the checkout 33
transactionHistory_#_paymentType Transaction type
Value Description
credit Credit
debit Debit
pix Pix
string body Yes, if there was any customer action at the checkout Fixo
transactionHistory_#_transactionOrderNumber E-commerce order number. string body Yes, if there was any customer action at the checkout 50
transactionHistory_#_code Authorization code or Fault description. string body Yes, if the transaction is via card. 100
transactionHistory_#_description Event description. string body Yes, if the transaction is via card. 100
transactionHistory_#_paymentDate Date of payment authorization in UTC time zone. datetime body Yes, if payment is authorized via Pix. 33
transactionHistory_#_status Transaction status
Value Description
success Authorized Pix
createdPix Pix created
expiredPix Pix expired
failedPix Pix generation failed
treated Pix without momentary payment identification and with expiration date reached
string body Yes, if payment is authorized via Pix. 30

Webhook

In order to be notified of payment attempt events and completed checkouts, facilitating processing on the store side, follow these steps: Whenever you receive a success notification, the store system must look up more details of the checkout in the API GET /v1/checkout/authorization/(checkoutId). This instruction is mandatory for the store to make sure that the transaction has actually taken place.

Recurrence of Attempts

The webhook is configured to attempt to communicate with the specified success or failure URL up to five times.

Below is a simulation of the communication attempts, including the number of each attempt and the corresponding time:

Tentativa Tempo Descrição
1st Immediately 00h00m The event occurred at midnight
2° Tentativa 00h05m A new attempt will be submitted after 5 minutes.
3° Tentativa 00h35m After 30 minutes from the last attempt.
4° Tentativa 01h35m After 1 hour from the last attempt.
5° Tentativa 03h05m After 1.5 hours from the last attempt.
6° Tentativa 05h:05m After 2 hours from the last attempt.

Payment Successfully Executed

This webhook indicates that the checkout was successful.

Request

                    
                        
{
    "PaymentId": "020046766206211937370002243237650000000000",
    "OrderNumber": "eF9nSlwD2yUVJ",
    "CheckoutOrderNumber": "19349946456456456999991",
    "StatusDescription": "Sucesso",
    "StatusCode": "00", 
    "Date": "2024-06-22T15:45:26.9969839-03:00",
    "PaymentMethod": "Checkout"
}
                        
                    
                

Response Status Code 200

Indicates that it was successfully received.

Response Status Code Others

Indicates that it has failed and a new webhook attempt will be made later.

Events in Checkout

This webhook indicates that there have been some events in Checkout

Request

                    
                        
{
    "CheckoutOrderNumber": "19349946456456456999991",
    "StatusDescription": "Checkout had a transaction denied.",
    "StatusCode": "01", 
    "Date": "2024-06-22T15:45:26.9969839-03:00",
    "PaymentMethod": "Checkout"
}
                        
                    
                

Response Status Code 200

Indicates that it was successfully received.

Response Status Code Others

Indicates that it has failed and a new webhook attempt will be made later.

Property Description Type Location Mandatory Maximum size
paymentId Payment identifier, also known as TID. string body Yes, if the transaction was authorized 42
orderNumber OrderNumber entered by the checkout process in the Payment Request. string body Yes, if the transaction was authorized 13
checkoutOrderNumber Checkout order number entered when creating the checkout. string body yes 30
statusDescription Event description. string body yes 100
statusCode Status of the operation. string body yes 2
date Date of the event. datetime body yes 33
paymentMethod Fixed 'Checkout' which indicates that the origin of the webhook is from the checkout process. string body yes 30

Domain

Status Code Status Description Description
00 Sucess Checkout is paid, confirm by checking the transaction.
01 The checkout had a transaction denied. Signaling that there has been a failed payment attempt.
02 The checkout is blocked. Checkout is blocked when payment attempts have been exceeded..
03 The checkout has expired. Once the expiry date has passed, the checkout expires.