Skip to main content
Public API write requests and SDK payment requests enforce body size and field length limits. Length limits count Unicode characters (runes), not bytes. Body size and metadata serialized size count bytes.

Request body size

Write requests (POST, PUT, PATCH, DELETE) accept a body of at most 256 KiB (262144 bytes) on:
  • Every public API endpoint, including client sessions, customers, payments, refunds, and subscriptions.
  • Every /sdk/payments endpoint, including create, create/billing/agreement, the setup-intent and payment-intent endpoints, and apple-pay/validate-merchant.
GET requests have no body limit. All other endpoints keep the global limit of 5 MiB. A larger body returns HTTP 413 with a short JSON body. The submitted content is never echoed in the response.
413 response

String field limits

Metadata limits

Metadata values can be any JSON type (string, number, boolean, null, array, or object). Only string values are limited by length. Every value counts toward the serialized size.

Merged metadata

When a write merges new metadata into stored metadata, PayNext checks the merged result against these limits. A request whose merged metadata exceeds a limit returns HTTP 400. This applies to PATCH /customers/{id}, PATCH /subscriptions, and POST /payments/refund/{id} with metadata. If stored metadata is already over a limit, you can still update it as long as the update doesn’t grow that dimension. Deleting keys is always allowed. Client sessions validate each metadata object against the absolute limits above.

Error format

Validation failures return HTTP 400 with this body:
400 response
The message format depends on the field. The JSON path of the first group is relative to the endpoint. It has no customer. prefix on PATCH /customers/{id} and SDK create (full_name, email, name). It has the prefix on POST /payments/card, POST /customers, and client sessions (customer.email, customer.external_id). Use payment_method.name on POST /customers. For the second group, an oversized phone returns phone: max 32 characters and an oversized additional_fields[0].value returns additional_fields[0].value: max 4096 characters. For metadata, <path> is metadata, customer.metadata, subscription.metadata, or payment.metadata. <reason> is one of too many keys, key length exceeds limit, value length exceeds limit, nesting exceeds limit, or serialized size exceeds limit. Other errors:
  • Invalid enum values return <json.path>: invalid value.
  • Malformed JSON returns invalid request body.
Error messages never contain the submitted value.