Error Messages: /tokenize

Every request to POST /v1/tokenize that returns HTTP 400, with the error key and the message for each case.

This page lists the requests to POST /v1/tokenize that return HTTP 400, with the error key and the message for each case. The endpoint is documented on /tokenize. The conventions for these tables and the errors that several endpoints share are on Error Messages by Endpoint.


All 400 responses use Format A. Body field names on this endpoint are snake_case, for example payment_method and credit_card. The error keys keep the PascalCase names that the API returns. The mid query parameter is optional; when it is omitted, the card is tokenized without a merchant association.

TriggerError keyMessage
Empty body""A non-empty request body is required.
payment_method missingPaymentMethodThe PaymentMethod field is required.
payment_method.credit_card.number missing or emptyPaymentMethod.CreditCard.NumberThe Number field is required.
payment_method.credit_card.month missing or emptyPaymentMethod.CreditCard.MonthThe Month field is required.
payment_method.credit_card.year missing or emptyPaymentMethod.CreditCard.YearThe Year field is required.
mid query parameter is not a GUIDmidThe value '<value>' is not valid for mid.
Sandbox only: card number is not a supported test cardnumberOnly test Credit Cards are allowed in test environments. please visit: https://docs.flexfactor.io/docs/testing-cards for a list of test card numbers.
metadata has more than 25 entriesPaymentMethod.MetadataMetadata cannot contain more than 25 key-value pairs
metadata key is null or emptyPaymentMethod.MetadataMetadata keys cannot be null or empty
metadata key longer than 50 charactersPaymentMethod.MetadataMetadata key '<key>' exceeds the maximum length of 50 characters
metadata value longer than 500 charactersPaymentMethod.MetadataMetadata value for key '<key>' exceeds the maximum length of 500 characters
metadata value is an object or arrayPaymentMethod.MetadataMetadata value for key '<key>' cannot contain compounding data types (objects or arrays)
  • A mid that is a well-formed GUID but does not match a merchant returns 500 with the message Failed tokenizing a record, not 400.
  • A payment_method without credit_card, and a month or year that is not a number, also return 500 with the message Failed tokenizing a record, not 400.

Did this page help you?