{"openapi":"3.1.0","info":{"title":"Fatrina REST API","version":"1.0.0","description":"Bearer keys select the store. Money is integer minor units. Read /developers for guides and webhook verification."},"servers":[{"url":"https://app.fatrina.store/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/orders":{"get":{"operationId":"api.v1.orders.index","summary":"Orders Index","x-required-scope":"orders:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"status","in":"query","schema":{"type":"string","enum":["open","closed","cancelled"]}},{"name":"financial_status","in":"query","schema":{"type":"string","enum":["pending","authorized","paid","partially_refunded","refunded","voided"]}},{"name":"fulfillment_status","in":"query","schema":{"type":"string","enum":["unfulfilled","partial","fulfilled"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":812,"number":1042,"status":"open","financial_status":"pending","fulfillment_status":"unfulfilled","confirmation_status":"confirmed","source":"web","payment_method":"cod","currency":"EGP","subtotal":39900,"discount_total":0,"shipping_total":5000,"tax_total":0,"payment_fee_total":0,"gift_wrap_total":0,"total":44900,"customer_id":77,"contact_email":null,"shipping_address":{"name":"Mona","phone":"+201001234567","governorate_code":"cairo","city":"Cairo","area":null,"street":"Example Street","building":"12","floor":"3","apartment":"7","landmark":null},"note":null,"attributes":[{"key":"delivery_window","label":{"ar":"موعد التوصيل","en":"Delivery window"},"type":"time_window","value":"evening","display":{"ar":"مساءً","en":"Evening"},"sensitive":false,"value_hint":null}],"tags":[],"cancel_reason":null,"cancelled_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","line_items":[{"id":1,"variant_id":55,"title":{"ar":"قميص","en":"Shirt"},"variant_title":{"en":"M","ar":"م"},"sku":"SH-M","quantity":2,"unit_price":19950,"discount":0,"tax":0,"line_total":39900,"fulfilled_quantity":0}]}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/orders/{order}":{"get":{"operationId":"api.v1.orders.show","summary":"Orders Show","x-required-scope":"orders:read","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Order"}}},"example":{"data":{"id":812,"number":1042,"status":"open","financial_status":"pending","fulfillment_status":"unfulfilled","confirmation_status":"confirmed","source":"web","payment_method":"cod","currency":"EGP","subtotal":39900,"discount_total":0,"shipping_total":5000,"tax_total":0,"payment_fee_total":0,"gift_wrap_total":0,"total":44900,"customer_id":77,"contact_email":null,"shipping_address":{"name":"Mona","phone":"+201001234567","governorate_code":"cairo","city":"Cairo","area":null,"street":"Example Street","building":"12","floor":"3","apartment":"7","landmark":null},"note":null,"attributes":[{"key":"delivery_window","label":{"ar":"موعد التوصيل","en":"Delivery window"},"type":"time_window","value":"evening","display":{"ar":"مساءً","en":"Evening"},"sensitive":false,"value_hint":null}],"tags":[],"cancel_reason":null,"cancelled_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","line_items":[{"id":1,"variant_id":55,"title":{"ar":"قميص","en":"Shirt"},"variant_title":{"en":"M","ar":"م"},"sku":"SH-M","quantity":2,"unit_price":19950,"discount":0,"tax":0,"line_total":39900,"fulfilled_quantity":0}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"patch":{"operationId":"api.v1.orders.update","summary":"Orders Update","x-required-scope":"orders:write","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Order"}}},"example":{"data":{"id":812,"number":1042,"status":"open","financial_status":"pending","fulfillment_status":"unfulfilled","confirmation_status":"confirmed","source":"web","payment_method":"cod","currency":"EGP","subtotal":39900,"discount_total":0,"shipping_total":5000,"tax_total":0,"payment_fee_total":0,"gift_wrap_total":0,"total":44900,"customer_id":77,"contact_email":null,"shipping_address":{"name":"Mona","phone":"+201001234567","governorate_code":"cairo","city":"Cairo","area":null,"street":"Example Street","building":"12","floor":"3","apartment":"7","landmark":null},"note":null,"attributes":[{"key":"delivery_window","label":{"ar":"موعد التوصيل","en":"Delivery window"},"type":"time_window","value":"evening","display":{"ar":"مساءً","en":"Evening"},"sensitive":false,"value_hint":null}],"tags":[],"cancel_reason":null,"cancelled_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","line_items":[{"id":1,"variant_id":55,"title":{"ar":"قميص","en":"Shirt"},"variant_title":{"en":"M","ar":"م"},"sku":"SH-M","quantity":2,"unit_price":19950,"discount":0,"tax":0,"line_total":39900,"fulfilled_quantity":0}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderUpdate"},"example":{"status":"closed"}}}}}},"/returns":{"get":{"operationId":"api.v1.returns.index","summary":"Returns Index","x-required-scope":"orders:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"status","in":"query","schema":{"type":"string","enum":["requested","info_requested","approved","rejected","received_partial","received","refunded","exchanged","closed"]}},{"name":"order_id","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]*$","description":"An ID in this store; another store's ID is a 404."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":9,"order_id":812,"number":"R-1009","status":"approved","reason":"size_fit","lines":[{"order_line_item_id":1,"quantity":1}],"exchange":{"status":"reserved","resolution":"exchange","replacement_order_id":null,"credit":null,"difference":null,"collection":null,"lines":[{"order_line_item_id":1,"variant_id":56,"quantity":1,"unit_price":19950}]},"created_at":"2026-12-01T09:00:00Z","updated_at":"2026-12-01T09:30:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/returns/{return}":{"get":{"operationId":"api.v1.returns.show","summary":"Returns Show","x-required-scope":"orders:read","parameters":[{"name":"return","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Return"}}},"example":{"data":{"id":9,"order_id":812,"number":"R-1009","status":"approved","reason":"size_fit","lines":[{"order_line_item_id":1,"quantity":1}],"exchange":{"status":"reserved","resolution":"exchange","replacement_order_id":null,"credit":null,"difference":null,"collection":null,"lines":[{"order_line_item_id":1,"variant_id":56,"quantity":1,"unit_price":19950}]},"created_at":"2026-12-01T09:00:00Z","updated_at":"2026-12-01T09:30:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/orders/{order}/notes":{"post":{"operationId":"api.v1.orders.notes.store","summary":"Orders Notes Store","x-required-scope":"orders:write","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Note"}}},"example":{"data":{"id":91,"order_id":812,"body":"Please deliver in the evening.","created_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreate"},"example":{"body":"Please deliver in the evening."}}}}}},"/orders/{order}/fulfillments":{"get":{"operationId":"api.v1.orders.fulfillments.index","summary":"Orders Fulfillments Index","x-required-scope":"fulfillments:read","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}}}},"example":{"data":[{"id":301,"order_id":812,"status":"created","carrier":"Aramex","carrier_code":"manual","carrier_status":null,"tracking_number":"AX123456789","tracking_url":null,"shipped_at":null,"delivered_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","lines":[{"order_line_item_id":1,"quantity":2}]}]}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.orders.fulfillments.store","summary":"Orders Fulfillments Store","x-required-scope":"fulfillments:write","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Fulfillment"}}},"example":{"data":{"id":301,"order_id":812,"status":"created","carrier":"Aramex","carrier_code":"manual","carrier_status":null,"tracking_number":"AX123456789","tracking_url":null,"shipped_at":null,"delivered_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","lines":[{"order_line_item_id":1,"quantity":2}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentCreate"},"example":{"lines":[{"order_line_id":1,"quantity":2}],"carrier":"Aramex","tracking_number":"AX123456789"}}}}}},"/orders/{order}/fulfillments/{fulfillment}":{"patch":{"operationId":"api.v1.orders.fulfillments.update","summary":"Orders Fulfillments Update","x-required-scope":"fulfillments:write","parameters":[{"name":"order","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"fulfillment","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Fulfillment"}}},"example":{"data":{"id":301,"order_id":812,"status":"created","carrier":"Aramex","carrier_code":"manual","carrier_status":null,"tracking_number":"AX123456789","tracking_url":null,"shipped_at":null,"delivered_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","lines":[{"order_line_item_id":1,"quantity":2}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FulfillmentTrackingPatch"},"example":{"tracking_number":"AX987654321","tracking_url":"https://tracking.example.com/AX987654321"}}}}}},"/products":{"get":{"operationId":"api.v1.products.index","summary":"Products Index","x-required-scope":"products:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","active","archived"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.products.store","summary":"Products Store","x-required-scope":"products:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}},"example":{"data":{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"},"example":{"title":{"ar":"قميص كتان","en":"Linen shirt"},"handle":"linen-shirt","tax_class":"standard","variant":{"price":25000,"sku":"LINEN-01"}}}}}}},"/products/{product}":{"get":{"operationId":"api.v1.products.show","summary":"Products Show","x-required-scope":"products:read","parameters":[{"name":"product","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}},"example":{"data":{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"patch":{"operationId":"api.v1.products.update","summary":"Products Update","x-required-scope":"products:write","parameters":[{"name":"product","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}},"example":{"data":{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMetadataPatch"},"example":{"title":{"en":"Updated linen shirt"},"tax_class":"standard"}}}}}},"/products/{product}/variants/{variant}":{"patch":{"operationId":"api.v1.products.variants.update","summary":"Products Variants Update","x-required-scope":"products:write","parameters":[{"name":"product","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"variant","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Product"}}},"example":{"data":{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantUpdate"},"example":{"price":18950,"inventory":{"on_hand":40},"reason":"stocktake"}}}}}},"/locations":{"get":{"operationId":"api.v1.locations.index","summary":"Locations Index","x-required-scope":"inventory:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":3,"name":"Main warehouse","is_default":true,"is_active":true,"sells_online":true,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/inventory_levels":{"get":{"operationId":"api.v1.inventory-levels.index","summary":"Inventory Levels Index","x-required-scope":"inventory:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"variant_id","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]*$","description":"An ID in this store; another store's ID is a 404."}},{"name":"location_id","in":"query","schema":{"type":"string","pattern":"^[1-9][0-9]*$","description":"An ID in this store; another store's ID is a 404."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryLevel"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":120,"variant_id":55,"product_id":31,"location_id":3,"on_hand":38,"reserved":2,"available":36,"updated_at":"2026-11-15T10:00:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/inventory_levels/adjust":{"post":{"operationId":"api.v1.inventory-levels.adjust","summary":"Inventory Levels Adjust","x-required-scope":"inventory:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/InventoryLevel"}}},"example":{"data":{"id":120,"variant_id":55,"product_id":31,"location_id":3,"on_hand":38,"reserved":2,"available":36,"updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjust"},"example":{"variant_id":55,"location_id":3,"delta":-2,"reason":"damaged","note":"Two torn in transit"}}}}}},"/inventory_levels/set":{"post":{"operationId":"api.v1.inventory-levels.set","summary":"Inventory Levels Set","x-required-scope":"inventory:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/InventoryLevel"}}},"example":{"data":{"id":120,"variant_id":55,"product_id":31,"location_id":3,"on_hand":38,"reserved":2,"available":36,"updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventorySet"},"example":{"variant_id":55,"on_hand":40,"expected_on_hand":38,"reason":"stocktake"}}}}}},"/collections":{"get":{"operationId":"api.v1.collections.index","summary":"Collections Index","x-required-scope":"collections:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"kind","in":"query","schema":{"type":"string","enum":["manual","automatic"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.collections.store","summary":"Collections Store","x-required-scope":"collections:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Collection"}}},"example":{"data":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionCreate"},"example":{"title":{"ar":"وصل حديثا","en":"New arrivals"},"handle":"new-arrivals","published":true}}}}}},"/collections/{collection}":{"get":{"operationId":"api.v1.collections.show","summary":"Collections Show","x-required-scope":"collections:read","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Collection"}}},"example":{"data":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"patch":{"operationId":"api.v1.collections.update","summary":"Collections Update","x-required-scope":"collections:write","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Collection"}}},"example":{"data":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionPatch"},"example":{"sort_order":"newest"}}}}},"delete":{"operationId":"api.v1.collections.destroy","summary":"Collections Destroy","x-required-scope":"collections:write","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deletion"}}},"example":{"data":{"id":14,"deleted":true}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/collections/{collection}/products":{"get":{"operationId":"api.v1.collections.products.index","summary":"Collections Products Index","x-required-scope":"collections:read","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CollectionMember"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"product_id":31,"position":0}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.collections.products.store","summary":"Collections Products Store","x-required-scope":"collections:write","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Collection"}}},"example":{"data":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionProductsAdd"},"example":{"product_ids":[31,32]}}}}}},"/collections/{collection}/products/{product}":{"delete":{"operationId":"api.v1.collections.products.destroy","summary":"Collections Products Destroy","x-required-scope":"collections:write","parameters":[{"name":"collection","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"product","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Collection"}}},"example":{"data":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/discounts":{"get":{"operationId":"api.v1.discounts.index","summary":"Discounts Index","x-required-scope":"discounts:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","active","expired","disabled"]}},{"name":"kind","in":"query","schema":{"type":"string","enum":["code","automatic","bxgy","tiered"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Discount"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.discounts.store","summary":"Discounts Store","x-required-scope":"discounts:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Discount"}}},"example":{"data":{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountCreate"},"example":{"code":"SUMMER10","method":"percent","value":1000,"status":"active","usage_limit":500}}}}}},"/discounts/{discount}":{"get":{"operationId":"api.v1.discounts.show","summary":"Discounts Show","x-required-scope":"discounts:read","parameters":[{"name":"discount","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Discount"}}},"example":{"data":{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"patch":{"operationId":"api.v1.discounts.update","summary":"Discounts Update","x-required-scope":"discounts:write","parameters":[{"name":"discount","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Discount"}}},"example":{"data":{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountPatch"},"example":{"ends_at":"2026-12-31T21:59:59Z"}}}}}},"/discounts/{discount}/deactivate":{"post":{"operationId":"api.v1.discounts.deactivate","summary":"Discounts Deactivate","x-required-scope":"discounts:write","parameters":[{"name":"discount","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Discount"}}},"example":{"data":{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/customers":{"get":{"operationId":"api.v1.customers.index","summary":"Customers Index","x-required-scope":"customers:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"updated_since","in":"query","schema":{"type":"string","description":"ISO 8601 date or datetime."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"meta":{"$ref":"#/components/schemas/PageMeta"}}},"example":{"data":[{"id":77,"phone":"+201001234567","email":null,"first_name":"Mona","last_name":"Ali","accepts_marketing":false,"tags":[],"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}],"meta":{"limit":25,"next_cursor":null,"prev_cursor":null}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/customers/{customer}":{"get":{"operationId":"api.v1.customers.show","summary":"Customers Show","x-required-scope":"customers:read","parameters":[{"name":"customer","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Customer"}}},"example":{"data":{"id":77,"phone":"+201001234567","email":null,"first_name":"Mona","last_name":"Ali","accepts_marketing":false,"tags":[],"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}},"/webhooks":{"get":{"operationId":"api.v1.webhooks.index","summary":"Webhooks Index","x-required-scope":"webhooks:write","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WebhookSubscriptionList"}}},"example":{"data":[{"id":42,"url":"https://hooks.example.com/fatrina","events":["order.created"],"enabled":true}]}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}},"post":{"operationId":"api.v1.webhooks.store","summary":"Webhooks Store","x-required-scope":"webhooks:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating the same request with the same value within 24 hours returns the first answer without running it again.","schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WebhookSubscription"}}},"example":{"data":{"id":42,"url":"https://hooks.example.com/fatrina","events":["order.created"],"enabled":true}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"409":{"$ref":"#/components/responses/409"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscribe"},"example":{"url":"https://hooks.example.com/fatrina","events":["order.created"],"secret":"whsec_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}}}}},"/webhooks/{endpoint}":{"delete":{"operationId":"api.v1.webhooks.destroy","summary":"Webhooks Destroy","x-required-scope":"webhooks:write","parameters":[{"name":"endpoint","in":"path","required":true,"description":"An ID in the store selected by the key. Foreign IDs return 404.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WebhookDeletion"}}},"example":{"data":{"id":42,"deleted":true}}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ftk_..."}},"schemas":{"Order":{"type":"object","properties":{"id":{"type":"integer"},"number":{"type":"integer"},"status":{"type":"string"},"financial_status":{"type":"string"},"fulfillment_status":{"type":"string"},"confirmation_status":{"type":"string"},"source":{"type":"string"},"payment_method":{"type":"string"},"currency":{"type":"string"},"subtotal":{"type":"integer"},"discount_total":{"type":"integer"},"shipping_total":{"type":"integer"},"tax_total":{"type":"integer"},"payment_fee_total":{"type":"integer"},"gift_wrap_total":{"type":"integer"},"total":{"type":"integer"},"customer_id":{"type":["integer","null"]},"contact_email":{"type":["string","null"]},"shipping_address":{"type":["object","null"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"governorate_code":{"type":"string"},"city":{"type":"string"},"area":{"type":"string"},"street":{"type":"string"},"building":{"type":"string"},"floor":{"type":"string"},"apartment":{"type":"string"},"landmark":{"type":"string"}}},"note":{"type":["string","null"]},"attributes":{"type":"array","description":"Wave 25: the order's answers to the store's own checkout fields marked for exports and the API, with the label as it was at checkout. A sensitive answer (a national ID, or a field the store marked sensitive) never carries its value: `value` and `display` are null and `value_hint` holds its last four characters.","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"type":{"type":"string","enum":["text","textarea","select","checkbox","date","time_window","number","phone","email","national_id"]},"value":{"type":["string","null"]},"display":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"sensitive":{"type":"boolean"},"value_hint":{"type":["string","null"]}}}},"tags":{"type":"array","items":{"type":"string"}},"cancel_reason":{"type":["string","null"]},"cancelled_at":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"variant_id":{"type":["integer","null"]},"title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"variant_title":{"type":["object","null"],"properties":{"en":{"type":"string"},"ar":{"type":"string"}}},"sku":{"type":["string","null"]},"quantity":{"type":"integer"},"unit_price":{"type":"integer"},"discount":{"type":"integer"},"tax":{"type":"integer"},"tax_rate_bp":{"type":"integer","description":"The VAT rate this line was taxed at, in basis points (1400 = 14%); 0 for zero-rated, exempt and gift-card lines and on an order without VAT."},"tax_class":{"type":"string","description":"The tax class key the line was sold under: `standard`, `gift_card`, or the store's own class key. Frozen at placement."},"line_total":{"type":"integer"},"fulfilled_quantity":{"type":"integer"},"personalization":{"type":["array","null"],"description":"Read-only. The shopper's values for the product's personalization fields, frozen at placement: the field's label, `text` with the value typed, or `photo` (the photo itself is only in the dashboard), and the per-unit surcharge in minor units already inside `unit_price`. Null without any.","items":{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"type":{"type":"string","enum":["text","photo"]},"value":{"type":["string","null"]},"price":{"type":"integer"}}}},"preorder":{"type":["object","null"],"description":"Present when units of this line were sold ahead of stock: the pre-ordered units, the ship date promised and the line's own status.","properties":{"quantity":{"type":"integer"},"ships_on":{"type":["string","null"],"format":"date"},"status":{"type":"string","enum":["awaiting_stock","released","shipped","cancelled"]}}}}}}},"example":{"id":812,"number":1042,"status":"open","financial_status":"pending","fulfillment_status":"unfulfilled","confirmation_status":"confirmed","source":"web","payment_method":"cod","currency":"EGP","subtotal":39900,"discount_total":0,"shipping_total":5000,"tax_total":0,"payment_fee_total":0,"gift_wrap_total":0,"total":44900,"customer_id":77,"contact_email":null,"shipping_address":{"name":"Mona","phone":"+201001234567","governorate_code":"cairo","city":"Cairo","area":null,"street":"Example Street","building":"12","floor":"3","apartment":"7","landmark":null},"note":null,"attributes":[{"key":"delivery_window","label":{"ar":"موعد التوصيل","en":"Delivery window"},"type":"time_window","value":"evening","display":{"ar":"مساءً","en":"Evening"},"sensitive":false,"value_hint":null}],"tags":[],"cancel_reason":null,"cancelled_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","line_items":[{"id":1,"variant_id":55,"title":{"ar":"قميص","en":"Shirt"},"variant_title":{"en":"M","ar":"م"},"sku":"SH-M","quantity":2,"unit_price":19950,"discount":0,"tax":0,"tax_rate_bp":0,"tax_class":"standard","line_total":39900,"fulfilled_quantity":0}]}},"Product":{"type":"object","properties":{"id":{"type":"integer"},"handle":{"type":"string"},"status":{"type":"string"},"title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"vendor":{"type":["string","null"]},"type":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"tax_class":{"type":"string","description":"The product's tax class key: `standard` (the store rate) or one of the store's own classes (reduced, zero-rated or exempt)."},"personalization":{"type":"array","description":"Read-only. The personalization fields a shopper fills on the product page (a name to engrave, a photo to print), in order; empty without any. `price` is added to each unit, in minor units.","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string","enum":["text","photo"]},"label":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"required":{"type":"boolean"},"max_length":{"type":["integer","null"]},"price":{"type":"integer"}}}},"published_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"product_id":{"type":"integer"},"sku":{"type":["string","null"]},"barcode":{"type":["string","null"]},"price":{"type":"integer"},"compare_at_price":{"type":["integer","null"]},"currency":{"type":"string"},"weight_g":{"type":["integer","null"]},"position":{"type":"integer"},"track_inventory":{"type":"boolean"},"allow_backorder":{"type":"boolean"},"preorder":{"type":["object","null"],"description":"How the variant is sold ahead of its stock; null when pre-orders are off.","properties":{"mode":{"type":"string","enum":["out_of_stock","always"]},"ships_on":{"type":["string","null"],"format":"date"},"limit":{"type":["integer","null"]},"ends_at":{"type":["string","null"],"format":"date-time"}}},"inventory":{"type":["object","null"],"properties":{"on_hand":{"type":"integer"},"reserved":{"type":"integer"},"available":{"type":"integer"}}},"options":{"type":"array","items":{"type":"object","properties":{"name":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"value":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}}}}}}}}},"example":{"id":31,"handle":"linen-shirt","status":"active","title":{"ar":"قميص كتان","en":"Linen shirt"},"description":{"ar":"قميص خفيف","en":"Light linen shirt"},"vendor":null,"type":null,"tags":[],"tax_class":"standard","published_at":"2026-11-15T10:00:00Z","created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","variants":[{"id":55,"product_id":31,"sku":"SH-M","barcode":null,"price":19950,"compare_at_price":24950,"currency":"EGP","weight_g":300,"position":0,"track_inventory":true,"allow_backorder":false,"inventory":{"on_hand":12,"reserved":2,"available":10},"options":[{"name":{"ar":"المقاس","en":"Size"},"value":{"ar":"م","en":"M"}}]}]}},"Customer":{"type":"object","properties":{"id":{"type":"integer"},"phone":{"type":"string"},"email":{"type":["string","null"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"accepts_marketing":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":77,"phone":"+201001234567","email":null,"first_name":"Mona","last_name":"Ali","accepts_marketing":false,"tags":[],"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}},"Note":{"type":"object","properties":{"id":{"type":"integer"},"order_id":{"type":"integer"},"body":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":91,"order_id":812,"body":"Please deliver in the evening.","created_at":"2026-11-15T10:00:00Z"}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"PageMeta":{"type":"object","properties":{"limit":{"type":"integer"},"next_cursor":{"type":["string","null"]},"prev_cursor":{"type":["string","null"]}}},"OrderUpdate":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["open","closed","cancelled"]},"reason":{"type":["string","null"],"enum":["customer_request","out_of_stock","fraud","other",null]},"note":{"type":["string","null"],"maxLength":500}}},"NoteCreate":{"type":"object","additionalProperties":false,"required":["body"],"properties":{"body":{"type":"string","minLength":1,"maxLength":1000}}},"VariantUpdate":{"type":"object","additionalProperties":false,"anyOf":[{"required":["price"]},{"required":["compare_at_price"]},{"required":["inventory"]}],"properties":{"price":{"type":"integer","minimum":0,"maximum":99999999999},"compare_at_price":{"type":["integer","null"],"minimum":0,"maximum":99999999999},"reason":{"type":"string","enum":["received","stocktake","damaged","lost","returned","correction","initial","other"]},"inventory":{"type":"object","additionalProperties":false,"oneOf":[{"required":["on_hand"]},{"required":["adjust"]}],"properties":{"on_hand":{"type":"integer","minimum":0,"maximum":1000000},"adjust":{"type":"integer","minimum":-1000000,"maximum":1000000,"not":{"const":0}}}}},"description":"Price and stock are written together or not at all. A stock change is refused with 422 `stock_managed_by_pos` (Narmar POS owns the count at the store's default location) or `stock_managed_by_codes` (a digital variant that sells codes), and then nothing is written, the price included."},"WebhookSubscription":{"type":"object","required":["id","url","events","enabled"],"properties":{"id":{"type":"integer"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"}}},"WebhookSubscriptionList":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscription"}},"WebhookDeletion":{"type":"object","required":["id","deleted"],"properties":{"id":{"type":"integer"},"deleted":{"const":true}}},"WebhookSubscribe":{"type":"object","additionalProperties":false,"required":["url","events","secret"],"properties":{"url":{"type":"string","format":"uri","description":"Public HTTPS callback; private addresses, own hosts and redirects are forbidden."},"events":{"type":"array","minItems":1,"items":{"type":"string"}},"secret":{"type":"string","pattern":"^whsec_[A-Za-z0-9]{40,128}$","writeOnly":true,"description":"Generated and retained by the connector; never returned by this API."}}},"ProductMetadataPatch":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"]},"seo_title":{"type":["object","null"]},"seo_description":{"type":["object","null"]},"handle":{"type":["string","null"]},"status":{"enum":["draft","active","archived"]},"vendor":{"type":["string","null"]},"type":{"type":["string","null"]},"tags":{"type":["array","null"],"items":{"type":"string"}},"tax_class":{"type":"string","description":"The product's tax class: `standard` (the store rate) or the key of one of the store's active tax classes (reduced, zero-rated or exempt). Unknown or archived keys are a 422. Changing it reaches new carts only; placed orders keep the class they were sold under."}}},"ProductCreate":{"type":"object","required":["title","variant"],"properties":{"variant":{"type":"object","additionalProperties":false,"required":["price"],"properties":{"price":{"type":"integer","minimum":0},"compare_at_price":{"type":["integer","null"],"minimum":0},"sku":{"type":["string","null"]},"barcode":{"type":["string","null"]},"weight_g":{"type":["integer","null"],"minimum":0},"track_inventory":{"type":"boolean"},"allow_backorder":{"type":"boolean"}}},"title":{"type":"object","properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"]},"seo_title":{"type":["object","null"]},"seo_description":{"type":["object","null"]},"handle":{"type":["string","null"]},"status":{"enum":["draft","active","archived"]},"vendor":{"type":["string","null"]},"type":{"type":["string","null"]},"tags":{"type":["array","null"],"items":{"type":"string"}},"tax_class":{"type":"string","description":"The product's tax class: `standard` (the store rate) or the key of one of the store's active tax classes (reduced, zero-rated or exempt). Unknown or archived keys are a 422. Changing it reaches new carts only; placed orders keep the class they were sold under."}},"description":"One default variant. All money is integer minor units; initial stock uses the separate inventory adjustment action.","additionalProperties":false},"Location":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"is_default":{"type":"boolean"},"is_active":{"type":"boolean"},"sells_online":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":3,"name":"Main warehouse","is_default":true,"is_active":true,"sells_online":true,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}},"InventoryLevel":{"type":"object","properties":{"id":{"type":"integer"},"variant_id":{"type":"integer"},"product_id":{"type":["integer","null"]},"location_id":{"type":"integer"},"on_hand":{"type":"integer"},"reserved":{"type":"integer"},"available":{"type":"integer"},"updated_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":120,"variant_id":55,"product_id":31,"location_id":3,"on_hand":38,"reserved":2,"available":36,"updated_at":"2026-11-15T10:00:00Z"}},"InventoryAdjust":{"type":"object","properties":{"variant_id":{"type":"integer","minimum":1},"location_id":{"type":"integer","minimum":1,"description":"Omitted: the default location."},"reason":{"type":"string","enum":["received","stocktake","damaged","lost","returned","correction","initial","other"],"default":"correction"},"note":{"type":["string","null"],"maxLength":500},"delta":{"type":"integer","minimum":-1000000,"maximum":1000000,"not":{"const":0}}},"required":["variant_id","delta"],"additionalProperties":false},"InventorySet":{"type":"object","properties":{"variant_id":{"type":"integer","minimum":1},"location_id":{"type":"integer","minimum":1,"description":"Omitted: the default location."},"reason":{"type":"string","enum":["received","stocktake","damaged","lost","returned","correction","initial","other"],"default":"correction"},"note":{"type":["string","null"],"maxLength":500},"on_hand":{"type":"integer","minimum":0,"maximum":1000000},"expected_on_hand":{"type":"integer","minimum":0,"maximum":1000000,"description":"Only set when on-hand still is this count (409 stock_changed otherwise)."}},"required":["variant_id","on_hand"],"additionalProperties":false},"Collection":{"type":"object","properties":{"id":{"type":"integer"},"handle":{"type":"string"},"kind":{"type":"string","enum":["manual","automatic"]},"title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"sort_order":{"type":"string"},"published":{"type":"boolean"},"rules":{"type":["object","null"],"description":"The rule set of an automatic collection (read-only)."},"products_count":{"type":"integer"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":14,"handle":"new-arrivals","kind":"manual","title":{"ar":"وصل حديثا","en":"New arrivals"},"description":null,"seo_title":null,"seo_description":null,"sort_order":"manual","published":true,"rules":null,"products_count":2,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}},"CollectionCreate":{"type":"object","properties":{"title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"handle":{"type":["string","null"],"maxLength":255},"sort_order":{"type":"string","enum":["manual","newest","price_asc","price_desc","title_asc","best_selling"]},"published":{"type":"boolean"}},"required":["title"],"additionalProperties":false},"CollectionPatch":{"type":"object","properties":{"title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_title":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"seo_description":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"handle":{"type":["string","null"],"maxLength":255},"sort_order":{"type":"string","enum":["manual","newest","price_asc","price_desc","title_asc","best_selling"]},"published":{"type":"boolean"}},"additionalProperties":false,"minProperties":1},"CollectionProductsAdd":{"type":"object","properties":{"product_ids":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"integer","minimum":1},"uniqueItems":true}},"required":["product_ids"],"additionalProperties":false},"CollectionMember":{"type":"object","properties":{"product_id":{"type":"integer"},"position":{"type":"integer"}},"example":{"product_id":31,"position":0}},"Deletion":{"type":"object","properties":{"id":{"type":"integer"},"deleted":{"type":"boolean"}},"example":{"id":14,"deleted":true}},"Discount":{"type":"object","properties":{"id":{"type":"integer"},"kind":{"type":"string","enum":["code","automatic","bxgy","tiered"]},"code":{"type":["string","null"]},"name":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"method":{"type":"string","enum":["percent","fixed","free_shipping"]},"value":{"type":"integer","minimum":0,"description":"Basis points for percent (1000 = 10%), minor units for fixed, 0 for free shipping."},"min_subtotal":{"type":"integer","minimum":0},"min_quantity":{"type":"integer","minimum":0,"maximum":10000},"usage_limit":{"type":["integer","null"],"minimum":1},"per_customer_limit":{"type":["integer","null"],"minimum":1},"starts_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["draft","active","expired","disabled"]},"product_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"collection_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"segment_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"combines_automatic":{"type":"boolean"},"combines_code":{"type":"boolean"},"combines_offers":{"type":"boolean"},"get_product_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"get_collection_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"buy_quantity":{"type":["integer","null"]},"get_quantity":{"type":["integer","null"]},"max_applications":{"type":["integer","null"]},"tiers":{"type":["array","null"],"items":{"type":"object","properties":{"threshold":{"type":"integer"},"method":{"type":"string"},"value":{"type":"integer"}}}},"show_on_storefront":{"type":"boolean"},"uses":{"type":"integer"},"codes_count":{"type":"integer","description":"Generated unique codes of this discount (code batches); 0 when it has none."},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":7,"code":"SUMMER10","kind":"code","name":null,"method":"percent","value":1000,"min_subtotal":0,"min_quantity":0,"usage_limit":500,"per_customer_limit":null,"status":"active","product_ids":null,"collection_ids":null,"get_product_ids":null,"get_collection_ids":null,"segment_ids":null,"buy_quantity":null,"get_quantity":null,"max_applications":null,"combines_automatic":true,"combines_code":true,"combines_offers":true,"tiers":null,"show_on_storefront":false,"starts_at":null,"ends_at":null,"uses":12,"codes_count":0,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z"}},"DiscountCreate":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"name":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"method":{"type":"string","enum":["percent","fixed","free_shipping"]},"value":{"type":"integer","minimum":0,"description":"Basis points for percent (1000 = 10%), minor units for fixed, 0 for free shipping."},"min_subtotal":{"type":"integer","minimum":0},"min_quantity":{"type":"integer","minimum":0,"maximum":10000},"usage_limit":{"type":["integer","null"],"minimum":1},"per_customer_limit":{"type":["integer","null"],"minimum":1},"starts_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["draft","active","expired","disabled"]},"product_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"collection_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"segment_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"combines_automatic":{"type":"boolean"},"combines_code":{"type":"boolean"},"combines_offers":{"type":"boolean"}},"required":["code","method","value","status"],"additionalProperties":false},"DiscountPatch":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$"},"name":{"type":["object","null"],"properties":{"ar":{"type":"string"},"en":{"type":"string"}}},"method":{"type":"string","enum":["percent","fixed","free_shipping"]},"value":{"type":"integer","minimum":0,"description":"Basis points for percent (1000 = 10%), minor units for fixed, 0 for free shipping."},"min_subtotal":{"type":"integer","minimum":0},"min_quantity":{"type":"integer","minimum":0,"maximum":10000},"usage_limit":{"type":["integer","null"],"minimum":1},"per_customer_limit":{"type":["integer","null"],"minimum":1},"starts_at":{"type":["string","null"],"format":"date-time"},"ends_at":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["draft","active","expired","disabled"]},"product_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"collection_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"segment_ids":{"type":["array","null"],"items":{"type":"integer","minimum":1}},"combines_automatic":{"type":"boolean"},"combines_code":{"type":"boolean"},"combines_offers":{"type":"boolean"}},"additionalProperties":false,"minProperties":1},"Fulfillment":{"type":"object","properties":{"id":{"type":"integer"},"order_id":{"type":"integer"},"status":{"type":"string","enum":["created","shipped","delivered","returned"]},"carrier":{"type":"string"},"carrier_code":{"type":["string","null"]},"carrier_status":{"type":["string","null"]},"tracking_number":{"type":["string","null"]},"tracking_url":{"type":["string","null"]},"shipped_at":{"type":["string","null"],"format":"date-time"},"delivered_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"order_line_item_id":{"type":"integer"},"quantity":{"type":"integer"}}}}},"example":{"id":301,"order_id":812,"status":"created","carrier":"Aramex","carrier_code":"manual","carrier_status":null,"tracking_number":"AX123456789","tracking_url":null,"shipped_at":null,"delivered_at":null,"created_at":"2026-11-15T10:00:00Z","updated_at":"2026-11-15T10:00:00Z","lines":[{"order_line_item_id":1,"quantity":2}]}},"FulfillmentCreate":{"type":"object","properties":{"lines":{"type":"array","minItems":1,"maxItems":250,"items":{"type":"object","additionalProperties":false,"required":["order_line_id","quantity"],"properties":{"order_line_id":{"type":"integer","minimum":1},"quantity":{"type":"integer","minimum":1}}}},"carrier":{"type":"string","maxLength":120,"default":"own_delivery"},"tracking_number":{"type":["string","null"],"maxLength":191},"tracking_url":{"type":["string","null"],"format":"uri","maxLength":2048}},"required":["lines"],"additionalProperties":false},"FulfillmentTrackingPatch":{"type":"object","properties":{"tracking_number":{"type":["string","null"],"maxLength":191},"tracking_url":{"type":["string","null"],"format":"uri","maxLength":2048}},"additionalProperties":false,"minProperties":1},"Refund":{"type":"object","properties":{"id":{"type":"integer"},"order_id":{"type":"integer"},"amount":{"type":"integer"},"currency":{"type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"mode":{"type":"string"},"restock":{"type":"array","items":{"type":"object","properties":{"order_line_item_id":{"type":"integer"},"quantity":{"type":"integer"}}}},"completed_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}},"example":{"id":44,"order_id":812,"amount":19950,"currency":"EGP","reason":"customer_request","status":"succeeded","mode":"gateway","restock":[{"order_line_item_id":1,"quantity":1}],"completed_at":"2026-11-15T10:05:00Z","created_at":"2026-11-15T10:00:00Z"}},"Return":{"type":"object","description":"A shopper's return request, read only. The same body the `return.requested` and `return.updated` webhooks send.","properties":{"id":{"type":"integer"},"order_id":{"type":"integer"},"number":{"type":"string"},"status":{"type":"string","enum":["requested","info_requested","approved","rejected","received_partial","received","refunded","exchanged","closed"]},"reason":{"type":"string","enum":["defective","damaged","wrong_item","not_as_described","size_fit","changed_mind","other"]},"lines":{"type":"array","items":{"type":"object","properties":{"order_line_item_id":{"type":"integer"},"quantity":{"type":"integer"}}}},"exchange":{"type":["object","null"],"description":"The request's exchange; null when it has none.","properties":{"status":{"type":"string","enum":["pending","reserved","created","cancelled"]},"resolution":{"type":"string","enum":["refund","exchange","mixed"]},"replacement_order_id":{"type":["integer","null"]},"credit":{"type":["integer","null"],"description":"Value of the returned units, integer minor units."},"difference":{"type":["integer","null"],"description":"Replacement total minus the returned units' value, integer minor units (signed)."},"collection":{"type":["string","null"],"enum":["none","cod","payment_link","refund","store_credit",null]},"lines":{"type":"array","items":{"type":"object","properties":{"order_line_item_id":{"type":"integer"},"variant_id":{"type":"integer"},"quantity":{"type":"integer"},"unit_price":{"type":"integer"}}}}}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time","description":"Moves with every status change and every exchange change."}},"example":{"id":9,"order_id":812,"number":"R-1009","status":"approved","reason":"size_fit","lines":[{"order_line_item_id":1,"quantity":1}],"exchange":{"status":"reserved","resolution":"exchange","replacement_order_id":null,"credit":null,"difference":null,"collection":null,"lines":[{"order_line_item_id":1,"variant_id":56,"quantity":1,"unit_price":19950}]},"created_at":"2026-12-01T09:00:00Z","updated_at":"2026-12-01T09:30:00Z"}}},"responses":{"401":{"description":"unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthenticated","message":"See the developer guide for this error."}}}}},"403":{"description":"missing_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"missing_scope","message":"See the developer guide for this error."}}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"See the developer guide for this error."}}}}},"409":{"description":"idempotency_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_in_progress","message":"See the developer guide for this error."}}}}},"422":{"description":"validation_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"validation_failed","message":"See the developer guide for this error."}}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"See the developer guide for this error."}}}},"headers":{"Retry-After":{"schema":{"type":"integer"}}}}}},"x-webhook-events":["order.created","order.updated","order.delivered","order.cancelled","product.updated","customer.created","fulfillment.updated","return.requested","product.created","product.deleted","inventory_level.updated","collection.created","collection.updated","collection.deleted","discount.created","discount.updated","fulfillment.created","refund.created","return.updated","customer.updated","webhook.test"]}