الطلبات
8 عمليات
GET/orders#
List orders
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
cursorquery | string | |
limitquery | integer | الافتراضي: 50 |
statusquery | OrderStatus | Order lifecycle state. Transitions follow the server matrix; money-bearing states are reachable only through refunds. القيم: placedapprovedprocessingshippeddelivereddelivered_failedreturnedcancelledcompletedpartially_refundedrefunded |
created_at_minquery | string | |
updated_at_minquery | string | Incremental sync for status/payment changes (cursor stays keyed on created_at) |
tagquery | string | Only orders carrying this tag (case-insensitive) |
الاستجابات
200Cursor page of PII-free orders
| الاسم | النوع | الوصف |
|---|---|---|
dataمطلوب | Order[] | |
next_cursorمطلوبيقبل null | string | Pass back as |
401Missing, invalid, expired, or revoked token
403Required live scope is missing
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X GET "https://dukkan.one/platform-api/v1/orders?limit=50" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN"{
"data": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"order_number": "1042",
"status": "placed",
"payment_status": "not_required",
"source": "online",
"line_pricing": "net",
"subtotal": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"discount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"shipping": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"tax": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"paid": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"refunded": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"exchange_rate": {
"scaled": 1300000,
"scale": 4
},
"tags": [
"string"
],
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z"
}
],
"next_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNi0wOC0xOFQxNjowMDowMFoifQ"
}POST/orders#
Create an order with the prices the merchant agreed
Lines carry the agreed unit price (catalog variants or custom lines with no variant); totals are recomputed server-side (subtotal = Σ quantity × unit_price_minor, total = subtotal − discount + shipping, tax 0) and every side effect of a storefront order follows: stock decrement obeying policy (409 insufficient_stock with details.lines[] and nothing written), CRM link by phone, merchant push and email, order.created with source: app, and a timeline row naming the app. Specific codes: 422 currency_not_allowed, 404 variant_not_found, 409 variant_unavailable, 409 payment_method_disabled. The response echoes the customer details the app supplied regardless of clients:read.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Create an order with app-set prices. Totals are recomputed server-side: subtotal = Σ quantity × unit_price_minor, total = subtotal − discount + shipping, tax 0.
| الاسم | النوع | الوصف |
|---|---|---|
currencyمطلوب | string | One of the store's allowed storefront currencies; otherwise 422 |
status | string |
القيم: placedapprovedالافتراضي: "placed" |
itemsمطلوب | CreateOrderItem[] | |
discountيقبل null | object | Order-level discount; must not exceed the sum of the lines. الافتراضي: null |
amount_minorمطلوب | integer | |
titleيقبل null | string | الافتراضي: null |
shippingمطلوب | object | |
amount_minorمطلوب | integer | |
methodمطلوب | string | القيم: deliverypickup |
customerمطلوب | object | |
nameمطلوب | string | |
phoneمطلوب | string | Full international number with country code; stored normalised. |
emailيقبل null | string | Optional. Never invented when absent. الافتراضي: null |
shipping_addressيقبل null | object | Required when shipping.method is الافتراضي: null |
addressمطلوب | string | |
provinceمطلوب | string | Syrian province value, e.g. |
cityيقبل null | string | الافتراضي: null |
notesيقبل null | string | الافتراضي: null |
payment_methodمطلوب | string | Must be enabled in the store; otherwise 409 القيم: codshamcash_manual |
exchange_rateيقبل null | object | Required when currency differs from the store's pricing currency, forbidden otherwise. rate = scaled / 10^scale, oriented 1 pricing-currency unit = rate order-currency units (same as GET /store الافتراضي: null |
scaledمطلوب | integer | |
scaleمطلوب | integer | |
noteيقبل null | string | الافتراضي: null |
tags | string[] | At most 10 tags after case-insensitive dedupe. |
attributes | OrderAttributes | Up to 20 keys ( الافتراضي: {} |
inventory | string | القيم: decrementskipالافتراضي: "decrement" |
الاستجابات
201Order created (or the recorded response on an idempotent replay)
| الاسم | النوع | الوصف |
|---|---|---|
dataمطلوب | OrderDetail | Order with its immutable line snapshots and reconciliation collections. |
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
422Well-formed body that fails the contract;
details.fields[]names the paths429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X POST "https://dukkan.one/platform-api/v1/orders" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"currency": "SYP",
"status": "placed",
"items": [
{
"variant_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"name": "Olive oil 1 L",
"quantity": 2,
"unit_price_minor": 1
}
],
"discount": {
"amount_minor": 275000,
"title": null
},
"shipping": {
"amount_minor": 275000,
"method": "delivery"
},
"customer": {
"name": "Olive oil 1 L",
"phone": "string",
"email": null
},
"shipping_address": {
"address": "string",
"province": "string",
"city": null,
"notes": null
},
"payment_method": "cod",
"exchange_rate": {
"scaled": 1300000,
"scale": 4
},
"note": null,
"tags": [
"string"
],
"attributes": {},
"inventory": "decrement"
}'{
"data": {
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"order_number": "1042",
"status": "placed",
"payment_status": "not_required",
"source": "online",
"line_pricing": "net",
"subtotal": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"discount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"shipping": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"tax": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"paid": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"refunded": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"exchange_rate": {
"scaled": 1300000,
"scale": 4
},
"tags": [
"string"
],
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"items": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"variant_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"kind": "variant",
"name": "Olive oil 1 L",
"quantity": 2,
"unit_price": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
}
}
],
"fulfillments": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"provider": "Aramex",
"tracking_number": "RX123456789SY",
"status": "pending",
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2
}
]
}
],
"refunds": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"amount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"reason": "correction",
"created_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2,
"amount_minor": 275000
}
]
}
],
"note": "Stock count 2026-08-18",
"attributes": {},
"customer": {
"first_name": "string",
"last_name": "string",
"email": "string",
"phone": "string"
},
"shipping_address": {}
}
}GET/orders/{id}#
Get an order and immutable line snapshots
customer and shipping_address are present ONLY when the install holds the DPA-gated clients:read scope; without it the keys are absent, not null.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string |
الاستجابات
200Order detail
| الاسم | النوع | الوصف |
|---|---|---|
dataمطلوب | OrderDetail | Order with its immutable line snapshots and reconciliation collections. |
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X GET "https://dukkan.one/platform-api/v1/orders/ORDER_ID" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN"{
"data": {
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"order_number": "1042",
"status": "placed",
"payment_status": "not_required",
"source": "online",
"line_pricing": "net",
"subtotal": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"discount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"shipping": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"tax": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"paid": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"refunded": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"exchange_rate": {
"scaled": 1300000,
"scale": 4
},
"tags": [
"string"
],
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"items": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"variant_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"kind": "variant",
"name": "Olive oil 1 L",
"quantity": 2,
"unit_price": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
}
}
],
"fulfillments": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"provider": "Aramex",
"tracking_number": "RX123456789SY",
"status": "pending",
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2
}
]
}
],
"refunds": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"amount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"reason": "correction",
"created_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2,
"amount_minor": 275000
}
]
}
],
"note": "Stock count 2026-08-18",
"attributes": {},
"customer": {
"first_name": "string",
"last_name": "string",
"email": "string",
"phone": "string"
},
"shipping_address": {}
}
}PATCH/orders/{id}#
Update the note, add or remove tags, or merge the app's own attributes
Money, lines, customer and address are immutable after creation. Tags are set operations (add/remove) so the merchant's and other apps' tags survive. attributes is the calling app's private namespace; null deletes a key; reference.url must be https on the app's registered origin.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string | |
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Update the note, add/remove tags, or merge the app's own attributes. Money, lines, customer and address are immutable after creation.
| الاسم | النوع | الوصف |
|---|---|---|
noteيقبل null | string | Replace the order note; null clears it. |
tags | object | Set operations, never a replace: the merchant's and other apps' tags survive. |
add | string[] | At most 10 tags after case-insensitive dedupe. |
remove | string[] | Removed case-insensitively. |
attributes | OrderAttributesPatch | Merged into the app's namespace; a |
الاستجابات
200The updated order
| الاسم | النوع | الوصف |
|---|---|---|
dataمطلوب | OrderDetail | Order with its immutable line snapshots and reconciliation collections. |
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
422Well-formed body that fails the contract;
details.fields[]names the paths429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X PATCH "https://dukkan.one/platform-api/v1/orders/ORDER_ID" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"note": "Stock count 2026-08-18",
"tags": {
"add": [
"string"
],
"remove": [
"string"
]
},
"attributes": {}
}'{
"data": {
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"order_number": "1042",
"status": "placed",
"payment_status": "not_required",
"source": "online",
"line_pricing": "net",
"subtotal": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"discount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"shipping": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"tax": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"paid": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"refunded": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"exchange_rate": {
"scaled": 1300000,
"scale": 4
},
"tags": [
"string"
],
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"items": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"variant_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"kind": "variant",
"name": "Olive oil 1 L",
"quantity": 2,
"unit_price": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"total": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
}
}
],
"fulfillments": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"provider": "Aramex",
"tracking_number": "RX123456789SY",
"status": "pending",
"created_at": "2026-08-18T16:00:00Z",
"updated_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2
}
]
}
],
"refunds": [
{
"id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"amount": {
"amount_minor": 275000,
"currency": "SYP",
"decimals": 0
},
"reason": "correction",
"created_at": "2026-08-18T16:00:00Z",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2,
"amount_minor": 275000
}
]
}
],
"note": "Stock count 2026-08-18",
"attributes": {},
"customer": {
"first_name": "string",
"last_name": "string",
"email": "string",
"phone": "string"
},
"shipping_address": {}
}
}PATCH/orders/{id}/status#
Transition order status through the server matrix
Money-bearing statuses (completed, partially_refunded, refunded) are reachable only through the refund writers. A transition the matrix does not allow answers 409 with current_status in the details.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string | |
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Transition an order through the server matrix.
| الاسم | النوع | الوصف |
|---|---|---|
statusمطلوب | SettableOrderStatus | Statuses an app may set through PATCH /orders/{id}/status. Money-bearing statuses are reachable only through refunds. القيم: placedapprovedprocessingshippeddelivereddelivered_failedreturnedcancelled |
الاستجابات
200Status transitioned
لا جسم للاستجابة.
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X PATCH "https://dukkan.one/platform-api/v1/orders/ORDER_ID/status" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"status": "placed"
}'{
"error": {
"code": "invalid_request",
"message": "A human-readable explanation",
"request_id": "req_01J8Z1K5X9",
"details": {}
}
}POST/orders/{id}/fulfillments#
Fulfill selected line quantities; ship the order once every line is fulfilled
Quantities above the still-unfulfilled amount of a line answer 409. Emits fulfillment.created, plus fulfillment.requested when the fulfillment is created as pending (a pickup waiting to be booked).
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string | |
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Fulfill selected line quantities. Each order item may appear once.
| الاسم | النوع | الوصف |
|---|---|---|
providerيقبل null | string | |
tracking_numberيقبل null | string | |
status | string | "pending" reserves the quantities without auto-shipping the order (carrier booked, pickup not yet made); move to "shipped" via PATCH when the parcel leaves. القيم: pendingshippedالافتراضي: "shipped" |
linesمطلوب | object[] | |
order_item_idمطلوب | string | |
quantityمطلوب | integer |
الاستجابات
201Fulfillment created; the order auto-ships only when every line is fulfilled AND the fulfillment was created as "shipped"
لا جسم للاستجابة.
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X POST "https://dukkan.one/platform-api/v1/orders/ORDER_ID/fulfillments" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"provider": "Aramex",
"tracking_number": "RX123456789SY",
"status": "shipped",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2
}
]
}'{
"error": {
"code": "invalid_request",
"message": "A human-readable explanation",
"request_id": "req_01J8Z1K5X9",
"details": {}
}
}PATCH/orders/{id}/fulfillments/{fulfillmentId}#
Update tracking, mark delivered, or cancel a fulfillment
Identity and lines are immutable. Legal transitions are pending → shipped → delivered and pending|shipped → cancelled. Cancelling releases the quantity the fulfillment consumed, so the line can be fulfilled again. Terminal (delivered/cancelled) fulfillments reject further edits with 409.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string | |
fulfillmentIdpathمطلوب | string | |
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Update tracking, mark delivered, cancel, or propose a COD remittance. At least one field is required.
| الاسم | النوع | الوصف |
|---|---|---|
tracking_numberيقبل null | string | |
status | string | القيم: shippeddeliveredcancelled |
cod_collected_minor | integer | COD remittance PROPOSAL: the cash the courier reports collecting (minor units; may be less than the order total). Moves no money. The merchant confirms in admin, and that confirmation writes the cod_collection ledger row which updates payment status and fires order.paid. One open proposal per order; re-sending updates it. |
cod_collected_note | string |
الاستجابات
200Fulfillment updated. When the last outstanding fulfillment is delivered and every line is covered, the order transitions to "delivered" (order_status: "delivered" in the response); order_status_skipped is true when that transition was refused by the order's current state. COD payment status is untouched — order.paid rides the payments ledger.
لا جسم للاستجابة.
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X PATCH "https://dukkan.one/platform-api/v1/orders/ORDER_ID/fulfillments/FULFILLMENT_ID" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"tracking_number": "RX123456789SY",
"status": "shipped",
"cod_collected_minor": 275000,
"cod_collected_note": "string"
}'{
"error": {
"code": "invalid_request",
"message": "A human-readable explanation",
"request_id": "req_01J8Z1K5X9",
"details": {}
}
}POST/orders/{id}/refunds#
Append a refund against captured funds
amount_minor may not exceed paid minus already refunded. POS orders are refunded at the point of sale and answer 409 here. restock additionally requires the inventory:write scope.
المعاملات
| الاسم | النوع | الوصف |
|---|---|---|
idpathمطلوب | string | |
Idempotency-Keyheaderمطلوب | string | Unique per logical write, at most 200 characters, remembered for 24 hours. Replaying the same key with the same body returns the recorded response; the same key with a different body answers 409. |
جسم الطلب مطلوب
Append a refund against captured funds.
| الاسم | النوع | الوصف |
|---|---|---|
amount_minorمطلوب | integer | |
currency | string | Optional confirmation guard; 409 when it differs from the order's currency. |
reasonيقبل null | string | |
lines | object[] | Optional line breakdown; amounts must sum to amount_minor. |
order_item_idمطلوب | string | |
quantityمطلوب | integer | |
amount_minorمطلوب | integer | |
restock | object | Return the refunded quantities to stock. Requires |
location_idمطلوب | string |
الاستجابات
201Refund created. Refundability is gated on remaining captured funds, not order status; when the status matrix has no refund edge (e.g. a terminal cancelled) the money still moves and order_status_skipped reports that the status was left untouched.
لا جسم للاستجابة.
400Invalid request
401Missing, invalid, expired, or revoked token
403Required live scope is missing
404Resource not found in the token-bound store
409State transition, inventory, refund, or idempotency conflict
429Token budget exhausted (180 requests/minute, 60 writes/minute per install)
curl -X POST "https://dukkan.one/platform-api/v1/orders/ORDER_ID/refunds" \
-H "Authorization: Bearer $DUKKAN_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount_minor": 275000,
"currency": "SYP",
"reason": "correction",
"lines": [
{
"order_item_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b",
"quantity": 2,
"amount_minor": 275000
}
],
"restock": {
"location_id": "6f1d2c3b-4a59-4e8f-9b70-2d1c3e4f5a6b"
}
}'{
"error": {
"code": "invalid_request",
"message": "A human-readable explanation",
"request_id": "req_01J8Z1K5X9",
"details": {}
}
}