Discounts

Create discount

Creates a discount. A successful request returns the created Discount resource. Requires OAuth website scope website.discounts, or API key scope DISCOUNTS.

post/v1/commerce/discounts

Request

Headers

Authorizationstring required

API key or OAuth access token

User-Agentstring required

User Agent

Request body

isLimitedUsesboolean

If true, the discount can only be used maxUsesAllowed times site-wide.

isOncePerCustomerboolean

If true, a given customer can only use this discount once.

maxUsesAllowedinteger

Maximum site-wide redemptions. Required when isLimitedUses=true; null otherwise.

namestring required

Display name for the discount.

validFromstring date-time required

When the discount becomes active.

validTostring date-time

When the discount expires. Null = no expiry.

Example request

{
  "criteria": {
    "minimumCartTotal": {
      "value": 49.99
    }
  },
  "template": {
    "discountAmount": {
      "value": 49.99
    }
  }
}

Response

The created discount.

Example response

{
  "discount": {
    "criteria": {
      "minimumCartTotal": {
        "value": 49.99
      }
    },
    "template": {
      "discountAmount": {
        "value": 49.99
      }
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.