Skip to Content
devhelp shopDocs

Admin — Orders

Manage orders, COD confirmation, notes, holds, exchanges, refunds, and saved views.

GET
/admin/v1/order-views

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
items*array<>
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/order-views'
Example Response
{  "items": [    {      "id": "string",      "key": "all",      "name": "string",      "hidden": true,      "filters": {        "status": "pending",        "paymentStatus": "pending",        "attention": "to-confirm",        "sort": "newest",        "discountCode": "string",        "fulfillmentStatus": "unfulfilled",        "placed": "today",        "lastOutcome": "confirmed",        "parcelStatus": "packed",        "riskTier": "low",        "courierName": "string",        "city": "string",        "cancelReasonCode": "buyer_cancelled"      }    }  ]}
PUT
/admin/v1/order-views

The whole list, in order. Every default view must be present (hide it instead); a view the store made that is left out is removed.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
views*array<>

Response Body

OK

application/json
  1. response
items*array<>
Example Request
curl -X PUT 'https://api.devhelp.pk/admin/v1/order-views' \  -H 'Content-Type: application/json' \  -d '{  "views": [    {      "name": "string",      "filters": {}    }  ]}'
Example Response
{  "items": [    {      "id": "string",      "key": "all",      "name": "string",      "hidden": true,      "filters": {        "status": "pending",        "paymentStatus": "pending",        "attention": "to-confirm",        "sort": "newest",        "discountCode": "string",        "fulfillmentStatus": "unfulfilled",        "placed": "today",        "lastOutcome": "confirmed",        "parcelStatus": "packed",        "riskTier": "low",        "courierName": "string",        "city": "string",        "cancelReasonCode": "buyer_cancelled"      }    }  ]}

List orders

GET
/admin/v1/orders

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Query Parameters

limit?number
Default24
cursor?string
status?string
Value in"pending""confirmed""cancelled"
paymentStatus?string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
attention?string
Value in"to-confirm""on-hold""to-pack""with-courier""needs-attention""delivered""returned"
sort?string
Value in"newest""oldest"
discountCode?string
fulfillmentStatus?string
Value in"unfulfilled""partially_fulfilled""fulfilled"
placed?string
Value in"today""7d""30d"
lastOutcome?string
Value in"confirmed""no_answer""call_later""wrong_number""wants_changes""prepay_only""cancelled"
parcelStatus?string
Value in"packed""dispatched""delivered""returning""returned""cancelled""lost"
riskTier?string
Value in"low""check""high"
courierName?string
city?string
cancelReasonCode?string
Value in"buyer_cancelled""unreachable""fake_order""out_of_stock""pricing_error""other"
q?string
customerId?string
placedFrom?string
placedTo?string

Response Body

