Skip to main content

Process Checkout Payment

  POST https://api-sandbox.epag.io/checkout/sendPayment

Processes a Credit/Debit Card payment that were already created using the Checkout Flow. Call this method after Get Person & Credit Card ID method.

Authorization

HeaderValue
X-Auth-TokenMY_ACCESS_TOKEN

Credit Card

In this flow our checkout can serve as a tokenization tool. After the user provides the card data the card is encrypted, tokenized and the merchant receives an ID

  1. Initiate Checkout solution using Credit Card as payment method
  • Flag processPayment = false
  1. User informs Personal information and Credit Card data
  2. Data is encrypted
  3. Retrieve Credit Card payment token
  4. Authenticate on API
  5. Request Tokenized Credit Card Ids
  6. Process Payment

Request Body

  • contract_id (required/string): Merchant's contract id.
  • 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.
  • notification_url (optional/string): URL to post callbacks to this payment.
  • public_person_id (required/string): Person identification.
  • public_card_id (required/string): Card identification.
  • payment (required/object): The payment data:
    • amount (required/string): Total amount of the payment. Value must have a maximum of two decimal places and must not be less than BRL 1.00.
    • method (required/string): Payment Method. Valid options: CREDITCARD, DEBITCARD.
    • asset (required/string): Reference code for asset for the sale's amount.
    • installments (required/int): Number of installments. 0 or 1 values are considered as without installments.
    • delay_capture (optional/boolean): true to pre-authorize payment for later capture. Default: false. Pre-auth cancelation has a TTL of 5 days.
    • soft_descriptor (optional/string): Soft descriptor to use at transaction.
  • extra_data (optional/JSON): Any data pertinent to the merchant.
  • ip_address (optional/string): Remote IP Address(IPv4/IPv6).

Debit Card Request Body

  • authentication (required/object): The 3DS authentication data:
    • cavv (required/string): Card holder Authentication Verification Value.
    • xid (optional/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 Body

  • 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.

Example Request

Example Request

200 - Credit Card (2DS)
    curl --location 'https://api-sandbox.epag.io/checkout/sendPayment' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"contract_id": "MY_CONTRACT_ID",
"reference_id": "MY_REFERENCE_ID",
"notification_url": "https://my.notification.url/callback/",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"payment": {
"method": "CREDITCARD",
"amount": 123.45,
"asset": "BRL",
"installments": "1",
"soft_descriptor": "SOFT_DESCRIPTOR"
},
"ip_address": "0.0.0.0",
"extra_data": {
"my-conciliation-number": "xxxxxx"
}
}'

Example Response

Header
  Content-Type: application/json
Body
    {
"refresh_token": "MY_ACCESS_TOKEN",
"transaction_status": "PROCESSING",
"payment_token": "da0612b4-e0b6-46d5-bb1f-dfc1b12e6568",
"public_person_id": "MY_PUBLIC_PERSON_ID",
"public_card_id": "MY_PUBLIC_CARD_ID",
"public_card_status": "ACTIVE",
"totals": {
"amount": 123.45,
"original_amount": 123.45,
"original_asset": "BRL",
"customer_fees": 123.45,
"customer_amount": 123.45,
"asset": "BRL"
},
"customer_fees": {}
}