- Welcome 👋
- Get Started
- Create Your First App
- Authorization
- Webhooks
- Conditional Webhooks
- Security Considerations
- Multi-Language Support
- Responses
- Pagination
- Rate Limiting
- Versioning
- Change Log
- Support
- APIs
- Orders
- Order Status
- Order Histories
- Order Tags
- Order Invoice
- Order Reservations
- Order Items
- Products
- Product Options
- Product Quantity
- Product Variants
- Product Tags
- Product Images
- Product Option Values
- Abandoned Carts
- Customer Groups
- Customers
- Digitals Product
- Categories
- Exports
- Shipments
- Shipping Companies
- Shipping Zones
- Shipping Rules
- Countries
- Product Option Templates
- Taxes
- Coupons
- Affiliates
- Order Assignment
- Special Offers
- Transactions
- Payments
- Settlements
- Settings
- Merchant
- Brands
- Reviews
- Branches
- Currencies
- SEO
- Cities
- DNS Records
- Languages
- Employees
- Advertisements
- Webhooks
- Custom URLs
- Loyalty Points
- Webhooks - Store Events
Create Coupon
Production
Production
POST
https://api.salla.dev/admin/v2/coupons
Coupons
Last modified:2025-01-20 18:44:01
Information
Single Coupon
Group Coupons
When creating a
If
following required variables:
Single Coupon
, ensure that you are sending the following required variables:Attribute | Type | Is Required |
---|---|---|
code | string | Yes |
type | string | Yes |
amount | number | Yes |
free_shipping | boolean | Yes |
expiry_date | string | Yes |
exclude_sale_products | boolean | Yes |
marketing_active
is valued as true
, then when creating Marketing Coupons
, ensure that you are sending thefollowing required variables:
Attribute | Type | Is Required |
---|---|---|
marketing_active | boolean | Yes |
marketing_name | string | Yes |
marketing_type | string | Yes |
marketing_amount | number | Yes |
Scopes
marketing.read_write
- Marketing Read & WriteRequest
Authorization
Add the parameter
Authorization
to Headers,whose value is to concatenate the Token after the Bearer.Example:
Authorization: Bearer ********************
Body Params application/json
type
enum<string>
optional
Allowed values:
PercentagepercentageFixedfixedFfPp
Example:
percentage
amount
number
optional
Example:
400
status
string
optional
Example:
inactive
start_date
string <date-time>
optional
YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Example:
2022-12-28 | 2022-12-28 10:50:01
expiry_date
string <date-time>
optional
YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Example:
2022-12-29 | 2022-12-29 11:55:21
applied_in
enum<string>
optional
all
or web
or app
Allowed values:
allwebapp
Example:
all
is_group
boolean
optional
Group
.Default:
true
is_apply_with_offer
boolean | null
optional
true
, the coupon will be applied with the created offer that has an apply with coupon option activated in the offers; otherwise, it will not be applied.group_name
string
optional
requiredif
is_group
value is true
Example:
Deals
group_coupons_count
integer
optional
requiredif
is_group
value is true
Example:
3
group_suffix
string
optional
requiredif
is_group
value is true
. No spaces/numbers are allowed<= 5 characters
Example:
xyz
usage_limit
number
optional
Example:
10
usage_limit_per_user
number
optional
Example:
10
minimum_amount
number
optional
Example:
10
maximum_amount
number
optional
requiredif
type is set to percentage
Example:
400
free_shipping
boolean
optional
Default:
true
exclude_sale_products
boolean
optional
Default:
true
show_maximum_amount
boolean
optional
Default:
true
marketing_show_maximum_amount
boolean
optional
Default:
true
marketing_active
boolean
optional
Default:
true
marketing_name
string
optional
Example:
User Test Marketing
marketing_type
enum<string>
optional
Allowed values:
PercentagepercentageFixedfixedFfPp
Example:
Percentage
marketing_amount
number
optional
Example:
10
marketing_hide_total_sales
boolean
optional
Default:
true
marketing_maximum_amount
number
optional
Example:
20
marketing_info
string
optional
Example:
Additional Info
beneficiary_domain
string
optional
Example:
test.test
products_include
array[string]
optional
list_include_categories
array[string]
optional
products_exclude
array[string]
optional
list_exclude_categories
array[string]
optional
list_exclude_brands
array[string]
optional
list_include_groups
array[string]
optional
list_exclude_groups
array[string]
optional
list_exclude_shipping
array[string]
optional
payment_methods
array[string]
optional
Allowed values:
allapple_paybankcodcredit_cardknetmadapaypalspotii_paystc_paytabby_installmenttamara_installment
Example
{
"code": "discount10",
"type": "percentage",
"amount": 10,
"maximum_amount": 50,
"free_shipping": true,
"start_date": "2022-08-02",
"expiry_date": "2022-12-12",
"exclude_sale_products": false,
"is_apply_with_offer": true
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.salla.dev/admin/v2/coupons' \
--header 'Content-Type: application/json' \
--data-raw '{
"code": "discount10",
"type": "percentage",
"amount": 10,
"maximum_amount": 50,
"free_shipping": true,
"start_date": "2022-08-02",
"expiry_date": "2022-12-12",
"exclude_sale_products": false,
"is_apply_with_offer": true
}'
Responses
🟢200Success
application/json
Body
status
number
optional
success
boolean
optional
data
object (Coupon)
optional
code
string
required
Example:
AAVVC
type
enum<string>
required
Allowed values:
percentagePercentagefixedFixedfp
Example:
percentage
status
enum<string>
required
Allowed values:
activeinactivedeleted
Example:
active
is_apply_with_offer
boolean | null
optional
true
, the coupon will be applied with the created offer that has an apply with coupon option activated in the offers; otherwise, it will not be applied.amount
object
required
minimum_amount
object
required
maximum_amount
object
required
show_maximum_amount
boolean
required
Default:
false
expiry_date
string
required
YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Example:
2022-12-31 12:59:59
start_date
string
required
YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
Example:
2022-12-28 12:59:59
free_shipping
boolean
required
Default:
true
usage_limit
number
required
Example:
89
usage_limit_per_user
number
required
Example:
88
include_product_ids
array[string]
required
exclude_product_ids
array[string]
required
is_sale_products_exclude
boolean
required
Default:
true
include_category_ids
array[string]
required
exclude_category_ids
array[string]
required
include_customer_group_ids
array[string]
required
exclude_customer_group_ids
array[string]
required
exclude_brands_ids
array[string]
required
exclude_shipping_ids
array[string]
required
include_customer_ids
array[string]
required
include_payment_methods
array[string]
required
Allowed values:
allapple_paybankcodcredit_cardknetmadapaypalspotii_paystc_paytabby_installmenttamara_installment
applied_in
enum<string>
required
all
or web
or app
Allowed values:
allwebapp
Example:
all
is_group
boolean
required
Default:
true
group_name
string | null
required
requiredif
is_group
= true
; otherwise returns null
valueExample:
Grouping1
group_coupons_count
number | null
required
requiredif
is_group
= true
; otherwise returns null
valueExample:
90
group_coupon_suffix
string | null
required
requiredif
is_group
= true
; otherwise returns null
valueExample:
xyz
group_coupons
array [object {1}]
required
requiredif
is_group
= true
; otherwise returns null
valuebeneficiary_domain
string | null
required
Example:
domain.test
statistics
object
required
Example:
domain.test
created_at
object
required
updated_at
object
required
marketing_active
boolean
required
Default:
true
marketing_name
string | null
required
requiredif
marketing_active
= true
; otherwise returns null
valueExample:
User Name
marketing_email
string | null
required
marketing_acive: true
; otherwise returns null
value.Example:
marketing_type
enum<string>
required
Allowed values:
percentagePercentagefixedFixedfp
Example:
percentage
marketing_amount
object | null
required
requiredif
marketing_active
= true
; otherwise returns null
valuemarketing_hide_total_sales
boolean | null
required
marketing_acive: true
; otherwise returns null
value.Default:
false
marketing_show_maximum_amount
boolean |