OK

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/orders'
Example Response
{  "items": [    {      "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",            "orderId": "string",            "lineId": "string",            "kind": "appointment",            "startsAt": "2019-08-24T14:15:22Z",            "endsAt": "2019-08-24T14:15:22Z",            "staffId": "string",            "staffName": "string",            "staffRequested": true,            "resourceIds": [              "string"            ],            "status": "held",            "quantity": 0,            "arrivedQuantity": 0,            "overbooked": true,            "checkCode": "string",            "version": 0,            "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",      "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"      },      "customerId": "string",      "risk": {        "orderCount": 0,        "deliveredCount": 0,        "rtoCount": 0,        "cancelledCount": 0,        "returnedCount": 0,        "rtoRate": 0      },      "collectedPaisa": 0,      "refundedPaisa": 0,      "fulfillments": [        {          "id": "string",          "deliveryServiceId": "string",          "trackingUrl": "string",          "status": "packed",          "courierName": "string",          "trackingNumber": "string",          "handoverId": "string",          "codAmountPaisa": 0,          "collectedPaisa": 0,          "note": "string",          "lines": [            {              "id": "string",              "orderLineItemId": "string",              "quantity": 0,              "restockedQuantity": 0,              "damagedQuantity": 0            }          ],          "packedAt": "2019-08-24T14:15:22Z",          "dispatchedAt": "2019-08-24T14:15:22Z",          "deliveredAt": "2019-08-24T14:15:22Z",          "rtoAt": "2019-08-24T14:15:22Z",          "receivedAt": "2019-08-24T14:15:22Z",          "cancelledAt": "2019-08-24T14:15:22Z",          "lostAt": "2019-08-24T14:15:22Z",          "replaced": true,          "attempts": [            {              "id": "string",              "number": 0,              "reason": "buyer_unavailable",              "note": "string",              "respondBy": "2019-08-24T14:15:22Z",              "instruction": "retry",              "instructedAt": "2019-08-24T14:15:22Z",              "retryPhone": "string",              "retryAddressLine": "string",              "retryLandmark": "string",              "disputed": true,              "disputeNote": "string",              "actorType": "customer",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "claims": [            {              "id": "string",              "kind": "lost",              "claimedPaisa": 0,              "claimBy": "2019-08-24T14:15:22Z",              "status": "open",              "paidPaisa": 0,              "note": "string",              "resolvedAt": "2019-08-24T14:15:22Z",              "createdAt": "2019-08-24T14:15:22Z"            }          ]        }      ],      "returns": [        {          "exchangeOrderId": "string",          "id": "string",          "reason": "string",          "refundPaisa": 0,          "note": "string",          "lines": [            {              "id": "string",              "orderLineItemId": "string",              "quantity": 0,              "restock": true            }          ],          "atRegister": {            "locationId": "string",            "registerId": "string",            "receiptNumber": "string",            "refunds": [              {                "kind": "cash",                "name": "string",                "amountPaisa": 0,                "reference": "string"              }            ],            "fiscal": {              "status": "pending",              "usin": "string",              "posId": "string",              "environment": "sandbox",              "fbrInvoiceNumber": "string"            }          },          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "cashRefunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "note": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "events": [        {          "id": "string",          "type": "placed",          "fromStatus": "pending",          "toStatus": "pending",          "actorType": "customer",          "actorId": "string",          "note": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "payments": [        {          "id": "string",          "provider": "cod",          "providerLabel": "string",          "mode": "test",          "providerRef": "string",          "status": "created",          "amountPaisa": 0,          "capturedPaisa": 0,          "refundedPaisa": 0,          "currency": "string",          "expiresAt": "2019-08-24T14:15:22Z",          "failureMessage": "string",          "cardBrand": "string",          "cardLast4": "string",          "refundRequired": true,          "refunds": [            {              "id": "string",              "amountPaisa": 0,              "reason": "string",              "status": "pending",              "failureMessage": "string",              "createdAt": "2019-08-24T14:15:22Z"            }          ],          "createdAt": "2019-08-24T14:15:22Z",          "updatedAt": "2019-08-24T14:15:22Z"        }      ],      "cancelReasonCode": "buyer_cancelled",      "exchangeOfOrderId": "string",      "confirmation": {        "hold": {          "reason": "advance_payment",          "note": "string",          "heldAt": "2019-08-24T14:15:22Z"        },        "contacts": [          {            "id": "string",            "channel": "call",            "outcome": "confirmed",            "note": "string",            "followUpAt": "2019-08-24T14:15:22Z",            "actorType": "customer",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "attempts": 0,        "unanswered": 0,        "lastOutcome": "confirmed",        "lastContactAt": "2019-08-24T14:15:22Z",        "followUpAt": "2019-08-24T14:15:22Z",        "risk": {          "tier": "low",          "reasons": [            {              "code": "past_rto",              "count": 0,              "rate": 0            }          ],          "network": {            "level": "caution",            "reason": "flagged_by_devhelp"          },          "deliveredHere": true,          "suggestedAdvancePaisa": 0        },        "report": {          "id": "string",          "reason": "fake_order",          "note": "string",          "reportedAt": "2019-08-24T14:15:22Z"        }      },      "inStore": {        "locationId": "string",        "locationName": "string",        "registerId": "string",        "registerName": "string",        "receiptNumber": "string",        "cashRoundingPaisa": 0,        "payments": [          {            "id": "string",            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "tenderedPaisa": 0,            "changePaisa": 0,            "reference": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      }    }  ],  "nextCursor": "string"}
POST
/admin/v1/orders

For orders taken by phone or WhatsApp. Goes through the same placement as storefront checkout: the customer is resolved, stock is reserved, and the order starts pending. Requires an Idempotency-Key header: a retry with the same key and body returns the original order instead of placing a second one.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
lines*array<>
customer*
shippingAddress?|
Defaultnull
billingAddress?|null
shippingRateId?string|null
note?string
discountCodes?array<string>
manualDiscount?
requestAdvance?boolean

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders' \  -H 'Content-Type: application/json' \  -d '{  "lines": [    {      "variantId": "string",      "quantity": 0    }  ],  "customer": {    "phone": "string"  }}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/quote

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Request Body

application/json
  1. body
lines*array<>
customer?
country?string
Default"PK"
Value in"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?string|null
city?string|null
shippingRateId?string|null
discountCodes?array<string>
manualDiscount?

Response Body

OK

application/json
  1. response
lines*array<>
discounts*array<>
discountCodes*array<>
sales*array<>
shippingOptions*array<>
shippingRateId*string|null
totals*
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/quote' \  -H 'Content-Type: application/json' \  -d '{  "lines": [    {      "variantId": "string",      "quantity": 0    }  ]}'
Example Response
{  "lines": [    {      "variantId": "string",      "quantity": 0,      "unitPricePaisa": 0,      "linePaisa": 0,      "discountPaisa": 0,      "sale": {        "discountId": "string",        "title": "string",        "originalUnitPricePaisa": 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    }  ],  "shippingOptions": [    {      "rateId": "string",      "name": "string",      "pricePaisa": 0,      "free": true,      "minDays": 0,      "maxDays": 0,      "customsNote": null    }  ],  "shippingRateId": "string",  "totals": {    "currency": "PKR",    "subtotalPaisa": 0,    "shippingPaisa": 0,    "discountPaisa": 0,    "saleSavingsPaisa": 0,    "shippingDiscountPaisa": 0,    "codFeePaisa": 0,    "taxPaisa": 0,    "totalPaisa": 0,    "taxRateBps": 0,    "pricesIncludeTax": true  }}
GET
/admin/v1/orders/counts

Exact counts for a dashboard, without paging through lists: orders waiting for confirmation, and confirmed orders with units still to send.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Response Body

OK

application/json
  1. response
pending*number
onHold*number
awaitingFulfilment*number
withCourier*number
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/orders/counts'
Example Response
{  "pending": 0,  "onHold": 0,  "awaitingFulfilment": 0,  "withCourier": 0}
GET
/admin/v1/orders/{id}

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X GET 'https://api.devhelp.pk/admin/v1/orders/string'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

Confirm a pending order

POST
/admin/v1/orders/{id}/confirm

Assigns the next gap-free invoice number. Stock stays reserved until fulfilment.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/confirm' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/buyer-message

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
kind*string
Value in"placed""confirm""dispatched""delivered""review"
fulfillmentId?string

Response Body

OK

application/json
  1. response
kind*string
Value in"placed""confirm""dispatched""delivered""review"
text*string
url*string
whatsappUrl*string
smsUrl*string
expiresAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/buyer-message' \  -H 'Content-Type: application/json' \  -d '{  "kind": "placed"}'
Example Response
{  "kind": "placed",  "text": "string",  "url": "string",  "whatsappUrl": "string",  "smsUrl": "string",  "expiresAt": "2019-08-24T14:15:22Z"}

Cancel an order

POST
/admin/v1/orders/{id}/cancel

Releases reserved stock. A confirmed order keeps its invoice number, so the invoice sequence has no gaps. An order whose cash was collected cannot be cancelled.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
reason*string
reasonCode?string
Value in"buyer_cancelled""unreachable""fake_order""out_of_stock""pricing_error""other"

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/cancel' \  -H 'Content-Type: application/json' \  -d '{  "reason": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/notes

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
note*string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/notes' \  -H 'Content-Type: application/json' \  -d '{  "note": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/contacts

Pending orders only. confirmed releases any hold and confirms the order; cancelled cancels it as cancelled by the buyer; prepay_only puts it on hold for an advance payment. Other outcomes are recorded and leave the order waiting, optionally with a time to try again.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
channel*string
Value in"call""whatsapp""sms"
outcome*string
Value in"confirmed""no_answer""call_later""wrong_number""wants_changes""prepay_only""cancelled"
note?string
followUpAt?string
Formatdate-time

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/contacts' \  -H 'Content-Type: application/json' \  -d '{  "channel": "call",  "outcome": "confirmed"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

Put an order on hold

POST
/admin/v1/orders/{id}/hold

Pending or confirmed orders. A held order cannot be confirmed, packed or dispatched until it is released; it can still be cancelled. Replaces an existing hold.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
reason*string
Value in"advance_payment""waiting_for_buyer""address_check""other"
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/hold' \  -H 'Content-Type: application/json' \  -d '{  "reason": "advance_payment"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

Release an order's hold

POST
/admin/v1/orders/{id}/release

Returns the order to the queue it was in.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/release' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/report

Within 90 days of the order, one live report per order. The report counts against the buyer at your store like a refused delivery, and (from the reason only, never the note) toward devhelp Protect's network signal. Sends order.reported.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
reason*string
Value in"fake_order""refused_no_reason""scam_or_abuse""return_abuse""wrong_details""other"
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/report' \  -H 'Content-Type: application/json' \  -d '{  "reason": "fake_order"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/report/withdraw

Owners and admins. Removes the report from the buyer's record and from the network on the next run. Sends order.report_withdrawn.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/report/withdraw'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/protect-mistake

For an order whose devhelp Protect line looks wrong; devhelp reviews it.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/protect-mistake' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
PATCH
/admin/v1/orders/{id}/delivery

Before confirmation only. Changes the order alone: its delivery fee and totals stay as placed, and the customer record is untouched. The change is recorded on the order's history with the previous details.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
phone*string
recipientName*string
recipientPhone*string
line1*string
line2*string|null
city*string
province?string
Default""
postalCode?string
Default""
country?string
Default"PK"
Value in"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"
landmark*string|null

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X PATCH 'https://api.devhelp.pk/admin/v1/orders/string/delivery' \  -H 'Content-Type: application/json' \  -d '{  "phone": "string",  "recipientName": "string",  "recipientPhone": "string",  "line1": "string",  "line2": "string",  "city": "string",  "landmark": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

Exchange delivered items

POST
/admin/v1/orders/{id}/exchanges

Records the returned units on this order (restocked or written off, with an optional refund) and places a linked replacement order through normal placement: stock is reserved and it gets its own number. A credit for the returned units' value is applied, so the buyer pays only the difference (delivery is free; a cash-on-delivery fee still applies). The replacement is confirmed at once. Requires an Idempotency-Key header.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
returned*array<>
replacements*array<>
reason*string
refundPaisa?number
Default0

Response Body

OK

application/json
  1. response
original*
exchange*
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/exchanges' \  -H 'Content-Type: application/json' \  -d '{  "returned": [    {      "orderLineItemId": "string",      "quantity": 0,      "restock": true    }  ],  "replacements": [    {      "variantId": "string",      "quantity": 0    }  ],  "reason": "string"}'
Example Response
{  "original": {    "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",          "orderId": "string",          "lineId": "string",          "kind": "appointment",          "startsAt": "2019-08-24T14:15:22Z",          "endsAt": "2019-08-24T14:15:22Z",          "staffId": "string",          "staffName": "string",          "staffRequested": true,          "resourceIds": [            "string"          ],          "status": "held",          "quantity": 0,          "arrivedQuantity": 0,          "overbooked": true,          "checkCode": "string",          "version": 0,          "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",    "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"    },    "customerId": "string",    "risk": {      "orderCount": 0,      "deliveredCount": 0,      "rtoCount": 0,      "cancelledCount": 0,      "returnedCount": 0,      "rtoRate": 0    },    "collectedPaisa": 0,    "refundedPaisa": 0,    "fulfillments": [      {        "id": "string",        "deliveryServiceId": "string",        "trackingUrl": "string",        "status": "packed",        "courierName": "string",        "trackingNumber": "string",        "handoverId": "string",        "codAmountPaisa": 0,        "collectedPaisa": 0,        "note": "string",        "lines": [          {            "id": "string",            "orderLineItemId": "string",            "quantity": 0,            "restockedQuantity": 0,            "damagedQuantity": 0          }        ],        "packedAt": "2019-08-24T14:15:22Z",        "dispatchedAt": "2019-08-24T14:15:22Z",        "deliveredAt": "2019-08-24T14:15:22Z",        "rtoAt": "2019-08-24T14:15:22Z",        "receivedAt": "2019-08-24T14:15:22Z",        "cancelledAt": "2019-08-24T14:15:22Z",        "lostAt": "2019-08-24T14:15:22Z",        "replaced": true,        "attempts": [          {            "id": "string",            "number": 0,            "reason": "buyer_unavailable",            "note": "string",            "respondBy": "2019-08-24T14:15:22Z",            "instruction": "retry",            "instructedAt": "2019-08-24T14:15:22Z",            "retryPhone": "string",            "retryAddressLine": "string",            "retryLandmark": "string",            "disputed": true,            "disputeNote": "string",            "actorType": "customer",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "claims": [          {            "id": "string",            "kind": "lost",            "claimedPaisa": 0,            "claimBy": "2019-08-24T14:15:22Z",            "status": "open",            "paidPaisa": 0,            "note": "string",            "resolvedAt": "2019-08-24T14:15:22Z",            "createdAt": "2019-08-24T14:15:22Z"          }        ]      }    ],    "returns": [      {        "exchangeOrderId": "string",        "id": "string",        "reason": "string",        "refundPaisa": 0,        "note": "string",        "lines": [          {            "id": "string",            "orderLineItemId": "string",            "quantity": 0,            "restock": true          }        ],        "atRegister": {          "locationId": "string",          "registerId": "string",          "receiptNumber": "string",          "refunds": [            {              "kind": "cash",              "name": "string",              "amountPaisa": 0,              "reference": "string"            }          ],          "fiscal": {            "status": "pending",            "usin": "string",            "posId": "string",            "environment": "sandbox",            "fbrInvoiceNumber": "string"          }        },        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "cashRefunds": [      {        "id": "string",        "amountPaisa": 0,        "reason": "string",        "note": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "events": [      {        "id": "string",        "type": "placed",        "fromStatus": "pending",        "toStatus": "pending",        "actorType": "customer",        "actorId": "string",        "note": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "payments": [      {        "id": "string",        "provider": "cod",        "providerLabel": "string",        "mode": "test",        "providerRef": "string",        "status": "created",        "amountPaisa": 0,        "capturedPaisa": 0,        "refundedPaisa": 0,        "currency": "string",        "expiresAt": "2019-08-24T14:15:22Z",        "failureMessage": "string",        "cardBrand": "string",        "cardLast4": "string",        "refundRequired": true,        "refunds": [          {            "id": "string",            "amountPaisa": 0,            "reason": "string",            "status": "pending",            "failureMessage": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ],    "cancelReasonCode": "buyer_cancelled",    "exchangeOfOrderId": "string",    "confirmation": {      "hold": {        "reason": "advance_payment",        "note": "string",        "heldAt": "2019-08-24T14:15:22Z"      },      "contacts": [        {          "id": "string",          "channel": "call",          "outcome": "confirmed",          "note": "string",          "followUpAt": "2019-08-24T14:15:22Z",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "attempts": 0,      "unanswered": 0,      "lastOutcome": "confirmed",      "lastContactAt": "2019-08-24T14:15:22Z",      "followUpAt": "2019-08-24T14:15:22Z",      "risk": {        "tier": "low",        "reasons": [          {            "code": "past_rto",            "count": 0,            "rate": 0          }        ],        "network": {          "level": "caution",          "reason": "flagged_by_devhelp"        },        "deliveredHere": true,        "suggestedAdvancePaisa": 0      },      "report": {        "id": "string",        "reason": "fake_order",        "note": "string",        "reportedAt": "2019-08-24T14:15:22Z"      }    },    "inStore": {      "locationId": "string",      "locationName": "string",      "registerId": "string",      "registerName": "string",      "receiptNumber": "string",      "cashRoundingPaisa": 0,      "payments": [        {          "id": "string",          "kind": "cash",          "name": "string",          "amountPaisa": 0,          "tenderedPaisa": 0,          "changePaisa": 0,          "reference": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "fiscal": {        "status": "pending",        "usin": "string",        "posId": "string",        "environment": "sandbox",        "fbrInvoiceNumber": "string"      }    }  },  "exchange": {    "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",          "orderId": "string",          "lineId": "string",          "kind": "appointment",          "startsAt": "2019-08-24T14:15:22Z",          "endsAt": "2019-08-24T14:15:22Z",          "staffId": "string",          "staffName": "string",          "staffRequested": true,          "resourceIds": [            "string"          ],          "status": "held",          "quantity": 0,          "arrivedQuantity": 0,          "overbooked": true,          "checkCode": "string",          "version": 0,          "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",    "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"    },    "customerId": "string",    "risk": {      "orderCount": 0,      "deliveredCount": 0,      "rtoCount": 0,      "cancelledCount": 0,      "returnedCount": 0,      "rtoRate": 0    },    "collectedPaisa": 0,    "refundedPaisa": 0,    "fulfillments": [      {        "id": "string",        "deliveryServiceId": "string",        "trackingUrl": "string",        "status": "packed",        "courierName": "string",        "trackingNumber": "string",        "handoverId": "string",        "codAmountPaisa": 0,        "collectedPaisa": 0,        "note": "string",        "lines": [          {            "id": "string",            "orderLineItemId": "string",            "quantity": 0,            "restockedQuantity": 0,            "damagedQuantity": 0          }        ],        "packedAt": "2019-08-24T14:15:22Z",        "dispatchedAt": "2019-08-24T14:15:22Z",        "deliveredAt": "2019-08-24T14:15:22Z",        "rtoAt": "2019-08-24T14:15:22Z",        "receivedAt": "2019-08-24T14:15:22Z",        "cancelledAt": "2019-08-24T14:15:22Z",        "lostAt": "2019-08-24T14:15:22Z",        "replaced": true,        "attempts": [          {            "id": "string",            "number": 0,            "reason": "buyer_unavailable",            "note": "string",            "respondBy": "2019-08-24T14:15:22Z",            "instruction": "retry",            "instructedAt": "2019-08-24T14:15:22Z",            "retryPhone": "string",            "retryAddressLine": "string",            "retryLandmark": "string",            "disputed": true,            "disputeNote": "string",            "actorType": "customer",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "claims": [          {            "id": "string",            "kind": "lost",            "claimedPaisa": 0,            "claimBy": "2019-08-24T14:15:22Z",            "status": "open",            "paidPaisa": 0,            "note": "string",            "resolvedAt": "2019-08-24T14:15:22Z",            "createdAt": "2019-08-24T14:15:22Z"          }        ]      }    ],    "returns": [      {        "exchangeOrderId": "string",        "id": "string",        "reason": "string",        "refundPaisa": 0,        "note": "string",        "lines": [          {            "id": "string",            "orderLineItemId": "string",            "quantity": 0,            "restock": true          }        ],        "atRegister": {          "locationId": "string",          "registerId": "string",          "receiptNumber": "string",          "refunds": [            {              "kind": "cash",              "name": "string",              "amountPaisa": 0,              "reference": "string"            }          ],          "fiscal": {            "status": "pending",            "usin": "string",            "posId": "string",            "environment": "sandbox",            "fbrInvoiceNumber": "string"          }        },        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "cashRefunds": [      {        "id": "string",        "amountPaisa": 0,        "reason": "string",        "note": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "events": [      {        "id": "string",        "type": "placed",        "fromStatus": "pending",        "toStatus": "pending",        "actorType": "customer",        "actorId": "string",        "note": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "payments": [      {        "id": "string",        "provider": "cod",        "providerLabel": "string",        "mode": "test",        "providerRef": "string",        "status": "created",        "amountPaisa": 0,        "capturedPaisa": 0,        "refundedPaisa": 0,        "currency": "string",        "expiresAt": "2019-08-24T14:15:22Z",        "failureMessage": "string",        "cardBrand": "string",        "cardLast4": "string",        "refundRequired": true,        "refunds": [          {            "id": "string",            "amountPaisa": 0,            "reason": "string",            "status": "pending",            "failureMessage": "string",            "createdAt": "2019-08-24T14:15:22Z"          }        ],        "createdAt": "2019-08-24T14:15:22Z",        "updatedAt": "2019-08-24T14:15:22Z"      }    ],    "cancelReasonCode": "buyer_cancelled",    "exchangeOfOrderId": "string",    "confirmation": {      "hold": {        "reason": "advance_payment",        "note": "string",        "heldAt": "2019-08-24T14:15:22Z"      },      "contacts": [        {          "id": "string",          "channel": "call",          "outcome": "confirmed",          "note": "string",          "followUpAt": "2019-08-24T14:15:22Z",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "attempts": 0,      "unanswered": 0,      "lastOutcome": "confirmed",      "lastContactAt": "2019-08-24T14:15:22Z",      "followUpAt": "2019-08-24T14:15:22Z",      "risk": {        "tier": "low",        "reasons": [          {            "code": "past_rto",            "count": 0,            "rate": 0          }        ],        "network": {          "level": "caution",          "reason": "flagged_by_devhelp"        },        "deliveredHere": true,        "suggestedAdvancePaisa": 0      },      "report": {        "id": "string",        "reason": "fake_order",        "note": "string",        "reportedAt": "2019-08-24T14:15:22Z"      }    },    "inStore": {      "locationId": "string",      "locationName": "string",      "registerId": "string",      "registerName": "string",      "receiptNumber": "string",      "cashRoundingPaisa": 0,      "payments": [        {          "id": "string",          "kind": "cash",          "name": "string",          "amountPaisa": 0,          "tenderedPaisa": 0,          "changePaisa": 0,          "reference": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "fiscal": {        "status": "pending",        "usin": "string",        "posId": "string",        "environment": "sandbox",        "fbrInvoiceNumber": "string"      }    }  }}
POST
/admin/v1/orders/{id}/refunds

Requires an Idempotency-Key header. Refunds the order's captured online payment, fully or partly, through the provider that took it. Cash-on-delivery orders are refunded by recording a return or a cash refund instead. A provider that cannot refund is a conflict.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
attemptId?string
amountPaisa*number
reason*string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/refunds' \  -H 'Content-Type: application/json' \  -d '{  "amountPaisa": 0,  "reason": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/cash-refunds

Cash-on-delivery orders only. The amount may not exceed the cash collected less earlier refunds. Records the refund on the order's history and sends refund.created. Requires an Idempotency-Key header.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
amountPaisa*number
reason*string
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/cash-refunds' \  -H 'Content-Type: application/json' \  -d '{  "amountPaisa": 0,  "reason": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

Pack a parcel

POST
/admin/v1/orders/{id}/fulfillments

Allocates quantities of the order's lines to a new parcel. The order must be confirmed, and no line may be allocated beyond what was ordered. Stock stays reserved until dispatch. Requires an Idempotency-Key header.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
lines*array<>
deliveryServiceId?string|null
trackingUrl?string|null
courierName?string
trackingNumber?string
codAmountPaisa?number
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/fulfillments' \  -H 'Content-Type: application/json' \  -d '{  "lines": [    {      "orderLineItemId": "string",      "quantity": 0    }  ]}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}
POST
/admin/v1/orders/{id}/returns

No more of a line may be returned than was delivered, and the refund may not exceed the cash collected less earlier refunds. Requires an Idempotency-Key header.

Authorization

secretKey
headerx-api-key<token>

Admin secret API key (dh_sk_live_…). Keep server-side only; never expose in browser code. Also accepted as Authorization: Bearer.

Path Parameters

id*string

Request Body

application/json
  1. body
lines*array<>
refundPaisa*number
reason*string
note?string

Response Body

OK

application/json
  1. response
id*string
orderNumber*number
invoiceNumber*number|null
status*string
Value in"pending""confirmed""cancelled"
paymentMethod*string
Value in"cod""test""safepay""stripe""alfalah""in_person""venue"
paymentStatus*string
Value in"pending""collected""cancelled""partially_collected""partially_refunded""refunded"
fulfillmentStatus*string
Value in"unfulfilled""partially_fulfilled""fulfilled"
source*string
Value in"storefront""admin""pos"
fulfilmentMethod*string
Value in"ship""in_person"
email*string|null
phone*string|null
shippingAddress*|null
billingAddress*|null
shippingRateName*string|null
shippingMinDays*number|null
shippingMaxDays*number|null
lines*array<>
discounts*array<>
sales*array<>
totals*
note*string|null
confirmedAt*|null
cancelledAt*|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
payment*
bookingPolicy*|null
customerId*string|null
risk*|null
collectedPaisa*number
refundedPaisa*number
fulfillments*array<>
returns*array<>
cashRefunds*array<>
events*array<>
payments*array<>
cancelReasonCode*|null
exchangeOfOrderId*string|null
confirmation*
inStore*|null
Example Request
curl -X POST 'https://api.devhelp.pk/admin/v1/orders/string/returns' \  -H 'Content-Type: application/json' \  -d '{  "lines": [    {      "orderLineItemId": "string",      "quantity": 0,      "restock": true    }  ],  "refundPaisa": 0,  "reason": "string"}'
Example Response
{  "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",        "orderId": "string",        "lineId": "string",        "kind": "appointment",        "startsAt": "2019-08-24T14:15:22Z",        "endsAt": "2019-08-24T14:15:22Z",        "staffId": "string",        "staffName": "string",        "staffRequested": true,        "resourceIds": [          "string"        ],        "status": "held",        "quantity": 0,        "arrivedQuantity": 0,        "overbooked": true,        "checkCode": "string",        "version": 0,        "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",  "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"  },  "customerId": "string",  "risk": {    "orderCount": 0,    "deliveredCount": 0,    "rtoCount": 0,    "cancelledCount": 0,    "returnedCount": 0,    "rtoRate": 0  },  "collectedPaisa": 0,  "refundedPaisa": 0,  "fulfillments": [    {      "id": "string",      "deliveryServiceId": "string",      "trackingUrl": "string",      "status": "packed",      "courierName": "string",      "trackingNumber": "string",      "handoverId": "string",      "codAmountPaisa": 0,      "collectedPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restockedQuantity": 0,          "damagedQuantity": 0        }      ],      "packedAt": "2019-08-24T14:15:22Z",      "dispatchedAt": "2019-08-24T14:15:22Z",      "deliveredAt": "2019-08-24T14:15:22Z",      "rtoAt": "2019-08-24T14:15:22Z",      "receivedAt": "2019-08-24T14:15:22Z",      "cancelledAt": "2019-08-24T14:15:22Z",      "lostAt": "2019-08-24T14:15:22Z",      "replaced": true,      "attempts": [        {          "id": "string",          "number": 0,          "reason": "buyer_unavailable",          "note": "string",          "respondBy": "2019-08-24T14:15:22Z",          "instruction": "retry",          "instructedAt": "2019-08-24T14:15:22Z",          "retryPhone": "string",          "retryAddressLine": "string",          "retryLandmark": "string",          "disputed": true,          "disputeNote": "string",          "actorType": "customer",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "claims": [        {          "id": "string",          "kind": "lost",          "claimedPaisa": 0,          "claimBy": "2019-08-24T14:15:22Z",          "status": "open",          "paidPaisa": 0,          "note": "string",          "resolvedAt": "2019-08-24T14:15:22Z",          "createdAt": "2019-08-24T14:15:22Z"        }      ]    }  ],  "returns": [    {      "exchangeOrderId": "string",      "id": "string",      "reason": "string",      "refundPaisa": 0,      "note": "string",      "lines": [        {          "id": "string",          "orderLineItemId": "string",          "quantity": 0,          "restock": true        }      ],      "atRegister": {        "locationId": "string",        "registerId": "string",        "receiptNumber": "string",        "refunds": [          {            "kind": "cash",            "name": "string",            "amountPaisa": 0,            "reference": "string"          }        ],        "fiscal": {          "status": "pending",          "usin": "string",          "posId": "string",          "environment": "sandbox",          "fbrInvoiceNumber": "string"        }      },      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "cashRefunds": [    {      "id": "string",      "amountPaisa": 0,      "reason": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "events": [    {      "id": "string",      "type": "placed",      "fromStatus": "pending",      "toStatus": "pending",      "actorType": "customer",      "actorId": "string",      "note": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  ],  "payments": [    {      "id": "string",      "provider": "cod",      "providerLabel": "string",      "mode": "test",      "providerRef": "string",      "status": "created",      "amountPaisa": 0,      "capturedPaisa": 0,      "refundedPaisa": 0,      "currency": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "failureMessage": "string",      "cardBrand": "string",      "cardLast4": "string",      "refundRequired": true,      "refunds": [        {          "id": "string",          "amountPaisa": 0,          "reason": "string",          "status": "pending",          "failureMessage": "string",          "createdAt": "2019-08-24T14:15:22Z"        }      ],      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z"    }  ],  "cancelReasonCode": "buyer_cancelled",  "exchangeOfOrderId": "string",  "confirmation": {    "hold": {      "reason": "advance_payment",      "note": "string",      "heldAt": "2019-08-24T14:15:22Z"    },    "contacts": [      {        "id": "string",        "channel": "call",        "outcome": "confirmed",        "note": "string",        "followUpAt": "2019-08-24T14:15:22Z",        "actorType": "customer",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "attempts": 0,    "unanswered": 0,    "lastOutcome": "confirmed",    "lastContactAt": "2019-08-24T14:15:22Z",    "followUpAt": "2019-08-24T14:15:22Z",    "risk": {      "tier": "low",      "reasons": [        {          "code": "past_rto",          "count": 0,          "rate": 0        }      ],      "network": {        "level": "caution",        "reason": "flagged_by_devhelp"      },      "deliveredHere": true,      "suggestedAdvancePaisa": 0    },    "report": {      "id": "string",      "reason": "fake_order",      "note": "string",      "reportedAt": "2019-08-24T14:15:22Z"    }  },  "inStore": {    "locationId": "string",    "locationName": "string",    "registerId": "string",    "registerName": "string",    "receiptNumber": "string",    "cashRoundingPaisa": 0,    "payments": [      {        "id": "string",        "kind": "cash",        "name": "string",        "amountPaisa": 0,        "tenderedPaisa": 0,        "changePaisa": 0,        "reference": "string",        "createdAt": "2019-08-24T14:15:22Z"      }    ],    "fiscal": {      "status": "pending",      "usin": "string",      "posId": "string",      "environment": "sandbox",      "fbrInvoiceNumber": "string"    }  }}

On this page