Create a discount draft
Not yet enabled for merchant accounts. Returns 403 ERR_WRITE_NOT_ALLOWED until enabled for your account.
Creates a draft, not a discount: nothing is created on Shopify. The draft holds the effective settings — the request's settings with every default filled in — so they can be reviewed before the discount is published with POST /discounts/{id}/publish. The draft can be read with GET /discounts/{id} until it expires.
The code of a general discount is checked with Shopify, so a code already in use, in Recart or on Shopify, fails here and no draft is stored.
It can be obtained in Recart account after contacting Support
The draft was created
ERR_BAD_REQUEST — the payload failed validation, in which case
detail lists the offending fields. Also returned for a rule
that spans several settings, such as endsAt before startsAt.
ERR_CODE_TAKEN — another discount already uses the code.
detail is discount-exists when it is a Recart discount, and
price-rule-exists-in-shopify when it exists only on Shopify.
No draft is stored.
ERR_UNAUTHORIZED — the API key is missing.
ERR_FORBIDDEN — the API key is unknown or has been revoked.
ERR_WRITE_NOT_ALLOWED — creating discounts is not enabled for
this account. Do not retry.
ERR_SHOPIFY_ACCESS_DENIED — Shopify denied access to the
store's discounts. Creating cannot work until the store's Shopify
connection is fixed. Do not retry.
ERR_LIMIT_REACHED — the draft limit of the site is
reached. detail names the limit and when it resets.
HTTP Error response
HTTP Error response
POST /app-integrations/2023-12/discounts HTTP/1.1
Host: api.recart.com
X-Recart-API-Key: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 178
{
"data": {
"type": "discounts",
"attributes": {
"name": "Welcome 15",
"shape": {
"type": "refilling_pool",
"codePrefix": "WELCOME",
"endsAt": null
},
"value": {
"type": "percentage",
"percent": 15
}
}
}
}{
"data": {
"type": "discounts",
"attributes": {
"id": "6ac77d8c9b7d4e3fa1c6d2e0",
"status": "draft",
"effectiveSettings": {
"name": "Welcome 15",
"shape": {
"type": "refilling_pool",
"codePrefix": "WELCOME",
"targetCount": 10000,
"endsAt": null
},
"value": {
"type": "percentage",
"percent": 15
},
"startsAt": "2026-10-08T11:25:00.000Z",
"combinesWith": {
"orderDiscounts": false,
"productDiscounts": false,
"shippingDiscounts": false
},
"limits": {
"oncePerCustomer": false
},
"currency": "USD"
},
"defaultsApplied": [
"startsAt",
"minimumRequirement",
"combinesWith",
"limits"
],
"warnings": [],
"expiresAt": "2026-10-08T12:25:00.000Z"
}
}
}Last updated
Was this helpful?