Skip to main content
PATCH
/
v3
/
discount-codes
/
{id}
Update a discount code
curl --request PATCH \
  --url https://api.scalev.com/v3/discount-codes/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "is_enabled": true,
  "is_usage_limit": true,
  "usage_limit": 123,
  "is_expiry": true,
  "expiry_time": "2023-11-07T05:31:56Z",
  "is_limited_to_pages": true,
  "page_ids": [
    123
  ],
  "is_limited_to_payment_methods": true,
  "payment_methods": [
    "<string>"
  ],
  "is_minimum_revenue": true,
  "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.

Path Parameters

id
string
required

Body

application/json
is_enabled
boolean
is_usage_limit
boolean
usage_limit
integer | null
is_expiry
boolean
expiry_time
string<date-time> | null
is_limited_to_pages
boolean
page_ids
integer[]
is_limited_to_payment_methods
boolean
payment_methods
string[]
is_minimum_revenue
boolean
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