API Reference

Listado de códigos de error con su respectiva descripción que puede retornar la API de Toku.

La API de Toku responderá con errores que siguen una estructura definida para los recursos de Customers, Subscriptions e Invoices. Los mensajes de error tendrán el siguiente formato:

{  
   "error":{  
      "message":"Some descriptive message.",  
      "code":"TKXXXX"  
   }  
}

El propósito de esta sección es comprender la estructura del campo code dentro de la respuesta de la API, proporcionando un catálogo que enumera los posibles códigos que la API puede devolver junto con sus correspondientes descripciones.

Estructura del código de error

Los errores tendrán la siguiente sintáxis

Con las siguientes fuentes

TypeCode
No Explicit Type0
Expected1
Database2
Validation3
EntityCode
No entity00
Country01
Organization02
Account03
Customer04
Subscription05
Invoice06
PaymentMethod07
Payment09

Listado de códigos (por entidad)

No Entity

Toku CodeDescription
TK30000Validation error, the request validation failed.

Country

Toku CodeDescription
TK30100Country is not supported for government id validation.

Customer

Toku CodeDescription
TK20400Customer not found on database.
TK30400Customer payload is missing its external identifier.
TK30401Customer’s external_id does not match the organization's customer_external_id_parameter.
TK30402Customer government_id is invalid.
TK30403Customer phone preference is invalid.
TK30404A customer’s phone number field is invalid.
TK30405A customer’s email field is invalid syntactically.
TK30406A customer’s email field is blacklisted.
TK30407Customer had a logic conflict in its delete flow.
TK30408Customer's phone_number country code is not supported by Toku.
TK30409Customer was not found by its external_id.
TK30410Customer already exists in an operation where it is not allowed.

Subscriptions

Toku CodeDescription
TK20500Subscription not found on database.
TK20501Subscription not found for a given customer.
TK30500Subscription had a logic conflict while attempting to delete it.
TK30501Subscription had an attempt to be transferred to a different customer.
TK30502Subscription had a logic conflict while attempting to edit it.
TK30503Subscription doesn't have all required fields present.
TK30504Subscription had a logic error while attempting to create it.
TK30504Subscription already exists in an operation where it is not allowed.

Invoices

Toku CodeDescription
TK20600Invoice not found on database.
TK20601Invoice not found for a specific customer.
TK30600Invoice had a logic conflict while attempting to delete it.
TK30601Invoice had a logic conflict while attempting to create it.
TK30602Invoice had a logic conflict while attempting to void it.
TK30603Invoice had a logic conflict while attempting to edit it.
TK30604Invoice already exists in an operation where it is not allowed.