Discount Codes

Discount codes can be added to a cart to enable certain cart discounts.

With discount codes it is possible to give specific cart discounts to an eligible amount of users. They are defined by a string value which can be added to a cart so that specific cart discounts can be applied to the cart.

Representations

DiscountCode

DiscountCodeDraft

Get DiscountCode by ID

Endpoint: /{projectKey}/discount-codes/{id}
Method: GET
OAuth2 Scopes: view_orders:{projectKey}
Response Representation: DiscountCode

Query DiscountCodes

Endpoint: /{projectKey}/discount-codes
Method: GET
OAuth2 Scopes: view_orders:{projectKey}
Response Representation: PagedQueryResult with the results array of DiscountCode
Query Parameters:

Create a DiscountCode

Endpoint: /{projectKey}/discount-codes
Method: POST
OAuth2 Scopes: manage_orders:{projectKey}
Request Representation: DiscountCodeDraft
Response Representation: DiscountCode

Update DiscountCode

Endpoint: /{projectKey}/discount-codes/{id}
Method: POST
OAuth2 Scopes: manage_orders:{projectKey}
Response Representation: DiscountCode
Fields:

Update Actions
Please find below the individual update actions provided on this endpoint.


Set Name

Set Description

Set Cart Predicate

Set Max Applications

Set Max Applications Per Customer

Change CartDiscounts

Change IsActive

Delete DiscountCode

This request deletes discount codes only if it’s not referenced by carts.

Endpoint: /{projectKey}/discount-code/{id}
Method: DELETE
OAuth2 Scopes: manage_orders:{projectKey} Query Parameters: