Skip to main content
POST
/
v3
/
discount-codes
Create a discount code
curl --request POST \
  --url https://api.scalev.com/v3/discount-codes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "SAVE10",
  "amount": 123,
  "percentage": 50,
  "is_max_amount": true,
  "max_amount": 123,
  "is_enabled": true,
  "is_usage_limit": false,
  "usage_limit": 123,
  "is_expiry": false,
  "expiry_time": "2023-11-07T05:31:56Z",
  "is_limited_to_pages": false,
  "page_ids": [
    123
  ],
  "is_limited_to_payment_methods": false,
  "payment_methods": [
    "<string>"
  ],
  "is_minimum_revenue": false,
  "minimum_revenue": 123
}
'
{
  "id": 123,
  "business_id": 123,
  "is_enabled": true,
  "code": "<string>",
  "applied_to": "<string>",
  "amount_type": "<string>",
  "percentage": "<string>",
  "is_max_amount": true,
  "max_amount": "<string>",
  "amount": "<string>",
  "is_usage_limit": true,
  "usage_limit": 123,
  "current_usage": 123,
  "is_expiry": true,
  "expiry_time": "2023-11-07T05:31:56Z",
  "is_limited_to_pages": true,
  "pages": [
    {}
  ],
  "is_limited_to_payment_methods": true,
  "payment_methods": [
    "<string>"
  ],
  "is_minimum_revenue": true,
  "minimum_revenue": "<string>",
  "inserted_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
code
string
required

Discount code. Saved uppercase with spaces removed.

Example:

"SAVE10"

applied_to
enum<string>
required
Available options:
product_price,
shipping_cost
amount_type
enum<string>
required
Available options:
fixed,
percentage
amount
number | null

Required when amount_type is fixed.

percentage
integer | null

Required when amount_type is percentage.

Required range: 0 <= x <= 100
is_max_amount
boolean | null

Required when amount_type is percentage.

max_amount
number | null
is_enabled
boolean
default:true
is_usage_limit
boolean
default:false
usage_limit
integer | null
is_expiry
boolean
default:false
expiry_time
string<date-time> | null
is_limited_to_pages
boolean
default:false
page_ids
integer[]
is_limited_to_payment_methods
boolean
default:false
payment_methods
string[]
is_minimum_revenue
boolean
default:false
minimum_revenue
number | null

Response

Discount code

Business-scoped discount code.

id
integer
business_id
integer
is_enabled
boolean
code
string
applied_to
string | null
amount_type
string | null
percentage
is_max_amount
boolean
max_amount
amount
is_usage_limit
boolean
usage_limit
integer | null
current_usage
integer | null
is_expiry
boolean
expiry_time
string<date-time> | null
is_limited_to_pages
boolean
pages
object[]
is_limited_to_payment_methods
boolean
payment_methods
string[]

Customer checkout payment method code.

is_minimum_revenue
boolean
minimum_revenue
inserted_at
string<date-time> | null
updated_at
string<date-time> | null