Skip to main content

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 Authorization header: Bearer token for the Gateway API, Basic credentials 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 the Signature header (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:

EnvironmentURL
Productionhttps://engine.aqui-pay.com
Sandboxhttps://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:

URIMethodDescription
/api/v1/paymentsGETGet a list of payments sorted by creation date (most recent first)
/api/v1/paymentsPOSTPayment request, used for DEPOSITS and WITHDRAWALS
/api/v1/payments/{id}GETFind Payment by Id
/api/v1/payments/{id}PATCHExecute deposit without customer redirection (HostToHost flow); see HostToHost Flow
/api/v1/balancesGETGet a list of balances for withdrawal by currency
/api/v1/available-withdrawal-balancesGETAvailable 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 typeDescription
PROCESSINGThe amount of funds on deposit balance
WITHDRAWALThe 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.

ParameterDescription
offsetinteger [ 0 .. 1000000 ]
The number of items to skip before starting to collect the result set. Default is 0.
limitinteger [ 1 .. 1000 ]
The numbers of items to return. Default is 50.
created.gtestring <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.ltstring <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.gtestring <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.ltstring <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.eqstring
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",
"email": "[email protected]",
"phone": "569 1231941"
},
"billingAddress": {
"countryCode": "CL"
}
}

Payment status model​

StatusDescription
COMPLETEDFinal status; the transaction was successful.
DECLINEDFinal status; the transaction was declined.
CANCELLEDFinal status; the user canceled the payment or did not complete it
PENDINGThe transaction has been created but requires additional actions to complete, such as authorization or 3DS verification.
AUTHORIZEDThe payment was pre-authorized (preAuth); it can be captured or voided.
AWAITING_APPROVALA WITHDRAWAL payment awaiting merchant approval; it can be approved or rejected.
CHECKOUTThe 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​

ParamsValue typeDescription
referenceIdstringReference assigned by Merchant. Will not go outside the system. Will be sent unchanged in the PaymentResponse.
paymentTypestringDefines the type of payment
Possible values: "DEPOSIT"/"WITHDRAWAL"/"REFUND". Operations available for a specific method are listed on its Payment methods entry
paymentMethodstringPayment Method
amountnumberPayment amount. Available value
1 or 1.00, that mean for example 1 USD
currencystringCurrency code according to ISO
4217 alpha-3
parentPaymentIdstringId of initial deposit for refunds, Id of initial recurring payment for subsequent payments
descriptionstringDescription of the transaction shown to the Customer. Can be sent outside the system.
cardobjectYou 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.cardNumberstringCard primary account number (PAN).
All non-numeric characters will be ignored
card.cardholderNamestringCardholder's name printed on the
card
card.cardSecurityCodestringCard security code (CVV2 / CVC2 / CAV2)
card.expiryMonthstringCard expiration month, 2 digits
card.expiryYearstringCard expiration year, 4 digits
customerobject
customer.referenceIdId of the customer assigned by Merchant
customer.citizenshipCountryCodestringCustomer country of citizenship
customer.firstNamestringCustomer's first name
customer.lastNamestringCustomer's last name
customer.dateOfBirthstringCustomer's date of birth
customer.emailstringEmail address of the customer
customer.phonestringInternational phone number of the customer, without the '+'. Use a space as a separator between the dialing country code and local phone number.
customer.localestringCustomer preferred display language
customer.accountNamestringCustomer account name in the provider's system. Used for some types of withdrawals.
customer.bankCodestringUser bank code
customer.accountNumberstringCustomer account number in the provider's system. Used for some types of withdrawals
customer.accountTypestringAccount type
Available values:
SAVINGS, CHECKING - SAVINGS by default if not received in request
customer.documentTypestringDocument Type
customer.documentNumberstringAn identifier for the customer assigned by a government authority
customer.routingGroupstringIdentify the customer as belonging to a specific group that is used for routing
customer.kycStatusbooleanIndicates whether the customer has passed KYC verification
customer.paymentInstrumentKycStatusbooleanIndicates whether the payment instrument (usually the card number) has passed KYC verification
customer.dateOfFirstDepositDate of the first deposit from the customer
customer.depositsAmountintegerHow much the customer has deposited, in base currency
customer.withdrawalsAmountintegerHow much the customer has withdrawn, in base currency
customer.depositsCntintegerHow many times the customer made a deposit
customer.withdrawalsCntintegerHow many times the customer made a withdrawal
billingAddress.addressLine1stringLine 1 of the address (e.g., Number, street, etc)
billingAddress.addressLine2stringLine 2 of the address (e.g., Suite, apt)
billingAddress.cityCity name
billingAddress.countryCodestring2-character IS0-3166-1 country
code
billingAddress.postalCodestringPostal code
billingAddress.statestringState code
additionalParametersobjectAdditional parameters required by some payment providers. Contact support for more information.
preAuthbooleanSend 'true' if you want to request a Pre-Authorization charge (initiate a 2-phase deposit).
returnUrlstringURL to redirect Customer after processing
webhookUrlstringUrl to receive payment status notifications
startRecurringbooleanSend 'true' if you want this payment to initiate recurring chain. Default is 'false'.
recurringTokenstringTo continue recurring chain, send a token from a previously initiated recurring payment.
  • 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",
"email": "[email protected]",
"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.