> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/discount/retrieve-a-single-discount.md).

# Retrieve a single discount

One discount by id — the list entry's attributes plus usage (the flows, campaigns and popups configured with it, ids and names) and statistics (lifetime counters, no date range). Which statistics are present depends on the discount shape and on omitShopifyData — see DiscountStatistics.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Discount","description":"Discounts"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"DiscountDetail":{"type":["object"],"required":["type","attributes"],"properties":{"type":{"type":"string","enum":["discounts"]},"attributes":{"allOf":[{"$ref":"#/components/schemas/DiscountAttributes"},{"type":"object","required":["usage","statistics"],"properties":{"usage":{"type":"object","description":"Where the discount is configured — configuration references, not code consumption","required":["flows","campaigns","optinTools"],"properties":{"flows":{"type":"array","description":"Automated flows; a campaign's own flow is listed under campaigns only","items":{"$ref":"#/components/schemas/UsageReference"}},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/UsageReference"}},"optinTools":{"type":"array","items":{"$ref":"#/components/schemas/UsageReference"}}}},"statistics":{"$ref":"#/components/schemas/DiscountStatistics"}}}]}}},"DiscountAttributes":{"type":"object","required":["id","name","status","customizationType","type","discountClasses","shopifyDiscountId","createdAt","updatedAt"],"properties":{"id":{"type":"string","description":"ID of the discount"},"name":{"type":"string","description":"Name of the discount"},"status":{"type":"string","description":"Computed from startsAt / endsAt; expired also after deactivation","enum":["active","scheduled","expired"]},"customizationType":{"type":"string","description":"unique = each customer gets a different code; general = one shared code","enum":["unique","general"]},"expiryType":{"type":"string","description":"unique only. fixed = a code pool whose codes expire at the end\ndate set when the discount was created. relative = an expiring\ncode created on demand; its expiration timer starts the moment\nthe customer receives the code via popup or SMS.\n","enum":["fixed","relative"]},"type":{"type":"string","description":"Shopify discount type; with discountClasses it is the\ndashboard's type (basic + product = Amount off product,\nbasic + order = Amount off order)\n","enum":["basic","bxgy","free-shipping","app"]},"discountClasses":{"type":"array","description":"Shopify discount classes of the discount. Together with the\nprice rule's combination settings they define which other\ndiscounts it can be combined with in one checkout, see\nhttps://help.shopify.com/en/manual/discounts/discount-combinations\n","items":{"type":"string","enum":["product","order","shipping"]}},"amount":{"type":"number","description":"Not on app discounts"},"valueType":{"type":"string","description":"Not on app discounts","enum":["PERCENTAGE","FIXED_AMOUNT","FREE_SHIPPING","UNKNOWN"]},"summary":{"type":"string","description":"Shopify's one-line description of value, target and conditions; not on app discounts"},"appTitle":{"type":"string","description":"App discounts only — the Shopify app that owns the discount"},"code":{"type":"string","description":"general only"},"discountCodePattern":{"type":"string","description":"unique only — the code prefix"},"mode":{"type":"string","description":"code pools only — refilling pools serve flows and popups, non-refilling pools serve campaigns","enum":["refilling","non-refilling"]},"targetCount":{"type":"integer","description":"code pools only"},"availableCount":{"type":"integer","description":"code pools only — codes not yet issued"},"fillStatus":{"type":"string","description":"code pools only — filling = codes still uploading to Shopify","enum":["needFilling","filling","full"]},"durationSeconds":{"type":"integer","description":"expiring only — validity from the moment the code is issued"},"template":{"type":"object","additionalProperties":true,"description":"expiring only — the Shopify discount input each issued code's\nprice rule is created from, as stored\n(type, title, appliesOncePerCustomer, usageLimit,\ncombinesWith, customerSelection, customerGets,\nminimumRequirement, destinationSelection for free shipping)\n"},"startsAt":{"type":"string","format":"date-time","description":"Not on expiring discounts"},"endsAt":{"type":"string","format":"date-time","nullable":true,"description":"null = no end date; not on expiring discounts"},"shopifyDiscountId":{"type":"string","description":"The Shopify discount (price rule) id"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"UsageReference":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string","description":"Empty when the referenced entity no longer exists"}}},"DiscountStatistics":{"type":"object","description":"Lifetime counters of one discount, no date range. Which fields are\npresent depends on the discount shape and on omitShopifyData:\n- sent — code pools and expiring discounts (customizationType\n  unique), whatever omitShopifyData is; never on general discounts\n  (a shared static code has no issuance record). Recart's count of\n  codes issued to subscribers by a message or popup, not deliveries.\n- used, sales, codesCount — only with omitShopifyData=false, and\n  only on general discounts and code pools; never on expiring\n  discounts (each issued code is its own Shopify price rule, the\n  stored one is never redeemed). Shopify's own counters, refreshed\n  asynchronously — they can lag recent orders by minutes.\nPer shape: general → {} by default, used + sales + codesCount with\nomitShopifyData=false; code pool → sent by default, all four with\nomitShopifyData=false; expiring → sent, whatever the flag.\n","properties":{"sent":{"type":"integer","description":"Codes issued to subscribers from the pool or created on demand. Present on code pools and expiring discounts whatever omitShopifyData is; absent on general discounts"},"used":{"type":"integer","description":"Orders that redeemed the discount (Shopify asyncUsageCount). Present only with omitShopifyData=false, on general discounts and code pools; absent on expiring discounts"},"sales":{"type":"object","additionalProperties":{"type":"number"},"description":"Shopify total sales keyed by currency code — the store currency only, no conversion. Same availability as used"},"codesCount":{"type":"integer","description":"Codes Shopify holds for the discount, 1 for general. Same availability as used"}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/discounts/{id}":{"get":{"summary":"Retrieve a single discount","tags":["Discount"],"operationId":"getDiscount","description":"One discount by id — the list entry's attributes plus usage (the\nflows, campaigns and popups configured with it, ids and names) and\nstatistics (lifetime counters, no date range). Which statistics are\npresent depends on the discount shape and on omitShopifyData — see\nDiscountStatistics.\n","parameters":[{"name":"id","in":"path","required":true,"description":"ID of the discount","schema":{"type":"string"}},{"name":"omitShopifyData","in":"query","description":"true (default): no live Shopify call — statistics has sent on\ncode pools and expiring discounts and is empty on general\ndiscounts. false: Shopify is called and used, sales and\ncodesCount are added on general discounts and code pools\n(never on expiring discounts).\n","schema":{"type":"boolean","default":true}}],"responses":{"200":{"description":"Ok","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DiscountDetail"}}}}}},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.recart.com/developers/public-api/discount/retrieve-a-single-discount.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
