Transactions

Crear Transaction externa

Changed on

Registra una Transaction externa sobre ninguno, uno o varios Invoices de una Account.

Una Transaction externa registra un pago que el deudor hizo por fuera de Toku —transferencia, caja, efectivo— para dejar sus Invoices saldados. Se usa para reflejar en Toku esos pagos: el cuerpo indica la Account, el monto, la moneda, la fecha del pago y el detalle de Invoices que cubre. Registrarla sin Invoices deja el pago asociado solo a la Account.

Cada Invoice del detalle puede saldarse por completo o de forma parcial con is_partial_payment. La respuesta devuelve los identificadores de la Transaction creada y de sus Payment Intents.

Límite de tasa: 20 solicitudes por segundo. Al superarlo, la API responde 429. Ver Límites de tasa.

post/transactions/external

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/transactions/external
  • Auth
    API key in header x-api-key

Headers

x-account-keystring

Llave de API de una Account, para operar sobre esa Account en lugar de la principal.

Request body

amountnumber

Monto total del pago registrado.

currency'CLP' | 'CLF' | 'MXN' | 'BRL' | 'USD' required

Moneda, en código ISO 4217. Cubre las monedas de los países donde Toku opera —CLP (peso chileno), MXN (peso mexicano) y BRL (real)— más USD y CLF, la Unidad de Fomento chilena. La moneda determina cuántos decimales admiten los montos: CLP no admite decimales, MXN, BRL y USD admiten dos, y CLF cuatro.

external_idstring

Referencia externa que la Organization asigna a la Transaction.

id_accountstring required

Identificador público de la Account que hizo el pago.

id_customerstring

Identificador público del Customer al que se atribuye el pago.

payment_method_detailstring

Detalle del medio con que se pagó, tal como lo informa la Organization.

provider_external_idstring

Referencia que el proveedor del pago asigna a la Transaction.

transaction_dataobject

Datos libres que la Organization adjunta a la Transaction.

transaction_datestring date-time

Fecha en que se hizo el pago; si se omite, se usa la fecha actual.

Example request

{
  "amount": 15990,
  "currency": "CLP",
  "external_id": "pago-caja-4821",
  "id_account": "acc_7bQ2mN4pR6sT8vX0yZ2aB4cD6eF8gH0j",
  "invoices": [
    {
      "amount": 15990,
      "id_invoice": "in_5dF7hJ9kM1nP3rT5vX7zB9dF1hJ3lN5p"
    }
  ],
  "payment_method_detail": "transferencia",
  "transaction_date": "2026-07-20T14:35:00"
}

Response

La Transaction externa quedó registrada con sus Payment Intents.

successboolean required

Indica si la operación se completó.

Example response

{
  "detail": {
    "id_payment_intents": [
      "pi_7dF2hJ4kL6nP8qR0sT2vX4yZ6aB8cD0e"
    ],
    "id_transaction": "trs_kR3nQ8sT1vX7yZ2aB5cD9eF4gH6jK0mN",
    "metadata": {}
  },
  "success": true
}

Changes

    • breaking

      request body became required

    • breaking

      added to the request property allOf list

    • breaking

      removed the enum value BRL of the request property

    • breaking

      removed the enum value CLF of the request property

    • breaking

      removed the enum value CLP of the request property

    • breaking

      removed the enum value MXN of the request property

    • breaking

      removed the enum value USD of the request property

    • breaking

      the request property type changed from string to number

    • breaking

      the request property type changed from string to no type

    • breaking

      the // request property type changed from string to number

    • breaking

      the // request property type changed from string to number

    • breaking

      the // request property type changed from string to boolean

    • breaking

      the response's property type changed from object to no type for status

    • breaking

      removed the required property / from the response with the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      api operation id post_transactions-external removed and replaced with create_external_transaction

    • info

      api tag Transactions added

    • info

      added the new optional header request parameter x-account-key

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      the request property default value false was added

    • info

      the request property default value was removed

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added to the response property allOf list for the response status

    • info

      the response property became required for the status