Create a value list item
/value_lists/{list_id}/itemsCreates a new item in a value list.
Headers
AuthorizationstringRequiredidempotency-keystringA unique key, such as a UUID, that makes a POST or DELETE request safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace.
- A retry with the same key, endpoint and body gets the first request's stored status and body, without running the request again.
- If the first request is still being processed, a retry gets 409
idempotency_error(request_in_progress). - The same key on another endpoint, or with another body, gets 400
idempotency_error(invalid_parameters). - GET, PUT and PATCH requests ignore the key.
The response repeats the key in its Idempotency-Key header.
Path parameters
list_idstringRequiredThe identifier of the value list to add the item to.
Parameters
valuestringRequiredThe value of the item. Only some list types validate the value:
email: must be a valid email address. It's stored in lowercase.ip_address: must be a valid IPv4 or IPv6 address.phone_number: every character that isn't a digit, such as+or a space, is removed. A value with a comma, a semicolon, or a line break returns 400.card: must be a card payment method or card token ID (pm_card_ortok_card_followed by 18 to 20 digits). The card's unique identifier (fingerprint) is stored as the value, and the card details are added to the metadata.bank_account: must be the ID of a bank account payment method on your account, such aspm_us_bank_account_296645958265997316(pm_, a two-letter country code,_bank_account_, and 18 to 20 digits). The bank account's unique identifier is stored as the value, and itslast4,bank_name,country, andcurrencyare added to the metadata.
Other list types accept any text. A value that already exists in the list (after normalization) returns 400.
metadataobjectSet of key-value pairs that you can attach to the list item.
Returns
Returns the created value list item object.
idstringUnique identifier for the value list item.
resourcestringString representing the object's type.
liststringUnique identifier of the value list this item belongs to.
created_atstringTime at which the value list item was created, in ISO 8601 format.
created_bystring or nullIdentifier of the API key or user that created the value list item, if applicable.
updated_atstring or nullTime at which the value list item was last updated, in ISO 8601 format. Null if it was never updated.
updated_bystring or nullIdentifier of the API key or user that last updated the value list item. Null if it was never updated.
test_modebooleanWhether the value list item was created in the sandbox.
metadataobjectSet of key-value pairs attached to the object. Omitted when the item has no metadata.
For card lists, the card details (bin, last_four_digits, brand, issuer_country, card_type, and issuer_name) are added to the metadata. For bank_account lists, the bank account's last4, bank_name, country, and currency are added.
valuestringValue of the value list item, as stored after normalization. Email values are stored in lowercase, and phone numbers as digits only.
For card lists, this is the card's unique identifier (fingerprint), not the pm_card_ or tok_card_ ID that was sent. For bank_account lists, it's the bank account's unique identifier, not the payment method ID that was sent.
Errors
400401invalid_key, invalid_token, legacy_keys_ended, legacy_keys_off or permission_denied).403resource_not_allowed, key_disabled, network_not_allowed, pci_required or merchant_required), or this resource isn't enabled for your account (permission_denied). code says why.404409idempotency-key is still being processed (request_in_progress). Wait, then retry with the same key.500503Retry-After, or after a few seconds when there's none.