Create your first batch
You can create payment batches in two ways: by sending the transaction details as a JSON in the request body, or by sending one of the supported file formats.
https://api.payouts.wompi.co/v1
https://api.payouts.wompi.co/v2
For disbursements from Wompi Account, version 2 lets you choose the payment mode with the optional dispersionType field (AGGREGATOR_DIRECT or AGGREGATOR_MANAGED). If you do not send it, AGGREGATOR_DIRECT is applied. In version 1, Wompi defines the mode. See API versions.
Create a payment batch
The endpoint URL to manually create payment batches is:
POST /payouts
Headers
x-api-key: *******
user-principal-id: *******
idempotency-key: Rs122k1sas
Content-Type: application/json
- The
user-principal-idandx-api-keyheaders are for authentication. More details on how to obtain them in Authentication Keys - The
idempotency-keyheader is used to ensure the payment is unique and to avoid duplication. It must be a key between 1 and 64 characters, can contain letters and numbers, and the only special character allowed is the hyphen (-). It must be unique and expires in 24 hours. - The
Content-Typeheader must be set toapplication/jsonspecifying that the request body format is JSON.
Immediate payments
Below is an example of the request body:
{
"reference": "payment-reference",
"accountId": "account-id",
"paymentType": "PAYROLL",
"transactions": [
{
"legalIdType": "CC",
"legalId": "1000000000",
"bankId": "00000000-0000-0000-0000-000000000000",
"accountType": "AHORROS",
"accountNumber": "00000000",
"name": "John Doe",
"email": "email@example.com",
"amount": 1000000,
"reference": "custom-transaction-reference"
}
]
}
- The
accountIdfield must be taken from the response of the/accountsendpoint. Go to query accounts. - The
bankIdfield must be taken from the response of the/banksendpoint. Go to query banks. - The value of
amountmust be a positive value and must be in cents. (for example, $10,000 COP is represented as 1000000). - In version 2, the optional
dispersionTypefield defines the payment mode:AGGREGATOR_DIRECTorAGGREGATOR_MANAGED. If not sent,AGGREGATOR_DIRECTis applied. See payment mode.
Scheduled payments
To create scheduled payments, you can add the dispersionDatetime field, which is a string in the format YYYY-MM-DDTHH:mm.
The payment scheduling date must be at least the next day after the request is made, otherwise the payment will be rejected.
Example of the request body:
{
"reference": "referencia-api",
"accountId": "account-id",
"paymentType": "PAYROLL",
"dispersionDatetime": "2024-10-15T19:01",
"transactions": [
{
"legalIdType": "CC",
"legalId": "1000000000",
"bankId": "00000000-0000-0000-0000-000000000000",
"accountType": "AHORROS",
"accountNumber": "00000000",
"name": "John Doe",
"email": "email@example.com",
"amount": 1000,
"reference": "custom-transaction-reference"
}
]
}
Recurring payments
To create recurring payments, you must add the dispersionDatetime field, which is a string in the format YYYY-MM-DDTHH:mm, and recurring, which is a JSON object that receives the following fields:
interval: Payment interval. Can be:biweek,month.months: Number of months. Can be:3,6,12.description: The description is optional.
{
"reference": "referencia-api",
"accountId": "account-id",
"paymentType": "PAYROLL",
"dispersionDatetime": "2024-10-15T19:01",
"recurring": {
"interval": "biweek",
"months": 3,
"description": "optional description"
},
"transactions": [
{
"legalIdType": "CC",
"legalId": "1000000000",
"bankId": "00000000-0000-0000-0000-000000000000",
"accountType": "AHORROS",
"accountNumber": "00000000",
"name": "John Doe",
"email": "email@example.com",
"amount": 1000,
"reference": "custom-transaction-reference"
}
]
}
Payment mode
In version 2 of the API, disbursements from Wompi Account can be processed in two modes. The mode is set in the optional batch dispersionType field.
| Value | Mode | What it means |
|---|---|---|
AGGREGATOR_DIRECT | Direct | The payment is disbursed with the funds of your Wompi Account. The fixed fee per transaction, the variable fee if applicable and VAT are charged. |
AGGREGATOR_MANAGED | Managed by Wompi | Wompi manages the disbursement. In addition, depending on the plan configuration, a fee may or may not be charged, and a financing cost is charged. |
Rules:
- It is optional. If you do not send
dispersionType, the batch is processed asAGGREGATOR_DIRECT. - The value you send is respected. The mode you send defines how the batch is charged and processed.
- Only applies to Wompi Account. If the source account (
accountId) is not a Wompi Account and you senddispersionType, you will receive errorEXC_044. - Fees according to your plan. If your assigned plan matches the mode sent, its fees are used. Otherwise, the fees of the public plan of that mode are used.
- Valid values. Only
AGGREGATOR_DIRECTorAGGREGATOR_MANAGED, in uppercase. Any other value, an empty string ornullreturns a400error. - Applies the same way to JSON and file batches, to bank accounts and to BRE-B keys.
In version 1 the mode is not sent: Wompi defines it based on your merchant configuration. See the differences in API versions.
Example of a batch with the Managed by Wompi mode:
{
"reference": "payment-reference",
"accountId": "account-id",
"paymentType": "PROVIDERS",
"dispersionType": "AGGREGATOR_MANAGED",
"transactions": [
{
"legalIdType": "CC",
"legalId": "1000000000",
"bankId": "00000000-0000-0000-0000-000000000000",
"accountType": "AHORROS",
"accountNumber": "00000000",
"name": "John Doe",
"email": "email@example.com",
"amount": 1000000,
"reference": "custom-transaction-reference"
}
]
}
Payment mode errors
| Code | HTTP Code | Message | Cause |
|---|---|---|---|
400 | 400 | dispersionType must be one of the following values: AGGREGATOR_DIRECT, AGGREGATOR_MANAGED | Invalid, empty or null dispersionType value. |
EXC_044 | 400 | La modalidad de dispersión solo aplica para pagos desde Wompi Cuenta. | dispersionType was sent with a source account that is not a Wompi Account. |
EXC_038 | 422 | El método de pago no está disponible. Intenta más tarde | Your merchant is not enabled for the payment mode. |
EXC_045 | 422 | El plan asignado no tiene configuradas las tarifas requeridas para la modalidad seleccionada. | The plan of the mode does not have its fees configured. |
Example:
{
"status": 400,
"code": "EXC_044",
"message": "La modalidad de dispersión solo aplica para pagos desde Wompi Cuenta.",
"type": "Business"
}
Create a payment batch by sending a file
The endpoint URL to create payment batches by file is:
POST /payouts/file
Formats
You can create a payment batch using one of the following supported files:
| Format | Code | Extension | Template | Example |
|---|---|---|---|---|
| Wompi | WOMPI | .csv | Template | Download |
| PAB Bancolombia | PAB | .txt | Converter | Download |
| SAP Bancolombia | SAP | .txt | Converter | Download |
| Disfon - Banco de Bogotá | DISFON | .txt | Download | |
| FlexCube (FC) - Banco de Occidente | BANCO_OCCIDENTE_FC | .txt | Download | |
| Plano Davivienda | DAVIVIENDA | .txt | Download |
Headers
x-api-key: *******
user-principal-id: *******
idempotency-key: Rs122k1sas
Content-Type: multipart/form-data
- The
user-principal-idandx-api-keyheaders are for authentication. More details on how to obtain them in Authentication Keys - The
idempotency-keyheader is used to ensure the payment is unique and to avoid duplication. It must be a key between 1 and 64 characters, can contain letters and numbers, and the only special character allowed is the hyphen (-). It must be unique and expires in 24 hours. - The
Content-Typeheader for file payments must be set tomultipart/form-data
Immediate payments
The request body must be of type form-data with the fields:
reference: Batch reference.file: Batch file.fileType: File type. It is the format code, see the formats table. E.g.BANCO_OCCIDENTE_FCaccountId: Origin account idpaymentType: Payment type. Can be:PAYROLL,PROVIDERS,OTHER.dispersionType(optional, version 2 only): Payment mode of the batch. Can be:AGGREGATOR_DIRECT,AGGREGATOR_MANAGED. If not sent,AGGREGATOR_DIRECTis applied. See Payment mode.
To upload a compressed batch file, it must have the .gz extension and MIME type application/gzip. You must also add the following fields to the request:
fileName: Name of the file with the original extension (before compression). For example, "plantilla-wompi.csv".fileMime: MIME of the original file (before compression). For example, "text/csv".
Scheduled payments
To create scheduled payments, you must additionally include the following field:
dispersionDatetime: Field representing the date and time of dispersion in the formatYYYY-MM-DDTHH:mm
The payment scheduling date must be at least the next day after the request is made, otherwise the payment will be rejected.
Recurring payments
To create recurring payments, you must add the following fields:
dispersionDatetime: Field representing the date and time of dispersion in the formatYYYY-MM-DDTHH:mminterval: Payment interval. Can be:biweek,month.months: Number of months. Can be:3,6,12.description: The description is optional.