Shops

Add a discount code (percent, fixed or free shipping)

post/shops/{shopId}/discounts

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/shops/{shopId}/discounts
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

shopIdstring uuid required

Request body

DiscountInputBody required

See DiscountInput in packages/platform/src/contracts-shop.ts

Response

The discount

idstring uuid required
codestring required
kind'percent' | 'fixed' | 'free_shipping' required
valueinteger required
minSubtotalMinorinteger required

Minor units of the shop currency (öre, cents)

startsAtstring nullable required

ISO-8601 timestamp

endsAtstring nullable required

ISO-8601 timestamp

usageLimitinteger nullable required
usedCountinteger required
perCustomerLimitinteger nullable required
activeboolean required
createdAtstring required

ISO-8601 timestamp

Changes

No recorded changes to this operation across all 1 revision of this API.