Admin — Customers & Discounts
Customer records, discount codes, and automatic sale campaigns.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
tags*array<string>curl -X GET 'https://api.devhelp.pk/admin/v1/customers/string/tags'{ "tags": [ "string" ]}Replace a customer's tags; new names create tags.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringapplication/json- body
tags*array<string>OK
application/json- response
tags*array<string>curl -X PUT 'https://api.devhelp.pk/admin/v1/customers/string/tags' \ -H 'Content-Type: application/json' \ -d '{ "tags": [ "string" ]}'{ "tags": [ "string" ]}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
limit?number24cursor?stringq?stringsegment?string"returning""ordered""not_ordered"OK
application/json- response
items*array<>nextCursor*string|nullcurl -X GET 'https://api.devhelp.pk/admin/v1/customers'{ "items": [ { "id": "string", "email": "string", "phone": "string", "origin": "checkout", "firstName": "string", "lastName": "string", "acceptsMarketing": true, "note": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "orderCount": 0, "spentPaisa": 0, "lastOrderAt": "2019-08-24T14:15:22Z", "emailSubscription": "none" } ], "nextCursor": "string"}Goes through the identity resolver, so submitting someone who already exists returns them rather than failing: email is matched first, then phone.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
application/json- body
phone?stringemail?stringfirstName?stringlastName?stringacceptsMarketing?booleanfalsenote?stringOK
application/json- response
id*stringemail*string|nullphone*string|nullorigin*string"checkout""order""popup""newsletter""back_in_stock""contact""booking""enquiry""review""whatsapp""account""admin""pos""import"firstName*string|nulllastName*string|nullacceptsMarketing*booleannote*string|nullcreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://api.devhelp.pk/admin/v1/customers' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "email": "string", "phone": "string", "origin": "checkout", "firstName": "string", "lastName": "string", "acceptsMarketing": true, "note": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Exact counts for the customer list: customers, returning customers (two or more placed orders, including cancellations), active newsletter subscribers and back-in-stock requests still waiting.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
OK
application/json- response
customers*numberreturning*numberemailSubscribers*numberwaitingForStock*numbercurl -X GET 'https://api.devhelp.pk/admin/v1/customers/counts'{ "customers": 0, "returning": 0, "emailSubscribers": 0, "waitingForStock": 0}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
id*stringemail*string|nullphone*string|nullorigin*string"checkout""order""popup""newsletter""back_in_stock""contact""booking""enquiry""review""whatsapp""account""admin""pos""import"firstName*string|nulllastName*string|nullacceptsMarketing*booleannote*string|nullcreatedAt*stringdate-timeupdatedAt*stringdate-timerisk*curl -X GET 'https://api.devhelp.pk/admin/v1/customers/string'{ "id": "string", "email": "string", "phone": "string", "origin": "checkout", "firstName": "string", "lastName": "string", "acceptsMarketing": true, "note": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "risk": { "orderCount": 0, "deliveredCount": 0, "rtoCount": 0, "cancelledCount": 0, "returnedCount": 0, "rtoRate": 0 }}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringapplication/json- body
email?string|nullphone?string|nullfirstName?string|nulllastName?string|nullacceptsMarketing?booleannote?string|nullOK
application/json- response
id*stringemail*string|nullphone*string|nullorigin*string"checkout""order""popup""newsletter""back_in_stock""contact""booking""enquiry""review""whatsapp""account""admin""pos""import"firstName*string|nulllastName*string|nullacceptsMarketing*booleannote*string|nullcreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.devhelp.pk/admin/v1/customers/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "email": "string", "phone": "string", "origin": "checkout", "firstName": "string", "lastName": "string", "acceptsMarketing": true, "note": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Retires the customer and their addresses; nothing is removed.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
id*stringdeleted*unknowncurl -X DELETE 'https://api.devhelp.pk/admin/v1/customers/string'{ "id": "string", "deleted": true}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
firstTouch*|nullevents*array<>curl -X GET 'https://api.devhelp.pk/admin/v1/customers/string/journey'{ "firstTouch": { "landingPath": "string", "referrerHost": "string", "utmSource": "string", "utmMedium": "string", "utmCampaign": "string", "at": "2019-08-24T14:15:22Z" }, "events": [ { "kind": "page_view", "detail": "string", "at": "2019-08-24T14:15:22Z" } ]}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
customerId*stringlimit?number24cursor?stringOK
application/json- response
items*array<>nextCursor*string|nullcurl -X GET 'https://api.devhelp.pk/admin/v1/customers/string/addresses'{ "items": [ { "id": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string", "isDefault": true, "createdAt": "2019-08-24T14:15:22Z" } ], "nextCursor": "string"}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
customerId*stringapplication/json- body
line1*stringline2?string|nullcity*stringprovince?string""postalCode?string""landmark?string|nullcountry?string"PK""AD""AE""AF""AG""AI""AL""AM""AO""AQ""AR""AS""AT""AU""AW""AX""AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ""BR""BS""BT""BV""BW""BY""BZ""CA""CC""CD""CF""CG""CH""CI""CK""CL""CM""CN""CO""CR""CU""CV""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DZ""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB""GD""GE""GF""GG""GH""GI""GL""GM""GN""GP""GQ""GR""GS""GT""GU""GW""GY""HK""HM""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IR""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KP""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MF""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NC""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PS""PT""PW""PY""QA""RE""RO""RS""RU""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SY""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TW""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"recipientName*stringrecipientPhone*stringisDefault?booleanfalseOK
application/json- response
id*stringline1*stringline2*string|nullcity*stringprovince*stringpostalCode*stringlandmark*string|nullcountry*string"AD""AE""AF""AG""AI""AL""AM""AO""AQ""AR""AS""AT""AU""AW""AX""AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ""BR""BS""BT""BV""BW""BY""BZ""CA""CC""CD""CF""CG""CH""CI""CK""CL""CM""CN""CO""CR""CU""CV""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DZ""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB""GD""GE""GF""GG""GH""GI""GL""GM""GN""GP""GQ""GR""GS""GT""GU""GW""GY""HK""HM""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IR""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KP""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MF""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NC""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PS""PT""PW""PY""QA""RE""RO""RS""RU""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SY""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TW""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"recipientName*stringrecipientPhone*stringisDefault*booleancreatedAt*stringdate-timecurl -X POST 'https://api.devhelp.pk/admin/v1/customers/string/addresses' \ -H 'Content-Type: application/json' \ -d '{ "line1": "string", "city": "string", "recipientName": "string", "recipientPhone": "string"}'{ "id": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string", "isDefault": true, "createdAt": "2019-08-24T14:15:22Z"}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
customerId*stringaddressId*stringapplication/json- body
line1?stringline2?string|nullcity?stringprovince?stringpostalCode?stringlandmark?string|nullcountry?string"AD""AE""AF""AG""AI""AL""AM""AO""AQ""AR""AS""AT""AU""AW""AX""AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ""BR""BS""BT""BV""BW""BY""BZ""CA""CC""CD""CF""CG""CH""CI""CK""CL""CM""CN""CO""CR""CU""CV""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DZ""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB""GD""GE""GF""GG""GH""GI""GL""GM""GN""GP""GQ""GR""GS""GT""GU""GW""GY""HK""HM""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IR""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KP""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MF""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NC""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PS""PT""PW""PY""QA""RE""RO""RS""RU""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SY""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TW""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"recipientName?stringrecipientPhone?stringisDefault?booleanOK
application/json- response
id*stringline1*stringline2*string|nullcity*stringprovince*stringpostalCode*stringlandmark*string|nullcountry*string"AD""AE""AF""AG""AI""AL""AM""AO""AQ""AR""AS""AT""AU""AW""AX""AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ""BR""BS""BT""BV""BW""BY""BZ""CA""CC""CD""CF""CG""CH""CI""CK""CL""CM""CN""CO""CR""CU""CV""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DZ""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB""GD""GE""GF""GG""GH""GI""GL""GM""GN""GP""GQ""GR""GS""GT""GU""GW""GY""HK""HM""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IR""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KP""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MF""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NC""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PS""PT""PW""PY""QA""RE""RO""RS""RU""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SY""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TW""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"recipientName*stringrecipientPhone*stringisDefault*booleancreatedAt*stringdate-timecurl -X PATCH 'https://api.devhelp.pk/admin/v1/customers/string/addresses/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string", "isDefault": true, "createdAt": "2019-08-24T14:15:22Z"}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
customerId*stringaddressId*stringOK
application/json- response
id*stringdeleted*unknowncurl -X DELETE 'https://api.devhelp.pk/admin/v1/customers/string/addresses/string'{ "id": "string", "deleted": true}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
limit?number24cursor?stringq?stringstate?string"active""scheduled""expired""disabled"method?string"code""automatic""sale"type?string"product""order""shipping"OK
application/json- response
items*array<>nextCursor*string|nullcurl -X GET 'https://api.devhelp.pk/admin/v1/discounts'{ "items": [ { "id": "string", "title": "string", "method": "code", "code": "string", "type": "product", "valueType": "percentage", "percentageBps": 0, "amountPaisa": 0, "fixedApplies": "once_per_order", "maxDiscountPaisa": 0, "appliesTo": "all", "productIds": [ "string" ], "collectionIds": [ "string" ], "minRequirement": "none", "minSubtotalPaisa": 0, "minQuantity": 0, "customerEligibility": "all", "customerIds": [ "string" ], "shippingZoneIds": [ "string" ], "maxShippingRatePaisa": 0, "usageLimit": 0, "oncePerCustomer": true, "combinesWith": { "product": true, "order": true, "shipping": true }, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "excludedProductIds": [ "string" ], "excludedCollectionIds": [ "string" ], "includeMarkedDown": true, "status": "active", "state": "active", "usageCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" } ], "nextCursor": "string"}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
application/json- body
title*stringmethod*string"code""automatic""sale"code?|nulltype*string"product""order""shipping"valueType*string"percentage""fixed_amount""free"percentageBps?|nullamountPaisa?|nullfixedApplies?|nullmaxDiscountPaisa?|nullappliesTo?string"all""all""products""collections"productIds?array<string>[]collectionIds?array<string>[]minRequirement?string"none""none""subtotal""quantity"minSubtotalPaisa?|nullminQuantity?|nullcustomerEligibility?string"all""all""specific"customerIds?array<string>[]shippingZoneIds?array<string>[]maxShippingRatePaisa?|nullusageLimit?|nulloncePerCustomer?booleanfalsecombinesWith?{ "product": false, "order": false, "shipping": false}startsAt?stringdate-timeendsAt?|nullexcludedProductIds?array<string>[]excludedCollectionIds?array<string>[]includeMarkedDown?booleanfalsestatus?string"active""active""disabled"OK
application/json- response
id*stringtitle*stringmethod*string"code""automatic""sale"code*string|nulltype*string"product""order""shipping"valueType*string"percentage""fixed_amount""free"percentageBps*number|nullamountPaisa*number|nullfixedApplies*|nullmaxDiscountPaisa*number|nullappliesTo*string"all""products""collections"productIds*array<string>collectionIds*array<string>minRequirement*string"none""subtotal""quantity"minSubtotalPaisa*number|nullminQuantity*number|nullcustomerEligibility*string"all""specific"customerIds*array<string>shippingZoneIds*array<string>maxShippingRatePaisa*number|nullusageLimit*number|nulloncePerCustomer*booleancombinesWith*startsAt*stringdate-timeendsAt*|nullexcludedProductIds*array<string>excludedCollectionIds*array<string>includeMarkedDown*booleanstatus*string"active""disabled""deleted"state*string"active""scheduled""expired""disabled"usageCount*numbercreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://api.devhelp.pk/admin/v1/discounts' \ -H 'Content-Type: application/json' \ -d '{ "title": "string", "method": "code", "type": "product", "valueType": "percentage"}'{ "id": "string", "title": "string", "method": "code", "code": "string", "type": "product", "valueType": "percentage", "percentageBps": 0, "amountPaisa": 0, "fixedApplies": "once_per_order", "maxDiscountPaisa": 0, "appliesTo": "all", "productIds": [ "string" ], "collectionIds": [ "string" ], "minRequirement": "none", "minSubtotalPaisa": 0, "minQuantity": 0, "customerEligibility": "all", "customerIds": [ "string" ], "shippingZoneIds": [ "string" ], "maxShippingRatePaisa": 0, "usageLimit": 0, "oncePerCustomer": true, "combinesWith": { "product": true, "order": true, "shipping": true }, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "excludedProductIds": [ "string" ], "excludedCollectionIds": [ "string" ], "includeMarkedDown": true, "status": "active", "state": "active", "usageCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Exact counts for the discount list's views: every discount that is not deleted, and how many are active, scheduled, expired or disabled right now.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
OK
application/json- response
all*numberactive*numberscheduled*numberexpired*numberdisabled*numbercurl -X GET 'https://api.devhelp.pk/admin/v1/discounts/counts'{ "all": 0, "active": 0, "scheduled": 0, "expired": 0, "disabled": 0}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
id*stringtitle*stringmethod*string"code""automatic""sale"code*string|nulltype*string"product""order""shipping"valueType*string"percentage""fixed_amount""free"percentageBps*number|nullamountPaisa*number|nullfixedApplies*|nullmaxDiscountPaisa*number|nullappliesTo*string"all""products""collections"productIds*array<string>collectionIds*array<string>minRequirement*string"none""subtotal""quantity"minSubtotalPaisa*number|nullminQuantity*number|nullcustomerEligibility*string"all""specific"customerIds*array<string>shippingZoneIds*array<string>maxShippingRatePaisa*number|nullusageLimit*number|nulloncePerCustomer*booleancombinesWith*startsAt*stringdate-timeendsAt*|nullexcludedProductIds*array<string>excludedCollectionIds*array<string>includeMarkedDown*booleanstatus*string"active""disabled""deleted"state*string"active""scheduled""expired""disabled"usageCount*numbercreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X GET 'https://api.devhelp.pk/admin/v1/discounts/string'{ "id": "string", "title": "string", "method": "code", "code": "string", "type": "product", "valueType": "percentage", "percentageBps": 0, "amountPaisa": 0, "fixedApplies": "once_per_order", "maxDiscountPaisa": 0, "appliesTo": "all", "productIds": [ "string" ], "collectionIds": [ "string" ], "minRequirement": "none", "minSubtotalPaisa": 0, "minQuantity": 0, "customerEligibility": "all", "customerIds": [ "string" ], "shippingZoneIds": [ "string" ], "maxShippingRatePaisa": 0, "usageLimit": 0, "oncePerCustomer": true, "combinesWith": { "product": true, "order": true, "shipping": true }, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "excludedProductIds": [ "string" ], "excludedCollectionIds": [ "string" ], "includeMarkedDown": true, "status": "active", "state": "active", "usageCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Any subset of settings; the merged result must still be a coherent discount. Product, collection and customer lists are replaced when given.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringapplication/json- body
title?stringmethod?string"code""automatic""sale"code?string|nulltype?string"product""order""shipping"valueType?string"percentage""fixed_amount""free"percentageBps?number|nullamountPaisa?number|nullfixedApplies?|nullmaxDiscountPaisa?number|nullappliesTo?string"all""products""collections"productIds?array<string>collectionIds?array<string>minRequirement?string"none""subtotal""quantity"minSubtotalPaisa?number|nullminQuantity?number|nullcustomerEligibility?string"all""specific"customerIds?array<string>shippingZoneIds?array<string>maxShippingRatePaisa?number|nullusageLimit?number|nulloncePerCustomer?booleancombinesWith?startsAt?stringdate-timeendsAt?|nullexcludedProductIds?array<string>excludedCollectionIds?array<string>includeMarkedDown?booleanstatus?string"active""disabled"OK
application/json- response
id*stringtitle*stringmethod*string"code""automatic""sale"code*string|nulltype*string"product""order""shipping"valueType*string"percentage""fixed_amount""free"percentageBps*number|nullamountPaisa*number|nullfixedApplies*|nullmaxDiscountPaisa*number|nullappliesTo*string"all""products""collections"productIds*array<string>collectionIds*array<string>minRequirement*string"none""subtotal""quantity"minSubtotalPaisa*number|nullminQuantity*number|nullcustomerEligibility*string"all""specific"customerIds*array<string>shippingZoneIds*array<string>maxShippingRatePaisa*number|nullusageLimit*number|nulloncePerCustomer*booleancombinesWith*startsAt*stringdate-timeendsAt*|nullexcludedProductIds*array<string>excludedCollectionIds*array<string>includeMarkedDown*booleanstatus*string"active""disabled""deleted"state*string"active""scheduled""expired""disabled"usageCount*numbercreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.devhelp.pk/admin/v1/discounts/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "title": "string", "method": "code", "code": "string", "type": "product", "valueType": "percentage", "percentageBps": 0, "amountPaisa": 0, "fixedApplies": "once_per_order", "maxDiscountPaisa": 0, "appliesTo": "all", "productIds": [ "string" ], "collectionIds": [ "string" ], "minRequirement": "none", "minSubtotalPaisa": 0, "minQuantity": 0, "customerEligibility": "all", "customerIds": [ "string" ], "shippingZoneIds": [ "string" ], "maxShippingRatePaisa": 0, "usageLimit": 0, "oncePerCustomer": true, "combinesWith": { "product": true, "order": true, "shipping": true }, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "excludedProductIds": [ "string" ], "excludedCollectionIds": [ "string" ], "includeMarkedDown": true, "status": "active", "state": "active", "usageCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Soft: orders that used it keep their record of what it took off.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
id*stringdeleted*unknowncurl -X DELETE 'https://api.devhelp.pk/admin/v1/discounts/string'{ "id": "string", "deleted": true}secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringlimit?number24cursor?stringOK
application/json- response
items*array<>nextCursor*string|nullcurl -X GET 'https://api.devhelp.pk/admin/v1/discounts/string/usages'{ "items": [ { "orderId": "string", "orderNumber": 0, "customerId": "string", "phone": "string", "status": "active", "createdAt": "2019-08-24T14:15:22Z" } ], "nextCursor": "string"}What a sale with these settings would price now: products and variants, sample prices, variants it skips and why, overlapping sales and discounts that will not reduce sale items. Nothing is saved.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
application/json- body
id?stringpercentageBps*numberappliesTo*string"all""products""collections"productIds?array<string>[]collectionIds?array<string>[]excludedProductIds?array<string>[]excludedCollectionIds?array<string>[]includeMarkedDown?booleanfalsecombinesWith?{ "product": false, "order": false, "shipping": true}startsAt?stringdate-timeendsAt?|nullOK
application/json- response
products*numbervariants*numberskippedMarkedDown*numberskippedExcluded*numberskippedOtherSale*numbersamples*array<>overlaps*array<>conflicts*array<>curl -X POST 'https://api.devhelp.pk/admin/v1/discounts/sale-preview' \ -H 'Content-Type: application/json' \ -d '{ "percentageBps": 0, "appliesTo": "all"}'{ "products": 0, "variants": 0, "skippedMarkedDown": 0, "skippedExcluded": 0, "skippedOtherSale": 0, "samples": [ { "productId": "string", "productTitle": "string", "variantTitle": "string", "pricePaisa": 0, "salePricePaisa": 0, "compareAtPricePaisa": 0 } ], "overlaps": [ { "discountId": "string", "title": "string", "percentageBps": 0, "state": "active", "wins": 0, "loses": 0 } ], "conflicts": [ { "discountId": "string", "title": "string", "code": "string", "type": "product", "effect": "items" } ]}How many orders used the discount, those orders' totals and what the discount took off them. Cancelled and test orders are left out.
secretKeyx-api-key<token>Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.
id*stringOK
application/json- response
orders*numbersales*discountGiven*curl -X GET 'https://api.devhelp.pk/admin/v1/discounts/string/stats'{ "orders": 0, "sales": { "amount": 0, "currency": "PKR" }, "discountGiven": { "amount": 0, "currency": "PKR" }}