Storefront — Carts & Checkout
Create and update shopper carts, apply discounts, quote delivery, and place orders.
Returns the cart together with its token. The token is shown exactly once and stored hashed, so it cannot be recovered afterwards — keep it for the session.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
application/json- body
variantId?stringquantity?number1OK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timetoken*stringcurl -X POST 'https://api.devhelp.pk/storefront/v1/carts' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "token": "string"}Totals are recomputed from live prices on every read; nothing is cached, so a cart left open overnight is quoted today's prices rather than yesterday's.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringtoken*stringOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X GET 'https://api.devhelp.pk/storefront/v1/carts/string?token=string'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringapplication/json- body
token*stringemail?string|nullphone?string|nullname?string|nullshippingAddress?|nullbillingAddress?|nullshippingRateId?string|nulldiscountCodes?array<string>paymentMethod?string"cod""test""safepay""stripe""alfalah""in_person""venue"emailOffers?booleanparticipants?array<>consent?booleanOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.devhelp.pk/storefront/v1/carts/string' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Adding a variant already in the cart increases its quantity rather than creating a second line. Availability is checked; no stock is reserved.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringapplication/json- body
token*stringvariantId*stringquantity?number1booking?OK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://api.devhelp.pk/storefront/v1/carts/string/lines' \ -H 'Content-Type: application/json' \ -d '{ "token": "string", "variantId": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}A quantity of zero removes the line.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringlineId*stringapplication/json- body
token*stringquantity*numberOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X PATCH 'https://api.devhelp.pk/storefront/v1/carts/string/lines/string' \ -H 'Content-Type: application/json' \ -d '{ "token": "string", "quantity": 0}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringlineId*stringapplication/json- body
token*stringOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X DELETE 'https://api.devhelp.pk/storefront/v1/carts/string/lines/string' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Adds the code to the cart, whether or not it applies: the cart's discountCodes says why one did not, so the shopper can be told.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringapplication/json- body
token*stringcode*stringOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X POST 'https://api.devhelp.pk/storefront/v1/carts/string/discount-codes' \ -H 'Content-Type: application/json' \ -d '{ "token": "string", "code": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringcode*stringapplication/json- body
token*stringOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timecurl -X DELETE 'https://api.devhelp.pk/storefront/v1/carts/string/discount-codes/string' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}Priced for this cart, so a rate whose free-delivery threshold the subtotal has already cleared is returned at zero. Empty when no address is set, or when the merchant covers no zone matching the destination. Pass country, province, or city to estimate delivery before the full address is known; nothing is saved on the cart.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringtoken*stringcountry?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"province?stringcity?stringOK
application/json- response
options*array<>curl -X GET 'https://api.devhelp.pk/storefront/v1/carts/string/shipping-options?token=string'{ "options": [ { "rateId": "string", "name": "string", "pricePaisa": 0, "free": true, "minDays": 0, "maxDays": 0, "customsNote": null, "totalPaisa": 0, "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true } } ]}Requires an Idempotency-Key header, so a retry after a dropped connection returns the same order rather than placing another. The cart needs a phone number and a delivery address. Returns the order with its token, which is how the buyer reads the order back; like the cart token it is stored hashed. A mismatched expectedTotalPaisa is a conflict: re-read the cart and show the new total.
publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
cartId*stringapplication/json- body
token*stringexpectedTotalPaisa?numbernote?stringpaymentMethod?string"cod""test""safepay""stripe""alfalah""in_person""venue"acceptTerms?booleanwhatsappUpdates?booleanOK
application/json- response
id*stringorderNumber*numberinvoiceNumber*number|nullstatus*string"pending""confirmed""cancelled"paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentStatus*string"pending""collected""cancelled""partially_collected""partially_refunded""refunded"fulfillmentStatus*string"unfulfilled""partially_fulfilled""fulfilled"source*string"storefront""admin""pos"fulfilmentMethod*string"ship""in_person"email*string|nullphone*stringshippingAddress*|nullbillingAddress*|nullshippingRateName*string|nullshippingMinDays*number|nullshippingMaxDays*number|nulllines*array<>discounts*array<>sales*array<>totals*note*string|nullshipments*array<>confirmedAt*|nullcancelledAt*|nullcreatedAt*stringdate-timeupdatedAt*stringdate-timepayment*bookingPolicy*|nulltoken*stringcheckoutPayment*|||||curl -X POST 'https://api.devhelp.pk/storefront/v1/carts/string/checkout' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "id": "string", "orderNumber": 0, "invoiceNumber": 0, "status": "pending", "paymentMethod": "cod", "paymentStatus": "pending", "fulfillmentStatus": "unfulfilled", "source": "storefront", "fulfilmentMethod": "ship", "email": "string", "phone": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "shippingRateName": "string", "shippingMinDays": 0, "shippingMaxDays": 0, "lines": [ { "id": "string", "variantId": "string", "productHandle": "string", "thumbnail": { "url": "string", "alt": "string" }, "productTitle": "string", "variantTitle": "string", "sku": "string", "unitPricePaisa": 0, "quantity": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "booking": { "id": "string", "kind": "appointment", "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffName": "string", "status": "held", "quantity": 0, "checkCode": "string", "changeUntil": "2019-08-24T14:15:22Z", "requestedStaffId": "string" }, "tax": { "rateBps": 0, "taxPaisa": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "note": "string", "shipments": [ { "id": "string", "trackingUrl": "string", "status": "packed", "courierName": "string", "trackingNumber": "string", "dispatchedAt": "2019-08-24T14:15:22Z", "deliveredAt": "2019-08-24T14:15:22Z", "lines": [ { "orderLineItemId": "string", "quantity": 0 } ] } ], "confirmedAt": "2019-08-24T14:15:22Z", "cancelledAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "payment": { "method": "cod", "state": "not_required", "testMode": true, "dueAt": "2019-08-24T14:15:22Z", "canRetry": true, "canSwitchToCod": true, "codTotalPaisa": 0, "depositPaisa": 0, "advance": { "dueAt": "2019-08-24T14:15:22Z", "received": true } }, "bookingPolicy": { "text": "string", "cancelWindowHours": 0, "canCancel": true, "canReschedule": true, "advanceInstructions": "string" }, "token": "string", "checkoutPayment": { "kind": "placed" }}publishableKeyx-api-key<token>Storefront publishable API key (dh_pk_live_…). Safe for browser requests from allowed origins. Also accepted as Authorization: Bearer.
application/json- body
token*stringOK
application/json- response
id*stringstatus*string"active""converted""abandoned""deleted"email*string|nullphone*string|nullname*string|nullshippingAddress*|nullbillingAddress*|nullrequiresShipping*booleanshippingRateId*string|nulllines*array<>discounts*array<>discountCodes*array<>sales*array<>totals*paymentMethod*string"cod""test""safepay""stripe""alfalah""in_person""venue"paymentMethods*array<>depositPaisa*numberadvanceInstructions*string|nullconsent*|nullexpiresAt*stringdate-timecreatedAt*stringdate-timeupdatedAt*stringdate-timetoken*stringcurl -X POST 'https://api.devhelp.pk/storefront/v1/carts/recover' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'{ "id": "string", "status": "active", "email": "string", "phone": "string", "name": "string", "shippingAddress": { "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "landmark": "string", "country": "AD", "recipientName": "string", "recipientPhone": "string" }, "billingAddress": { "name": "string", "line1": "string", "line2": "string", "city": "string", "province": "string", "postalCode": "string", "country": "AD" }, "requiresShipping": true, "shippingRateId": "string", "lines": [ { "id": "string", "variantId": "string", "productId": "string", "productSlug": "string", "title": "string", "variantTitle": "string", "imageUrl": "string", "quantity": 0, "unitPricePaisa": 0, "linePaisa": 0, "discountPaisa": 0, "sale": { "discountId": "string", "title": "string", "originalUnitPricePaisa": 0 }, "kind": "physical", "booking": { "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "staffId": "string", "staffName": "string", "visitKey": "string" }, "participantsNeeded": 0, "participants": [ { "name": "string", "age": 0 } ], "ages": { "min": 0, "max": 0 } } ], "discounts": [ { "discountId": "string", "code": "string", "title": "string", "type": "product", "valueType": "percentage", "value": 0, "amountPaisa": 0 } ], "discountCodes": [ { "code": "string", "applied": true, "reason": "not_found" } ], "sales": [ { "discountId": "string", "title": "string", "amountPaisa": 0 } ], "totals": { "currency": "PKR", "subtotalPaisa": 0, "shippingPaisa": 0, "discountPaisa": 0, "saleSavingsPaisa": 0, "shippingDiscountPaisa": 0, "codFeePaisa": 0, "taxPaisa": 0, "totalPaisa": 0, "taxRateBps": 0, "pricesIncludeTax": true }, "paymentMethod": "cod", "paymentMethods": [ { "id": "cod", "label": "string", "kind": "offline", "testMode": true, "feePaisa": 0, "unavailable": true, "unavailableReason": "string" } ], "depositPaisa": 0, "advanceInstructions": "string", "consent": { "text": "string", "accepted": true }, "expiresAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "token": "string"}