Promo Codes API
Overview
Section titled “Overview”Create and manage promo codes for orders and reservations.
Methods
Section titled “Methods”createPromoCode(params, options?)
Section titled “createPromoCode(params, options?)”Create a new promo code.
await arky.promoCode.createPromoCode({ code: 'SAVE20', discounts: [ { type: 'ITEMS_PERCENTAGE', marketId: 'US', bps: 2000 // 20% } ], conditions: [ { type: 'MIN_ORDER_AMOUNT', value: 5000 // $50.00 in cents }, { type: 'DATE_RANGE', value: { start: 1704067200, end: 1735689599 } } ]});Parameters:
code(string, required): Promo codediscounts(array, required): Array of discount objectstype:'ITEMS_PERCENTAGE','ITEMS_FIXED', or'SHIPPING_PERCENTAGE'marketId(string): Market ID (e.g., ‘US’)bps(number, optional): Basis points for percentage (e.g., 2000 = 20%)amount(number, optional): Fixed amount in cents
conditions(array, required): Array of condition objectstype:'PRODUCTS','SERVICES','MIN_ORDER_AMOUNT','DATE_RANGE','MAX_USES','MAX_USES_PER_USER'value: String array (for PRODUCTS/SERVICES), number (for amounts/counts), or object with start/end (for DATE_RANGE)
getPromoCodes(params, options?)
Section titled “getPromoCodes(params, options?)”List all promo codes.
const promoCodes = await arky.promoCode.getPromoCodes({ statuses: ['ACTIVE'], limit: 50});Parameters:
statuses(string[], optional): Filter by statusquery(string, optional): Search querylimit(number, optional): Results per pagecursor(string, optional): Pagination cursor
getPromoCode(params, options?)
Section titled “getPromoCode(params, options?)”Get a single promo code by ID.
const promoCode = await arky.promoCode.getPromoCode({ id: 'promo-id' });Parameters:
id(string, required): Promo code ID
updatePromoCode(params, options?)
Section titled “updatePromoCode(params, options?)”Update an existing promo code.
await arky.promoCode.updatePromoCode({ id: 'promo-id', code: 'SAVE20', discounts: [...], conditions: [...], statuses: [ { status: 'INACTIVE', changedBy: 'USER', timestamp: Date.now() } ]});Parameters:
id(string, required): Promo code IDcode(string, required): Promo codediscounts(array, required): Same ascreatePromoCodeconditions(array, required): Same ascreatePromoCodestatuses(array, optional): Status events
deletePromoCode(params, options?)
Section titled “deletePromoCode(params, options?)”Delete a promo code.
await arky.promoCode.deletePromoCode({ id: 'promo-id' });Parameters:
id(string, required): Promo code ID
Endpoint
Section titled “Endpoint”Base URL: /v1/businesses/{businessId}/promo-codes
Authentication: Required