Eliminar Payments
Changed onElimina pagos registrados sobre Invoices.
Se usa para revertir pagos informados por error. Acepta varios Payments en una sola llamada.
Cada Payment se referencia por el Invoice que salda, no por un identificador propio: envía invoice_external_id, o bien product_id y due_date para que Toku lo construya como {product_id}-{due_date}.
Por defecto los Invoices afectados vuelven a quedar impagos; envía set_invoices_as_unpaid en false para eliminar el Payment dejando el Invoice con su estado actual.
Cada Payment enviado se resuelve en uno de estos resultados:
- success: el pago se eliminó.
- duplicates: el Payment repite los identificadores de otro elemento del mismo lote. Solo se procesa el primero.
- not_found: no existe un Invoice que coincida con los identificadores enviados, o ese Invoice no tiene un pago registrado que eliminar.
Que algunos elementos del lote fallen no convierte la respuesta en un error: se devuelve 200 con el recuento por resultado. Revisa esos contadores para saber qué pasó con cada Payment enviado.
Request
- Base URLhttps://api.trytoku.com
- URLhttps://api.trytoku.com/payments
- 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_account": "acc_2YPKc-NZPwxBYf6hnLsstaqG9JAZKxX4",
"payments": [
{
"due_date": "202101",
"invoice_external_id": "9897af7987d9245d-202101",
"product_id": "9897af7987d9245d"
}
]
}Response
Recuento por resultado del lote.
Changes
- breaking
request body became required
- breaking
the
//request property's minLength was increased from0to1 - breaking
removed the media type
text/plainfor the response with the status - warning
the
//request property's maxLength was set to32 - warning
the
//request property's maxLength was set to256 - warning
removed the request property
// - warning
removed the request property
// - warning
removed the request property
// - info
api operation id
eliminar-paymentremoved and replaced withdelete_payment - info
api tag
Paymentsadded - info
endpoint deprecated
- info
added the new optional
headerrequest parameterx-account-key - info
added the new optional request property
- info
added the new optional request property
// - info
added the new optional request property
- info
added the media type
application/jsonfor the 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
removed the non-success response with the status
- breaking