Skip to main content
POST
/
charges
Crear cargo
curl --request POST \
  --url https://api.onepay.la/v1/charges \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-idempotency: <x-idempotency>' \
  --data '{
  "title": "<string>",
  "customer_id": "<string>",
  "amount": 123,
  "account_id": "<string>",
  "card_id": "<string>",
  "currency": "<string>",
  "redirect_url": "<string>",
  "splits": [
    {
      "customer_id": "<string>",
      "account_id": "<string>",
      "split_type": "<string>",
      "split_value": "<string>",
      "description": "<string>",
      "schedule_at": "<string>",
      "process": "<string>",
      "to_company_wallet": true
    }
  ],
  "test_scenario": "<string>",
  "allows": {
    "cards": true,
    "accounts": true,
    "card_extra": true,
    "realtime": true,
    "pse": true,
    "transfiya": true
  }
}'
{
  "id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
  "title": "Test Charge",
  "amount": 1000,
  "amount_label": "$1.000",
  "source": "charge",
  "status": "declined",
  "currency": "COP",
  "payment_method_type": "Account",
  "payment_method_id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
  "created_at": "2025-01-20T02:18:29.000000Z",
  "paid_at": null,
  "remarks": {
    "code": "INTERNAL_ERROR",
    "description": "Error interno. Comunícate con soporte para resolver el problema."
  },
  "is_test": true,
  "method": {
    "id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
    "title": "Dr.",
    "subtype": "SAVINGS",
    "status": "PENDING",
    "authorization": true,
    "customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
    "re_enroll": false,
    "external_id": null,
    "bank_id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
    "bank": {
      "id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
      "name": "Hoeger PLC",
      "logo": null
    }
  },
  "customer": {
    "id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
    "first_name": "Florencio",
    "last_name": "Conroy",
    "email": "",
    "phone": "+12518057105",
    "document_type": "CC",
    "document_number": "930232",
    "created_at": "2025-01-20T02:18:29.000000Z",
    "is_test": true
  },
  "splits": [
    {
      "id": "9e02966f-3204-4e50-9fb7-b8bc0214a93b",
      "customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
      "split_type": "percentage",
      "split_value": 300,
      "description": "Test Split",
      "created_at": "2025-01-20T02:18:29.000000Z",
      "scheduled_at": null,
      "account_id": "4dc959d0-d96a-377a-823e-5e05cfde896f"
    }
  ]
}

Headers

x-idempotency
string
required
Token único para garantizar la idempotencia de la petición

Body

title
string
required
Descripción del cargo en el estado de cuenta del banco
customer_id
string
required
ID del cliente que asumirá el cargo. Crear cliente.
amount
number
required
Monto del cargo en centavos.
account_id
string
ID de la cuenta bancaria registrada. Ver creación de cuentas. Requerido si card_id está vacío.
card_id
string
ID de la tarjeta tokenizada. Conoce cómo registrar tarjetas. Requerido si account_id está vacío.
currency
string
Moneda del cargo
redirect_url
string
URL de redirección
splits
array
Los pagos divididos permiten distribuir automáticamente un único pago entre múltiples destinatarios según reglas preestablecidas, optimizando la gestión de fondos sin necesidad de cálculos manuales o costos adicionales.
customer_id
string
required
ID del cliente que recibirá el pago. Ver cómo crear un cliente.
account_id
string
required
ID de la cuenta bancaria registrada. Conoce cómo registrar cuentas.
split_type
string
Tipo de división: percentage o fixed
split_value
string
required
Valor del pago dividido si % o un monto
description
string
required
Descripción del pago para el cliente que recibirá el pago.
schedule_at
string
Fecha en la que el pago se le envía al cliente, si no existe una fecha se hará automáticamente. YYYY-MM-DD.
process
string
default:"ACH"
Que tipo de proceso se va a realizar, por defecto es ACH. [TURBO, ACH]
to_company_wallet
boolean
default:"false"
Indica si el pago se va a realizar en la wallet de otra empresa.
test_scenario
string
Escenario de prueba para el cargo [Opcional]. Ver escenarios de prueba
allows
object
Configuración de métodos de pago permitidos.
{
  "id": "9e02966f-2ddf-4ee7-a391-5b5b7653e232",
  "title": "Test Charge",
  "amount": 1000,
  "amount_label": "$1.000",
  "source": "charge",
  "status": "declined",
  "currency": "COP",
  "payment_method_type": "Account",
  "payment_method_id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
  "created_at": "2025-01-20T02:18:29.000000Z",
  "paid_at": null,
  "remarks": {
    "code": "INTERNAL_ERROR",
    "description": "Error interno. Comunícate con soporte para resolver el problema."
  },
  "is_test": true,
  "method": {
    "id": "4dc959d0-d96a-377a-823e-5e05cfde896f",
    "title": "Dr.",
    "subtype": "SAVINGS",
    "status": "PENDING",
    "authorization": true,
    "customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
    "re_enroll": false,
    "external_id": null,
    "bank_id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
    "bank": {
      "id": "9e02966e-8d60-49b0-ad66-372bf73c4a54",
      "name": "Hoeger PLC",
      "logo": null
    }
  },
  "customer": {
    "id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
    "first_name": "Florencio",
    "last_name": "Conroy",
    "email": "",
    "phone": "+12518057105",
    "document_type": "CC",
    "document_number": "930232",
    "created_at": "2025-01-20T02:18:29.000000Z",
    "is_test": true
  },
  "splits": [
    {
      "id": "9e02966f-3204-4e50-9fb7-b8bc0214a93b",
      "customer_id": "9e02966e-8beb-4e02-ba0c-bea875a07b22",
      "split_type": "percentage",
      "split_value": 300,
      "description": "Test Split",
      "created_at": "2025-01-20T02:18:29.000000Z",
      "scheduled_at": null,
      "account_id": "4dc959d0-d96a-377a-823e-5e05cfde896f"
    }
  ]
}