SalesOS

Discount Rules

Discount approval rules and thresholds

List discount rules

GET
/v1/discount-rules

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

curl -X GET "https://api.salesos.org/v1/discount-rules" \
  -H "Authorization: Bearer <token>"

Create a discount rule

POST
/v1/discount-rules

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
nameRequiredstring
descriptionstring
typeRequiredstring
Value in: "BUNDLE" | "VOLUME" | "PROMO_CODE" | "CUSTOMER_SEGMENT" | "TIME_LIMITED"
codestring
discountRequirednumber
Minimum: 0
discountTypeRequiredstring
Value in: "PERCENTAGE" | "FIXED_AMOUNT"
conditionsobject
validFromstring
validTostring
isActiveboolean
prioritynumber
stackableboolean
maxUsesnumber
Minimum: 0

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/discount-rules" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "type": "BUNDLE",
    "code": "string",
    "discount": 0,
    "discountType": "PERCENTAGE",
    "conditions": {},
    "validFrom": "string",
    "validTo": "string",
    "isActive": true,
    "priority": 0,
    "stackable": true,
    "maxUses": 0
  }'

Get discount rule statistics

GET
/v1/discount-rules/stats

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

curl -X GET "https://api.salesos.org/v1/discount-rules/stats" \
  -H "Authorization: Bearer <token>"

Get a discount rule by promo code

GET
/v1/discount-rules/code/{code}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

codeRequiredstring
curl -X GET "https://api.salesos.org/v1/discount-rules/code/<string>" \
  -H "Authorization: Bearer <token>"

{}

List rules applicable to a quote

GET
/v1/discount-rules/applicable/{quoteId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

quoteIdRequiredstring
curl -X GET "https://api.salesos.org/v1/discount-rules/applicable/<string>" \
  -H "Authorization: Bearer <token>"

Get a discount rule

GET
/v1/discount-rules/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X GET "https://api.salesos.org/v1/discount-rules/<string>" \
  -H "Authorization: Bearer <token>"

Update a discount rule

PATCH
/v1/discount-rules/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
namestring
descriptionstring
codestring
discountnumber
Minimum: 0
discountTypestring
Value in: "PERCENTAGE" | "FIXED_AMOUNT"
conditionsobject
validFromstring
validTostring
isActiveboolean
prioritynumber
stackableboolean
maxUsesnumber
Minimum: 0

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X PATCH "https://api.salesos.org/v1/discount-rules/<string>" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "description": "string",
    "code": "string",
    "discount": 0,
    "discountType": "PERCENTAGE",
    "conditions": {},
    "validFrom": "string",
    "validTo": "string",
    "isActive": true,
    "priority": 0,
    "stackable": true,
    "maxUses": 0
  }'

Delete a discount rule

DELETE
/v1/discount-rules/{id}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring
curl -X DELETE "https://api.salesos.org/v1/discount-rules/<string>" \
  -H "Authorization: Bearer <token>"

Clone a discount rule

POST
/v1/discount-rules/{id}/clone

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
nameRequiredstring

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/discount-rules/<string>/clone" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'

Toggle a discount rule active/inactive

POST
/v1/discount-rules/{id}/toggle-active

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

idRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/discount-rules/<string>/toggle-active" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>"

Validate a promo code against a quote

POST
/v1/discount-rules/validate

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
codeRequiredstring
quoteIdRequiredstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/discount-rules/validate" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "string",
    "quoteId": "string"
  }'

{}

Apply a discount rule to a quote

POST
/v1/discount-rules/apply

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Request Body

application/jsonRequired
quoteIdRequiredstring
codestring
ruleIdstring

Header Parameters

Idempotency-Keystring

Unique key (a UUID is ideal) that makes this write safe to retry for 24 hours: a retry with the same body replays the original response (Idempotent-Replayed: true); the same key with a different body is a 409.

Maximum length: 255
curl -X POST "https://api.salesos.org/v1/discount-rules/apply" \
  -H "Idempotency-Key: <string>" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "quoteId": "string",
    "code": "string",
    "ruleId": "string"
  }'

{}

Remove an applied discount from a quote

DELETE
/v1/discount-rules/quotes/{quoteId}/rules/{ruleId}

Authorization

AuthorizationRequiredBearer <token>

Session token from the SalesOS web app.

In: header

X-API-Key<token>

API key from Settings → API Keys. Authorization: ApiKey <key> is also accepted. Each operation lists the scope it needs under x-api-key-scopes.

In: header

Path Parameters

quoteIdRequiredstring
ruleIdRequiredstring
curl -X DELETE "https://api.salesos.org/v1/discount-rules/quotes/<string>/rules/<string>" \
  -H "Authorization: Bearer <token>"