Skip to main content

Common objects

Several data structures are reused across v2 endpoints. This page defines them once so individual endpoint pages can reference rather than repeat them.

Response envelope

Every successful v2 response wraps the result in a consistent envelope:

Pagination

List endpoints accept these query parameters:

Filtering

Many list endpoints support date-range and field-level filters:

Error envelope

Failed requests use the same top-level shape but with success: false. See Errors for the full reference.

Media

The media field appears on categories, products, venues, sale types, users, and payment methods. It is an array of media objects — typically images uploaded through the Clopos dashboard.
Not all urls variants are present on every resource — the set depends on the upload configuration. Always check for the key before using it. urls.original and urls.thumb are the most reliable.

Tips

  • Use urls.thumb for list views and urls.original for detail/full-screen views.
  • blur_hash can be decoded client-side into a small placeholder image to show while the real image loads. See blurha.sh for libraries.
  • media is always an array. An empty array ([]) means no images have been uploaded.

Payment method (in receipts)

When payment methods appear inside receipt objects (e.g. in payment_methods[]), they use a compact shape:
This is a denormalized snapshot — id and name are copied at the time the receipt is closed so the receipt remains self-contained even if the payment method is later renamed or deleted.