Coupons are discount codes customers enter at checkout - a fixed amount, a percentage, free shipping or buy X get Y - limited to products, collections, events or a minimum subtotal. Vouchers are app-exclusive offers.
Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.
11 endpoints in 2 parts: Coupon, Voucher.
Lightweight endpoint for the ionic app to trigger the couponCapture middleware. The middleware runs before this handler, validates ?coupon= and sets the pending_coupon cookie.
Public - no token needed.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupon_capture?ionic=true'
Returns if a coupon is valid.
Works without a token; with a user token the answer is personal.
The coupon code's coupon code.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupon_code?ionic=true'
{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Returns if a coupon is valid.
Works without a token; with a user token the answer is personal.
The coupon code's code.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupon_code/{code}?ionic=true'{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Returns public coupon details by code without incrementing uses.
Public - no token needed.
The coupon info's code.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupon_info/{code}?ionic=true'{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Returns the site's coupons, newest first unless a sort is given.
Public - no token needed.
Returns a list of Coupon objects.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupons?ionic=true'
[
{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}
]Create new coupon.
Needs a site admin token.
Returns the Coupon object.
curl -X POST 'http://cloudoffice-gr.max-media.io/coupons?ionic=true' \ -H 'Authorization: Bearer <TOKEN>'
{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Returns one coupon, found by its ID.
Public - no token needed.
The ID of the coupon.
Returns the Coupon object.
curl -X GET 'http://cloudoffice-gr.max-media.io/coupons/{id}?ionic=true'{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Update Coupon by id.
Needs a site admin token.
The ID of the coupon.
Returns the Coupon object.
curl -X PATCH 'http://cloudoffice-gr.max-media.io/coupons/{id}?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'{
"code": "example",
"name": "Example",
"fixed_discount": 1,
"percentage_discount": 1,
"shipping_discount": 1,
"sale_discount": 1,
"apply_to_all_orders": false,
"apply_to_all_products": false,
"apply_to_product": "example",
"apply_to_event": "example",
"apply_to_all_events": false,
"apply_to_collection": "example",
"apply_to_minimum_subtotal": 49.9,
"start_date": "2026-11-04T12:00:00.000Z",
"end_date": "2026-11-04T12:00:00.000Z",
"no_end_date": false,
"limit_uses": 1,
"uses": 1,
"_id": "6543210fedcba98765432100",
"quantity_discount": {
"buy": 0,
"get": 0
}
}Delete Coupon record by id.
Needs a site admin token.
The ID of the coupon.
Returns an empty answer on success.
curl -X DELETE 'http://cloudoffice-gr.max-media.io/coupons/{id}?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'Returns the site's vouchers, newest first unless a sort is given.
Public - no token needed.
Only vouchers with this authenticated.
Returns a list of Voucher objects.
curl -X GET 'http://cloudoffice-gr.max-media.io/vouchers?ionic=true&authenticated=...'
[
{
"title": "Example",
"body": "Text shown on the site.",
"media": "6543210fedcba98765432100",
"show_to": "0",
"coupon": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100",
"updatedAt": "2026-11-04T12:00:00.000Z",
"createdAt": "2026-11-04T12:00:00.000Z"
}
]Returns one voucher, found by its ID.
Needs a site admin token.
The ID of the voucher.
Returns the Voucher object.
curl -X GET 'http://cloudoffice-gr.max-media.io/vouchers/{id}?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'{
"title": "Example",
"body": "Text shown on the site.",
"media": "6543210fedcba98765432100",
"show_to": "0",
"coupon": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100",
"updatedAt": "2026-11-04T12:00:00.000Z",
"createdAt": "2026-11-04T12:00:00.000Z"
}