Crear Refund de Invoice
Changed onDevuelve el dinero con que se pagó una deuda, total o parcialmente.
Se usa cuando el punto de partida es la Invoice y no el pago: Toku busca el pago que la saldó y crea la devolución sobre esa Transaction.
Solo aplica a Invoices saldadas en un único pago. Si la Invoice fue pagada en más de una Transaction, la petición es rechazada y la devolución debe pedirse sobre la Transaction.
Si el pago que saldó la Invoice es con tarjeta de un solo cobro (payment_orchestration_onetime) o con wallet (wallet_mx) y es más antiguo que su plazo de devolución, la petición es rechazada con estado 400 antes de contactar al gateway.
Si se omite refund_amount, se devuelve el monto total del pago que saldó la Invoice.
Sin idempotency_key, cada llamada crea una devolución nueva y las parciales se acumulan sobre el mismo pago, así que reenviar la misma petición vuelve a devolver el monto mientras quede saldo; cuando ya no queda, la petición es rechazada con estado 400. Reenviar la petición con la misma idempotency_key devuelve la respuesta original, con el header Idempotent-Replayed, sin crear otra devolución.
Request
- Base URLhttps://api.trytoku.com
- URLhttps://api.trytoku.com/refund/invoice
- AuthAPI key in header x-api-key
Headers
Llave de API de una Account, para operar sobre esa Account en lugar de la principal.
Request body
Example request
{
"id_invoice": "in_pBf2NL0d0gvBM7Ei_1E3HIWnTN4W93_O",
"idempotency_key": "5f1c2e0a-8d3b-4c1e-9a7f-2b6d4e8c1a90"
}Response
Successful Response
Example response
{
"id": "trs_pBf2NL0d0gvBM7Ei_1E3HIWnTN4W93_O"
}Changes
- breaking
request body became required
- breaking
the
response's property type changed fromstringtobooleanfor 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_refundinvoiceremoved and replaced withrefund_invoice_public - info
api tag
Refundsadded - info
added the new optional
headerrequest parameterx-account-key - info
added the new optional request property
- info
the
request property default value changed fromfalsetofalse - info
the
request property default value changed fromfalsetofalse - info
the
request property format was generalized fromfloatto no format - 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
- breaking