Skip to main content
PATCH
/
dev
/
v1
/
coupons
/
{id}
Update coupon
curl --request PATCH \
  --url https://api.shoppex.io/dev/v1/coupons/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "SAVE15",
  "discount_value": 15,
  "products_bound": [
    "prod_1",
    "prod_2"
  ],
  "used_count": 4,
  "is_active": true
}
'
{
  "data": {
    "id": "coupon_db_1",
    "uniqid": "coupon_1",
    "shop_id": "shop_1",
    "type": "PERCENTAGE",
    "code": "save15",
    "discount": 15,
    "used": 4,
    "max_uses": 100,
    "min_order_amount": 20,
    "max_discount": 50,
    "valid_from": 1711929600,
    "valid_until": 1714521600,
    "is_active": true,
    "created_at": 1711929600,
    "updated_at": 1711936800,
    "products_bound": [
      "prod_1",
      "prod_2"
    ],
    "products_count": 2
  }
}

Authorizations

Authorization
string
header
required

Use your Shoppex API key in the Authorization header.

Path Parameters

id
string
required

Body

code
string
Required string length: 1 - 64
discount_value
number
Required range: x >= 1e-9
discount_type
Available options:
PERCENTAGE
max_uses
default:0
products_bound
string[]
min_order_amount
number | null
max_discount
number | null
valid_from
valid_until
used_count
integer
Required range: x >= 0
is_active
boolean

Response

Successful response

data
object
required