Discounts
Discount codes.
List discount codes#
List discount codes, newest first. Lists discount codes of the shop.
Query parameters
Page size. Clamped to 1..200. Non-numeric values fall back to the default. Default: 50.
Value of next_cursor from the previous page. Returns items with created_at strictly before this timestamp.
Filter by active flag.
Exact code; upper-cased before matching (so case-insensitive for upper-case stored codes).
Only for OAuth tokens that cover several shops: the shop to query. Must be one of the token's shops (else 403 forbidden). Required when the token covers more than one shop (else 400 shop_required). Optional for API keys (a key belongs to exactly one shop; any other value returns 403).
Response fields
Items of this page.
created_at of the last item when more items exist, otherwise null.
Discount id.
Discount code (stored upper-case).
Internal title.
percentage | fixed | free_shipping (values from the MCP manage_discount schema).
For type=percentage: the percentage (e.g. 10). For fixed: amount in minor units. For free_shipping: unused.
all | products.
Products the code applies to when applies_to=products.
Minimum order value.
Minimum item quantity.
Total redemption limit.
Per-customer limit.
Whether combinable with other discounts.
Start of validity.
End of validity.
Active flag.
Redemptions so far.
Creation time; pagination key.
Last update.
Errors
Any endpoint. Response carries header WWW-Authenticate: Bearer resource_metadata="<origin>/.well-known/oauth-protected-resource".
Scope check per endpoint (and per body field on PATCH /orders/:id).
shop_id query parameter names a shop outside the credential's reach.
Multi-shop OAuth token without shop_id.
Any endpoint when the resolved shop has active=false.
Any endpoint. Header Retry-After (seconds until the next minute bucket).
Any endpoint.
curl "https://api.ecomone.shop/api/public/v1/discounts?limit=10" \
-H "X-Api-Key: $ECOMONE_API_KEY" \
-H "X-Api-Secret: $ECOMONE_API_SECRET"const res = await fetch("https://api.ecomone.shop/api/public/v1/discounts?limit=10", {
method: "GET",
headers: {
"X-Api-Key": process.env.ECOMONE_API_KEY,
"X-Api-Secret": process.env.ECOMONE_API_SECRET,
},
});
if (!res.ok) throw new Error((await res.json()).message);
const { data } = await res.json();import os, requests
res = requests.get(
"https://api.ecomone.shop/api/public/v1/discounts?limit=10",
headers={
"X-Api-Key": os.environ["ECOMONE_API_KEY"],
"X-Api-Secret": os.environ["ECOMONE_API_SECRET"],
},
timeout=30,
)
res.raise_for_status()
data = res.json()["data"]{
"data": [
{
"id": "a1b2c3d4-1111-4222-8333-444455556666",
"code": "SUMMER10",
"title": "Summer sale",
"type": "percentage",
"value_cents": 10,
"applies_to": "all",
"product_ids": [],
"min_purchase_cents": 4900,
"min_quantity": 0,
"usage_limit_total": 500,
"usage_limit_per_customer": 1,
"combinable": false,
"starts_at": "2026-06-01T00:00:00.000Z",
"ends_at": "2026-09-01T00:00:00.000Z",
"active": true,
"times_used": 118,
"created_at": "2026-05-28T12:00:00.000Z",
"updated_at": "2026-05-28T12:00:00.000Z"
}
],
"next_cursor": null
}Retrieve a discount code#
Retrieve one discount by UUID or code. If :id is a UUID it is matched against id, otherwise exactly (case-sensitive, NOT upper-cased) against code.
Path parameters
Discount UUID or code (use the exact stored case, normally upper-case).
Query parameters
Only for OAuth tokens that cover several shops: the shop to query. Must be one of the token's shops (else 403 forbidden). Required when the token covers more than one shop (else 400 shop_required). Optional for API keys (a key belongs to exactly one shop; any other value returns 403).
Response fields
Discount id.
Discount code (stored upper-case).
Internal title.
percentage | fixed | free_shipping (values from the MCP manage_discount schema).
For type=percentage: the percentage (e.g. 10). For fixed: amount in minor units. For free_shipping: unused.
all | products.
Products the code applies to when applies_to=products.
Minimum order value.
Minimum item quantity.
Total redemption limit.
Per-customer limit.
Whether combinable with other discounts.
Start of validity.
End of validity.
Active flag.
Redemptions so far.
Creation time; pagination key.
Last update.
Errors
Detail endpoints and PATCH.
Detail endpoints.
Any endpoint. Response carries header WWW-Authenticate: Bearer resource_metadata="<origin>/.well-known/oauth-protected-resource".
Scope check per endpoint (and per body field on PATCH /orders/:id).
shop_id query parameter names a shop outside the credential's reach.
Multi-shop OAuth token without shop_id.
Any endpoint when the resolved shop has active=false.
Any endpoint. Header Retry-After (seconds until the next minute bucket).
Any endpoint.
curl "https://api.ecomone.shop/api/public/v1/discounts/WINTER10" \
-H "X-Api-Key: $ECOMONE_API_KEY" \
-H "X-Api-Secret: $ECOMONE_API_SECRET"const res = await fetch("https://api.ecomone.shop/api/public/v1/discounts/WINTER10", {
method: "GET",
headers: {
"X-Api-Key": process.env.ECOMONE_API_KEY,
"X-Api-Secret": process.env.ECOMONE_API_SECRET,
},
});
if (!res.ok) throw new Error((await res.json()).message);
const { data } = await res.json();import os, requests
res = requests.get(
"https://api.ecomone.shop/api/public/v1/discounts/WINTER10",
headers={
"X-Api-Key": os.environ["ECOMONE_API_KEY"],
"X-Api-Secret": os.environ["ECOMONE_API_SECRET"],
},
timeout=30,
)
res.raise_for_status()
data = res.json()["data"]{
"data": {
"id": "a1b2c3d4-1111-4222-8333-444455556666",
"code": "SUMMER10",
"title": "Summer sale",
"type": "percentage",
"value_cents": 10,
"applies_to": "all",
"product_ids": [],
"min_purchase_cents": 4900,
"min_quantity": 0,
"usage_limit_total": 500,
"usage_limit_per_customer": 1,
"combinable": false,
"starts_at": "2026-06-01T00:00:00.000Z",
"ends_at": "2026-09-01T00:00:00.000Z",
"active": true,
"times_used": 118,
"created_at": "2026-05-28T12:00:00.000Z",
"updated_at": "2026-05-28T12:00:00.000Z"
}
}