Latam Payments API Docs
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Authentication
      • Merchant Onboarding and Payment Flow
        • Collectors
        • Store
        • Point of Sales
      • QR
      • Reconciliation Files
      • Callbacks
Powered by GitBook
On this page
  • QR Payments Flow
  • Statuses of a Payment
  • Create a new QR for a Point of Sales
  • Preview Callback Response
  • QR Expiration Time
  • How can we simulate QR authorization in the Stage environment?
  • Cancel an existing QR
  • QR Refund
  • Preview Callback Response
  • Get Payment Statuses
  1. Reference
  2. API Reference

QR

PreviousPoint of SalesNextReconciliation Files

Last updated 1 day ago

In the Depay ecosystem, QR codes are a powerful tool for enabling international payments. Each QR code generated represents a "sales order" with all the necessary transaction information, including the specific payment amount, currency, and store details. Customers simply provide the essential purchase details, and Depay generates an interoperable QR code that can be used across borders. This makes it easier for merchants to accept payments from customers with local wallets, ensuring a seamless and secure payment experience without any complexity for the user.

QR Payments Flow

When a user wants to make a purchase in a different country, the merchant sends the purchase details to their local Payment Service Provider (PSP). The PSP forwards the request to Depay, which calculates the currency conversion and generates a QR code compatible with the user's currency. The merchant presents the QR code to the customer, who scans it, accepts the conversion, and completes the payment. Once the payment is credited, Depay notifies the PSP via a webhook, who in turn informs the merchant of the payment outcome.

This process provides a seamless and cross-border payment experience, allowing customers to pay in their local currency while ensuring merchants receive funds in theirs, thus simplifying international transactions for all parties involved.

Statuses of a Payment

CREATED

The order has been created.

PROCESSING

The payment was accepted and is being processed.

COMPLETED

The payment was successfully completed.

CANCELED

The preview was not accepted by the user or it expired.

REFUNDED

The order has been refunded.

PARTIALLY_REFUNDED

The order was partially refunded.

REJECTED

The payment has been rejected by the destination bank account.

FAILED

The payment failed due to an unexepcted error.

Create a new QR for a Point of Sales

POST https://stage.api.payments.depay.us/qr

This endpoint allows you to create a new QR code for a specific point of sale (POS) and payment amount. By providing the necessary details, such as the POS identifier, local amount, and currencies, a QR code will be generated to facilitate the payment process. Once the QR code is scanned and the payment is either successfully completed or rejected, a notification will be sent to the provided "notification_url", keeping the customer updated on the status of the transaction. This enables a seamless cross-border payment experience.

Headers

Name
Type
Description

Authorization*

String

Bearer Token

Request Body

Name
Type
Description

local_currency*

String

Represents the default currency of the merchant’s country. It must be provided in ISO 4217 format

local_country*

String

Merchant’s country. It must be provided in ISO 3166-1 alpha-2 format (e.g., "AR" for Argentina).

qr_from*

String

Represents the country of origin of the QR by its country code. It must be provided in ISO 3166-1 alpha-2 format (e.g., "AR" for Argentina).

amount*

Decimal

The total amount in the currency of the merchant’s currency.

pos_external_reference*

String

The identifier of the point of sale (POS) used when associating a POS to a store during the merchant onboarding process.

external_reference*

String

The identifier used to link and track the operation.

notification_url*

String

The provided URL is a POST endpoint used to receive notifications about changes in the payment status.

tax_id

String

Merchant tax identification number

items

Object

Items of the order

sku_number

String

Unique Identifier of the item

category

String

Category of the item

name

String

Name of the item

quantity

Decimal

Quantity of purchased items

unit_price

Decimal

Unit price of the item

total_amount

Decimal

Total amount of the purchased item

{   
    "status": "success",  
    "order_id": "7478bd70-87ad-49d0-9143-9b148d776fc7",  
    "qr_data": "00020101021102080000000041370012com.TEST98113069226478599020143160012B000004551965015001130707101020512600220000531909000067076630520454115802AR5918GRANJAS CARNAVE SA6012BUENOS AIRES61041000530303262100706S0282581050001Z63040F00",
    "message": "QR generated successfully."     
}
{
    "statusCode": 400,
    "message": [
        "notification_url is required"
    ]
}
{   
    "statusCode": 401,
    "message": "Unauthorized"
}
{
    "statusCode": 409,
    "message": "Conflict error"
}
Request Body Example
{
    "local_currency": "BRL",
    "local_country": "BR",
    "qr_from": "AR",
    "amount": 10,
    "pos_external_reference":"ABC1s23",
    "external_reference": "ref_qr_1738847080464_uxv7qyvixc",
    "notification_url": "https://webhook.site/82457e1d-8d96-4d00-8ef9-3df6c62a4950",
    "tax_id": "123456789"     
}

Preview Callback Response

This response will be sent to the callback (notification_url).

Callback Body Example
{
  "order_id": "cdaa1916-661d-4840-9578-161d89f84b6a",
  "external_reference": "ref_qr_1738847080464_uxv7qyvixc",
  "order_status": "CREATED",
  "local_amount": 10,
  "local_currency": "BRL",
  "user_amount": 2139.1682999216637,
  "user_currency": "ARS",
  "qr_code": "00020101021102080000000041370012com.TESTbind98114668759911499020143360032B00000515988OD000002114079ETA0545015001120322678275512600220000531905054067220517520457345802AR5905Depay6014CABA - Almagro6108C1006ACT530303262100706S1740981080004A0546304924D"
}

