Integration Guides
Overview
For successful integration please make sure that:
-
Payment type and endpoint are correct
-
The correct HTTP method POST or GET is used for the request
-
JSON is the mandatory data format for request
-
Each request must have an
Authorizationheader:Bearertoken for the Gateway API,Basiccredentials for the Merchant API (see below)
Authorization depends on the API:
- Gateway API (
/api/v1) uses Bearer authorization:Authorization: Bearer <Shop API Key>. Webhooks are signed with theSignatureheader (see Webhooks signature). - Merchant API (
/merchant-api/v1) uses HTTP Basic authorization. Per the contract, the username and password are the merchant dashboard credentials (email and password). Existing integrations also send the account email together with an API key as the Basic credentials (Email:ApiKey).
Base URLs:
| Environment | URL |
|---|---|
| Production | https://engine.aqui-pay.com |
| Sandbox | https://engine-sandbox.aqui-pay.com |
Full operation reference: Gateway API and Merchant API.
API reference
Base URL: https://engine.aqui-pay.com (sandbox: https://engine-sandbox.aqui-pay.com). Endpoints:
| URI | Method | Description |
|---|---|---|
/api/v1/payments | GET | Get a list of payments sorted by creation date (most recent first) |
/api/v1/payments | POST | Payment request, used for DEPOSITS and WITHDRAWALS |
/api/v1/payments/{id} | GET | Find Payment by Id |
/api/v1/payments/{id} | PATCH | Execute deposit without customer redirection (HostToHost flow); see HostToHost Flow |
/api/v1/balances | GET | Get a list of balances for withdrawal by currency |
/api/v1/available-withdrawal-balances | GET | Available Withdrawal Balances |
This table is an overview; the full list of operations is in the Gateway API reference. Merchant API operations are in the Merchant API reference.
Balances
All balances
Send a request /api/v1/balances to receive balances.
Response payload example:
{
"timestamp": "2026-04-03T13:56:05.651+00:00",
"status": 200,
"result": [
{
"id": 951,
"type": "PROCESSING",
"name": "Processing Balance(BOB) of shop \"Test integration\"",
"currency": "BOB",
"amount": 1
},
{
"id": 947,
"type": "WITHDRAWAL",
"name": "Withdrawal Balance(BOB) of shop \"Test integration\"",
"currency": "BOB",
"amount": 1
}
]
}
| Balance type | Description |
|---|---|
| PROCESSING | The amount of funds on deposit balance |
| WITHDRAWAL | The amount of funds on payout balance excluding commission. Please note that the actual amount available for withdrawal would be lower relative to the upper limit |
Available balances for payouts
Send a request /api/v1/available-withdrawal-balances.
Response payload example:
{
"timestamp": "2025-04-17T08:52:58.971+00:00",
"status": 200,
"result": [
{
"currency": "ARS",
"amount": 1
}
]
}
List of payments
Send a request /api/v1/payments using the "GET" method, In the query Params, send the following parameters as needed.
| Parameter | Description |
|---|---|
| offset | integer [ 0 .. 1000000 ] The number of items to skip before starting to collect the result set. Default is 0. |
| limit | integer [ 1 .. 1000 ] The numbers of items to return. Default is 50. |
| created.gte | string <ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)> Example: created.gte=2021-10-13T10:26:18 If passed, return only payments created at or after the specified time. The default value is set to 24 hours prior to the current time. |
| created.lt | string <ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)> Example: created.lt=2021-10-13T10:39:34 If passed, return only payments created strictly before the specified time |
| updated.gte | string <ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)> Example: updated.gte=2021-10-13T10:26:18 If passed, return only payments updated at or after the specified time |
| updated.lt | string <ISO 8601 (YYYY-MM-DD'T'HH24:MI:SS)> Example: updated.lt=2021-10-13T10:39:34 If passed, return only payments updated strictly before the specified time |
| referenceId.eq | string Example: referenceId.eq=order-12345 If passed, return only payments with the requested referenceId |
These parameters belong to the Gateway API GET /api/v1/payments (limit up to 1000). The Merchant API has its own list operations with Basic authorization and different parameters; see the Merchant API reference.
Webhooks signature
When a payment receives a final status (COMPLETED, DECLINED or CANCELLED), our system sends a webhook.
To receive webhooks, specify "Webhook Url" in the shop settings or add the "webhookUrl" parameter in the "createPayment" request. The request parameter takes precedence over the parameter specified in the shop settings.
To ensure that webhooks come from our system, generate a Signing Key in the shop settings. If the Signing Key is specified, webhooks include 'Signature' header with HMAC-SHA256 hash generated from JSON body and Signing Key.
The webhook payload has the same structure as the "result" field in the GET /api/v1/payments/{id} response.
Webhook example:
$headers = @{
"signature" = "9cb5420c803c865569ee60c32fdf195fb882aa7fdc4ae3f754d0a6d12f235fcd"
"host" = "webhook.site" }
$response = Invoke-WebRequest -Uri "https://webhook.site/22c0540d-1182-47b2-9822-251f6b517753" `
-Method POST `
-Headers $headers `
-ContentType "application/json" `
-UserAgent "Java-http-client/21.0.6" `
-Body "{`"id`":`"9e9003d7f3324fc6828481c665d8bab5`",`"created`":`"2025-03-11T14:01:25`",`"paymentType`":`"DEPOSIT`",`"state`":`"CANCELLED`",`"paymentMethod`":`"BANKTRANSFER`",`"amount`":2000,`"currency`":`"CLP`",`"errorCode`":`"1.04`",`"errorMessage`":`"Cancelled by Timeout`",`"customer`":{`"referenceId`":`"58f0c005-3b7d4c75-81f3-93b9a6fee864`",`"firstName`":`"John`",`"lastName`":`"Quijada`",`"email`":`"[email protected] `",`"phone`":`"569 12321941`"},`"billingAddress`":{`"countryCode`":`"CL`"}}"
Webhook payload format example:
{
"id": "9e9003d7f3324fc6828481c665d8bab5",
"created": "2025-03-11T14:01:25",
"paymentType": "DEPOSIT",
"state": "CANCELLED",
"paymentMethod": "BANKTRANSFER",
"amount": 2000,
"currency": "CLP",
"errorCode": "1.04",
"errorMessage": "Cancelled by Timeout",
"customer": {
"referenceId": "58f0c005-3b7d-4c75-81f3-93b9a6fee864",
"firstName": "John",
"lastName": "Doe",
"phone": "569 1231941"
},
"billingAddress": {
"countryCode": "CL"
}
}
Payment status model
| Status | Description |
|---|---|
| COMPLETED | Final status; the transaction was successful. |
| DECLINED | Final status; the transaction was declined. |
| CANCELLED | Final status; the user canceled the payment or did not complete it |
| PENDING | The transaction has been created but requires additional actions to complete, such as authorization or 3DS verification. |
| AUTHORIZED | The payment was pre-authorized (preAuth); it can be captured or voided. |
| AWAITING_APPROVAL | A WITHDRAWAL payment awaiting merchant approval; it can be approved or rejected. |
| CHECKOUT | The user is expected to be redirected to the payment page to provide payment details. If the terminal is not specified, the selection process is still ongoing. |
Body Params
| Params | Value type | Description |
|---|---|---|
| referenceId | string | Reference assigned by Merchant. Will not go outside the system. Will be sent unchanged in the PaymentResponse. |
| paymentType | string | Defines the type of payment Possible values: "DEPOSIT"/"WITHDRAWAL"/"REFUND". Operations available for a specific method are listed on its Payment methods entry |
| paymentMethod | string | Payment Method |
| amount | number | Payment amount. Available value 1 or 1.00, that mean for example 1 USD |
| currency | string | Currency code according to ISO 4217 alpha-3 |
| parentPaymentId | string | Id of initial deposit for refunds, Id of initial recurring payment for subsequent payments |
| description | string | Description of the transaction shown to the Customer. Can be sent outside the system. |
| card | object | You must be PCI DSS compliant to collect card data on your side. If you are not certified, do not add this field to your request and we will collect the data on our page. |
| card.cardNumber | string | Card primary account number (PAN). All non-numeric characters will be ignored |
| card.cardholderName | string | Cardholder's name printed on the card |
| card.cardSecurityCode | string | Card security code (CVV2 / CVC2 / CAV2) |
| card.expiryMonth | string | Card expiration month, 2 digits |
| card.expiryYear | string | Card expiration year, 4 digits |
| customer | object | |
| customer.referenceId | Id of the customer assigned by Merchant | |
| customer.citizenshipCountryCode | string | Customer country of citizenship |
| customer.firstName | string | Customer's first name |
| customer.lastName | string | Customer's last name |
| customer.dateOfBirth | string | Customer's date of birth |
| customer.email | string | Email address of the customer |
| customer.phone | string | International phone number of the customer, without the '+'. Use a space as a separator between the dialing country code and local phone number. |
| customer.locale | string | Customer preferred display language |
| customer.accountName | string | Customer account name in the provider's system. Used for some types of withdrawals. |
| customer.bankCode | string | User bank code |
| customer.accountNumber | string | Customer account number in the provider's system. Used for some types of withdrawals |
| customer.accountType | string | Account type Available values: SAVINGS, CHECKING - SAVINGS by default if not received in request |
| customer.documentType | string | Document Type |
| customer.documentNumber | string | An identifier for the customer assigned by a government authority |
| customer.routingGroup | string | Identify the customer as belonging to a specific group that is used for routing |
| customer.kycStatus | boolean | Indicates whether the customer has passed KYC verification |
| customer.paymentInstrumentKycStatus | boolean | Indicates whether the payment instrument (usually the card number) has passed KYC verification |
| customer.dateOfFirstDeposit | Date of the first deposit from the customer | |
| customer.depositsAmount | integer | How much the customer has deposited, in base currency |
| customer.withdrawalsAmount | integer | How much the customer has withdrawn, in base currency |
| customer.depositsCnt | integer | How many times the customer made a deposit |
| customer.withdrawalsCnt | integer | How many times the customer made a withdrawal |
| billingAddress.addressLine1 | string | Line 1 of the address (e.g., Number, street, etc) |
| billingAddress.addressLine2 | string | Line 2 of the address (e.g., Suite, apt) |
| billingAddress.city | City name | |
| billingAddress.countryCode | string | 2-character IS0-3166-1 country code |
| billingAddress.postalCode | string | Postal code |
| billingAddress.state | string | State code |
| additionalParameters | object | Additional parameters required by some payment providers. Contact support for more information. |
| preAuth | boolean | Send 'true' if you want to request a Pre-Authorization charge (initiate a 2-phase deposit). |
| returnUrl | string | URL to redirect Customer after processing |
| webhookUrl | string | Url to receive payment status notifications |
| startRecurring | boolean | Send 'true' if you want this payment to initiate recurring chain. Default is 'false'. |
| recurringToken | string | To continue recurring chain, send a token from a previously initiated recurring payment. |
PaymentLink Flow
- Create a Payment Initiate a standard payment creation request to the endpoint /api/v1/payments, POST method. You will be sent a sync response, example:
{
"timestamp": "2025-03-11T12:31:26.812+00:00",
"status": 200,
"result": {
"id": "03828c966eb647df8a7b35b19d21cd55",
"created": "2025-03-11T12:31:26",
"paymentType": "DEPOSIT",
"state": "CHECKOUT",
"paymentMethod": "BANKTRANSFER",
"amount": 2000.00,
"currency": "CLP",
"redirectUrl": "https://engine.aqui-pay.com/payment/03828c966eb647df8a7b35b19d21cd55",
"customer": {
"referenceId": "58f0c005-3b7d-4c75-81f3-93b9a6fee864",
"firstName": "John",
"lastName": "Doe",
"phone": "569 12312341"
},
"billingAddress": {
"countryCode": "CL"
}
}
}
- You need to redirect the user to the URL from the "redirectUrl" field for payment.
HostToHost Flow
This flow is not available for all methods, please contact the manager for details.
-
Create a Payment Initiate a standard payment creation request to the endpoint /api/v1/payments, POST method.
-
Receive a Response
-
The redirectUrl field should be ignored, as it is intended for redirect-based flows.
-
Extract the id of the transaction for the next Api call.
-
Retrieve Payment data via PATCH
Since no redirection is used, the payment details should be retrieved by sending a PATCH request to /api/v1/payments/{id}. This request must include the customer's IP address:
curl --request PATCH \
--url https://engine.aqui-pay.com/api/v1/payments/{id} \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Shop API Key>' \
--data '{
"customerIp": "81.4.178.167"
}'
- Processing the response
The API will respond with an externalRefs object containing all necessary details for processing the payment.