SellAuth

Coupons

Get Coupons

Retrieves the coupons.

GET
/v1/shops/{shopId}/coupons

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Path Parameters

shopIdRequiredinteger
curl -X GET "https://api.sellauth.com/v1/shops/{shopId}/coupons" \
  -H "Authorization: Bearer <token>"

{
  "message": "No query results for model [App\\Models\\Shop] 1"
}

Create Coupon

Creates a new coupon.

POST
/v1/shops/{shopId}/coupons

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Request Body

application/jsonRequired
codeRequiredstring
globalRequiredboolean
discountRequirednumber

Must be at least -999999. Must not be greater than 999999.

typeRequiredstring
Value in: "percentage" | "fixed"
max_usesnumber

Must not be greater than 999999.

max_uses_per_customernumber

Must not be greater than 999999.

min_invoice_pricenumber

Must be at least 0. Must not be greater than 999999.

start_datestring

Must be a valid date. Must be a date before 2038-01-19.

expiration_datestring

Must be a valid date. Must be a date after today. Must be a date before 2038-01-19.

allowed_emailsarray<string>

Must be a valid email address.

disable_if_volume_discountRequiredboolean
itemsarray<object>

This field is required when global is false.

Path Parameters

shopIdRequiredinteger
curl -X POST "https://api.sellauth.com/v1/shops/{shopId}/coupons" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "adipisci",
    "global": false,
    "discount": 11,
    "type": "fixed",
    "max_uses": 9,
    "max_uses_per_customer": 14,
    "min_invoice_price": 16,
    "start_date": "2010-06-16",
    "expiration_date": "2017-11-16",
    "allowed_emails": [
      "vcormier@example.net"
    ],
    "disable_if_volume_discount": true,
    "items": null
  }'

Get Coupon

Retrieves a specific coupon.

GET
/v1/shops/{shopId}/coupons/{couponId}

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Path Parameters

shopIdRequiredinteger
couponIdRequiredstring
curl -X GET "https://api.sellauth.com/v1/shops/{shopId}/coupons/et" \
  -H "Authorization: Bearer <token>"

{
  "message": "No query results for model [App\\Models\\Shop] 1"
}

Get Coupon

Retrieves a specific coupon.

DELETE
/v1/shops/{shopId}/coupons/{couponId}

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Path Parameters

shopIdRequiredinteger
couponIdRequiredstring
curl -X DELETE "https://api.sellauth.com/v1/shops/{shopId}/coupons/et" \
  -H "Authorization: Bearer <token>"

Delete Used Coupons

Deletes all used coupons.

DELETE
/v1/shops/{shopId}/coupons/used

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Path Parameters

shopIdRequiredinteger
curl -X DELETE "https://api.sellauth.com/v1/shops/{shopId}/coupons/used" \
  -H "Authorization: Bearer <token>"

Update Coupon

Updates a specific coupon.

PUT
/v1/shops/{shopId}/coupons/{couponId}/update

Authorization

AuthorizationRequiredBearer <token>

You can retrieve your API key by visiting your dashboard and clicking Account > API.

In: header

Request Body

application/jsonRequired
codeRequiredstring
globalRequiredboolean
discountRequirednumber

Must be at least -999999. Must not be greater than 999999.

typeRequiredstring
Value in: "percentage" | "fixed"
max_usesnumber

Must not be greater than 999999.

max_uses_per_customernumber

Must not be greater than 999999.

min_invoice_pricenumber

Must be at least 0. Must not be greater than 999999.

start_datestring

Must be a valid date. Must be a date before 2038-01-19.

expiration_datestring

Must be a valid date. Must be a date after today. Must be a date before 2038-01-19.

allowed_emailsarray<string>

Must be a valid email address.

disable_if_volume_discountRequiredboolean
itemsarray<object>

This field is required when global is false.

Path Parameters

shopIdRequiredinteger
couponIdRequiredstring
curl -X PUT "https://api.sellauth.com/v1/shops/{shopId}/coupons/quia/update" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "aspernatur",
    "global": false,
    "discount": 4,
    "type": "fixed",
    "max_uses": 13,
    "max_uses_per_customer": 17,
    "min_invoice_price": 14,
    "start_date": "2033-07-27",
    "expiration_date": "2012-04-19",
    "allowed_emails": [
      "norberto.rutherford@example.com"
    ],
    "disable_if_volume_discount": false,
    "items": null
  }'