Skip to Content
Paycose Docs
Setup

API versions

The Paycose API is versioned by date. Each secret key and webhook endpoint is pinned to a version; today there is one, 2026-11-01.

The Paycose API is versioned by date. Each secret key and each webhook endpoint is pinned to a version, and new ones are pinned to the latest, so a new version never changes what your integration receives until you move it. Today there is one version, 2026-11-01: every request made with a secret key is answered in it, and every webhook endpoint receives its events in it.

The Paycose-Version header

You don't need to send a version. To make a request explicit, send Paycose-Version: 2026-11-01. Every response names the version that answered in the same header:

curl -i "$WALLET/customers?limit=1" \
  -H "Authorization: Bearer ${SECRET_KEY}" \
  -H "X-Country: TH" \
  -H "Paycose-Version: 2026-11-01"
HTTP/1.1 200 OK
Content-Type: application/json
Paycose-Version: 2026-11-01

2026-11-01 is the only value the header accepts. Any other value is refused with 400 before the request runs, with the error code validation.api_version.invalid and param Paycose-Version. See Errors.

What the version sets

2026-11-01 follows Stripe's conventions:

  • Errors are nested under error, with a type and a string code. See Errors.
  • Lists are cursor-paginated and answer object, data, has_more and url. See Pagination.
  • Deletes answer id, object and deleted: true.
  • Deleted objects read back the same way. Retrieving an object you deleted, such as a customer, product, price, coupon or webhook endpoint, answers 200 with {"id": "cus_…", "object": "customer", "deleted": true} rather than 404. An id that never existed is still 404.
  • Unknown fields are rejected. Under 2026-11-01, a JSON body field the endpoint does not take, top-level or nested, answers 400 validation.failed with param naming where it sits, such as line_items[0].quantiy. Keys inside metadata are yours and are never checked. See Errors.
  • Timestamps in responses are Unix seconds, such as 1793491200. An object's created and updated say when it was created and last changed. Request bodies take timestamps as RFC 3339 strings, such as "due_date": "2026-11-08T00:00:00Z".
  • Currencies are lowercase in responses, such as "thb". Request bodies may send either case.
  • expand[] refuses a field the endpoint cannot expand. See Expand.
  • metadata comes back exactly as you wrote it.

New versions

When a new version ships, it will be announced on this page with what it changes. Try it on single requests by sending its date in Paycose-Version, then move the key or webhook endpoint to it from the Dashboard (Upgrade on the key or endpoint), or move an endpoint with api_version on PATCH /webhook_endpoints/{id}.

What's next

On this page