Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

post
Authorizations
X-Recart-API-KeystringRequired

It can be obtained in Recart account after contacting Support

Body
Responses
201

The draft was created

application/vnd.api+json
post/discounts
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?