Skip to main content

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.

API Base URL
https://api.payouts.wompi.co/v1
https://api.payouts.wompi.co/v2
Payment mode by version

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-id and x-api-key headers are for authentication. More details on how to obtain them in Authentication Keys
  • The idempotency-key header 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-Type header must be set to application/json specifying 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 accountId field must be taken from the response of the /accounts endpoint. Go to query accounts.
  • The bankId field must be taken from the response of the /banks endpoint. Go to query banks.
  • The value of amount must be a positive value and must be in cents. (for example, $10,000 COP is represented as 1000000).
  • In version 2, the optional dispersionType field defines the payment mode: AGGREGATOR_DIRECT or AGGREGATOR_MANAGED. If not sent, AGGREGATOR_DIRECT is 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.

info

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.

ValueModeWhat it means
AGGREGATOR_DIRECTDirectThe 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_MANAGEDManaged by WompiWompi 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 as AGGREGATOR_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 send dispersionType, you will receive error EXC_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_DIRECT or AGGREGATOR_MANAGED, in uppercase. Any other value, an empty string or null returns a 400 error.
  • Applies the same way to JSON and file batches, to bank accounts and to BRE-B keys.
Version 1

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​

CodeHTTP CodeMessageCause
400400dispersionType must be one of the following values: AGGREGATOR_DIRECT, AGGREGATOR_MANAGEDInvalid, empty or null dispersionType value.
EXC_044400La 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_038422El método de pago no está disponible. Intenta más tardeYour merchant is not enabled for the payment mode.
EXC_045422El 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:

FormatCodeExtensionTemplateExample
WompiWOMPI.csvTemplateDownload
PAB BancolombiaPAB.txtConverterDownload
SAP BancolombiaSAP.txtConverterDownload
Disfon - Banco de BogotáDISFON.txtDownload
FlexCube (FC) - Banco de OccidenteBANCO_OCCIDENTE_FC.txtDownload
Plano DaviviendaDAVIVIENDA.txtDownload

Headers​

x-api-key: *******
user-principal-id: *******
idempotency-key: Rs122k1sas
Content-Type: multipart/form-data
  • The user-principal-id and x-api-key headers are for authentication. More details on how to obtain them in Authentication Keys
  • The idempotency-key header 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-Type header for file payments must be set to multipart/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_FC
  • accountId: Origin account id
  • paymentType: 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_DIRECT is applied. See Payment mode.
Compressed files

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 format YYYY-MM-DDTHH:mm
info

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 format YYYY-MM-DDTHH:mm
  • interval: Payment interval. Can be: biweek, month.
  • months: Number of months. Can be: 3, 6, 12.
  • description: The description is optional.