QR Expiration Time

A QR code will expire 10 minutes after its creation in both Stage and Production environments.

How can we simulate QR authorization in the Stage environment?

To simulate QR authorization in the Stage environment:

Closed QR codes, the final digit of the amount determines the simulated response:

  • If the amount ends in 9, the QR will return status: FAILED.

  • If the amount ends in 8, it will return status: CREATED, followed by CANCELED.

  • For any other ending digit (not 8 or 9), the QR will return status: COMPLETED.

Examples:

  • amount: 1000 → COMPLETED

  • amount: 1008 → CREATED then CANCELED

  • amount: 1009 → FAILED

Cancel an existing QR

DELETE https://stage.api.payments.depay.us/payins/qr/{order_id}

This endpoint allows you to cancel an existing QR code for a given point of sale (POS) identifier. By using this DELETE method, the corresponding QR code is invalidated, and any Pending Payment requests are effectively canceled.

Query Parameters

Name
Type
Description

order_id*

string

Uuid of the order

Headers

Name
Type
Description

Authentication*

String

Bearer Token

{
    "statusCode": 401,
    "message": "Unauthorized"
}
{
    "statusCode": 404,
    "message": "ORDER_NOT_FOUND"
}
{
    "statusCode": 409,
    "message": "The order has already been canceled."
}

QR Refund

POST https://stage.api.payments.depay.us/qr/refund

This endpoint allows you to request a refund for an existing QR payment using the order identifier. The refund can be either partial or full, as specified in the request. Additionally, a notification_url must be provided, where Depay will send updates regarding the refund status, such as whether it was successful or rejected.

Status
Description
Is Final

PENDING

The refund is still being processed.

No

REJECTED

The refund encountered an error.

No

PARTIALLY_REFUNDED

The funds have been deducted from the merchant, but the refund to the customer is not yet complete.

No

REFUNDED

The refund has been successfully completed.

Yes

Headers

Name
Type
Description

Authentication*

String

Bearer Token

Request Body

Name
Type
Description

order_id*

String

The order identifier

partial*

Boolean

true = Partial refund

false = Full refund

amount*

Decimal

The total amount to be refunded. The gross amount must be entered without deductions.

notification_url

String

The provided URL is a POST endpoint used to receive notifications about changes in the refund status.

reason

String

Description of the refund reason.

Request Body Example
{
    "order_id": "e8a7a740-6f47-11ec-90d6-0242ac120003",
    "partial": false,
    "amount": 1000,
    "reason": "refund reason",
    "notification_url": "https://qrpayments.depay.us/webhook/"
}
{
    "id": "e8a7a740-6f47-11ec-90d6-0242ac120003",     
    "status": "PENDING"
}
{
    "statusCode": 401,
    "message": "Unauthorized"
}
{
    "statusCode": 404,
    "message": "ORDER_NOT_FOUND"
}
{
    "statusCode": 409,
    "message": "The order is totally refunded."
}

Preview Callback Response

This response will be sent to the callback (notification_url).

Total Refund - Callback Body Example
{
    "order_id":"d8455bl0-8060-52c3-dfc2-c167cf3bd22d",
    "type":"REFUND",
    "status":"REFUNDED",
    "message":"Refund DEVUELTA",
    "external_reference":"d8044af9-7559-50b3-agf2-b256ed3ag14f"
}
Partial Refund - Callback Body Example
{
  "order_id": "419ff361-0c02-4071-a914-251e72611155",
  "type": "REFUND",
  "status": "PARTIALLY_REFUNDED",
  "message": "Refund DEVUELTA",
  "external_reference": "refqr1749216815792_nxf1whwc5of"
}

Get Payment Statuses

GET https://stage.api.payments.depay.us/payins/orders/{order_id}

Allows users to inquire about the current status of their payments.

Headers

Name
Type
Description

Authorization*

String

Bearer Token

Query Parameters

Name
Type
Description

order_id*

String

Order identifier. This field corresponds to the id field within the order object retrieved from the QR information retrieval endpoint. Required.

{
    "id": "7478bd70-87ad-49d0-9143-9b148d776fc7",
    "status": "COMPLETED",
    "creation_date": "2023-05-15T11:45:38.2678234+00:00",
    "update_date": "2023-05-15T11:45:38.2678234+00:00",
    "local_amount": 7,
    "local_currency": "ARS",
    "user_amount": 7,
    "user_currency": "ARS",
    "external_reference": "123123123",
    "statuses":[
        {
            "status": "CREATED",
            "created_at": "2024-11-01 20:01:30.948423"
        },
        {
             "status": "WAITING_AMOUNT",
            "created_at": "2024-11-01 20:01:50.567650"
        },
        {
             "status": "COMPLETED",
            "created_at": "2024-11-01 20:02:00.343641"
        }
    ]
}
{
    "statusCode": 401,
    "message": "Unauthorized"
}
{
    "statusCode": 404,
    "message": "ORDER_NOT_FOUND"
}