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

Publish a discount draft

Not yet enabled for merchant accounts. Returns 403 ERR_WRITE_NOT_ALLOWED until enabled for your account.

Creates the discount on Shopify from a draft made with POST /discounts, with the draft's effective settings. The request has no body. Only the API key that made the draft can publish it. The discount keeps the draft's id. A code pool's codes are uploaded to Shopify over the next minutes, until fillStatus is full.

Publishing again is safe: a published draft returns the discount with 200, and no second discount is created. When the response is lost or is a 5XX, call again with the same id.

post
Authorizations
X-Recart-API-KeystringRequired

It can be obtained in Recart account after contacting Support

Path parameters
idstringRequired

ID of the draft

Responses
200

The draft was already published; the body is the discount, as with 201

application/vnd.api+json
post/discounts/{id}/publish
POST /app-integrations/2023-12/discounts/{id}/publish HTTP/1.1
Host: api.recart.com
X-Recart-API-Key: YOUR_API_KEY
Accept: */*
{
  "data": {
    "type": "discounts",
    "attributes": {
      "id": "66aa0f1c7e8c9d2b00123abc",
      "name": "Welcome 10%",
      "status": "active",
      "customizationType": "unique",
      "expiryType": "fixed",
      "type": "basic",
      "discountClasses": [
        "product"
      ],
      "amount": 10,
      "valueType": "PERCENTAGE",
      "summary": "10% off entire order",
      "appTitle": "text",
      "code": "WELCOME10",
      "discountCodePattern": "WELCOME{RAND}",
      "mode": "refilling",
      "targetCount": 10000,
      "availableCount": 8612,
      "fillStatus": "needFilling",
      "durationSeconds": 86400,
      "template": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "startsAt": "2026-01-01T00:00:00.000Z",
      "endsAt": "2026-01-01T00:00:00.000Z",
      "shopifyDiscountId": "1234567890123",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z",
      "usage": {
        "flows": [
          {
            "id": "6138d0ac2d79e00001210035",
            "name": "Welcome flow"
          }
        ],
        "campaigns": [
          {
            "id": "6138d0ac2d79e00001210035",
            "name": "Welcome flow"
          }
        ],
        "optinTools": [
          {
            "id": "6138d0ac2d79e00001210035",
            "name": "Welcome flow"
          }
        ]
      },
      "statistics": {
        "sent": 1388,
        "used": 212,
        "sales": {
          "USD": 9418.4
        },
        "codesCount": 10000
      }
    }
  }
}

Last updated

Was this helpful?