Skip to main content

Orders

This section covers the API endpoints for managing orders in the admin panel.

List Orders

GET /v1/admin/orders

Returns a paginated list of all orders.

Query Parameters

ParameterTypeDescription
search_textstringSearch orders by ID, number, charge ID, customer username, full name, or email
statusstringFilter by order status
payment_methodstringFilter by payment method
nodhom_statusstringFilter by Nodhom status
customer_idstringFilter by customer ID
date_rangestringFilter by creation date range
subscriptions_transferredbooleanFilter by subscription transfer status
trashedbooleanInclude soft deleted orders
sortstringSort by field (number, payment_method, paid_at)
per_pageintegerNumber of items per page. Defaults to 10

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/orders?page=1",
"from": 1,
"last_page": 19682,
"last_page_url": "http://192.168.0.139:8080/v1/admin/orders?page=19682",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=1",
"label": "1",
"active": true
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=2",
"label": "2",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=3",
"label": "3",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=4",
"label": "4",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=5",
"label": "5",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=19681",
"label": "19681",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=19682",
"label": "19682",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/orders?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://192.168.0.139:8080/v1/admin/orders?page=2",
"path": "http://192.168.0.139:8080/v1/admin/orders",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 196814,
"orders": [
{
"id": "75fcbd50-0481-11f0-abeb-5f31b6df026e",
"customer_name": "اسم العميل",
"payment_method": "wallet",
"number": 2503202566,
"price": "382.95",
"paid_at": "2025-03-19",
"transfer": "",
"charge_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"status": "wallet-accepted",
"nodhom_status": "unsent",
"added_to_nodhom_at": null,
"created_at": "2025-03-19 08:17:32",
"subscription_transferred": false
},
{
"id": "85944510-d25f-11ef-8f25-017573176589",
"customer_name": "اميرة حسن",
"payment_method": "tabby",
"number": 2501202565,
"price": "219.01",
"paid_at": "2025-01-14",
"transfer": "",
"charge_id": null,
"status": "tabby-pending",
"nodhom_status": "unsent",
"added_to_nodhom_at": null,
"created_at": "2025-01-14 13:08:37",
"subscription_transferred": false
},
{
"id": "255fc9b0-d25f-11ef-9eda-3d5d325130bf",
"customer_name": "Eman Abdulrahman",
"payment_method": "paytabs_credit_card",
"number": 2501202564,
"price": "820.88",
"paid_at": "2025-01-14",
"transfer": "",
"charge_id": "PTS2501443297418",
"status": "payment_rejected",
"nodhom_status": "unsent",
"added_to_nodhom_at": null,
"created_at": "2025-01-14 13:05:56",
"subscription_transferred": false
},
{
"id": "bd86fb50-d25e-11ef-a74c-9570ba26385d",
"customer_name": "Shami Moneer",
"payment_method": "tabby",
"number": 2501202563,
"price": "1127.00",
"paid_at": "2025-01-14",
"transfer": "",
"charge_id": null,
"status": "tabby-pending",
"nodhom_status": "unsent",
"added_to_nodhom_at": null,
"created_at": "2025-01-14 13:03:02",
"subscription_transferred": false
},
{
"id": "b69bfaa0-d25e-11ef-9c50-a7d61af1b062",
"customer_name": "Lamya Alzeer",
"payment_method": "paytabs_credit_card",
"number": 2501202562,
"price": "276.00",
"paid_at": "2025-01-14",
"transfer": "",
"charge_id": "PTS2501443297202",
"status": "auto-complete",
"nodhom_status": "unsent",
"added_to_nodhom_at": null,
"created_at": "2025-01-14 13:02:50",
"subscription_transferred": true
},
]
},
"status_code": 200
}

Show Order

GET /v1/admin/orders/{id}

Returns detailed information about a specific order.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "75fcbd50-0481-11f0-abeb-5f31b6df026e",
"customer_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"customer_name": "اسم العميل",
"customer_email": "aalbaiti360@gmail.com",
"customer_country": "السعودية",
"number": 2503202566,
"status": "wallet-accepted",
"payment_method": "wallet",
"discount": "0.00",
"price_without_discount": "333.00",
"price_after_discount": "333.00",
"price_without_tax": "333.00",
"total_price": "382.95",
"coupon": null,
"products": [
{
"id": "8a620ad0-a5a2-11ee-8c63-07e9c26c60de",
"name": "مصادر الثراء",
"course_name": null,
"type": "course",
"count": 9,
"poster": "http://192.168.0.139:8080/storage/20786/مصادر-الثراء.png",
"old_price": null,
"price": "333.00",
"certificate_price": 0,
"summary_price": 0,
"subtotal": "333.00",
"subtotal_after_tax": "382.95",
"duration": 730,
"with_certificate": false,
"with_summary": false,
"gift_email": null,
"subscription_type": null,
"affiliate_email": null,
"affiliate_name": null,
"meta": null,
"has_subscription": false,
"subscriptions_count": 0
}
],
"notes": [],
"paid_at": "2025-03-19 08:17:32",
"paid_currency": null,
"paid_amount": null,
"transfers": null,
"charge_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"bank_name": null,
"can_download_invoice": false,
"tax": "15.00",
"meta": {
"bank_transfer_id": null,
"tap_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"order_created_at": "2025-03-19 08:17:32",
"order_updated_at": "2025-03-19 08:17:33",
"subscriptions_started_at": null
},
"activities_count": 2,
"order_notes_activities_count": 0
},
"status_code": 200
}

Create Order

POST /v1/admin/orders

Create a new order.

Request Body

ParameterTypeDescription
productsarrayRequired. Array of products to order
products.*.idstringRequired. Product ID
products.*.typestringRequired. Product type (ebook, course, bundle)
products.*.with_certificatebooleanRequired. Include certificate
products.*.with_summarybooleanRequired. Include summary
customer_idstringRequired. Customer ID
order_confirmedbooleanWhether to confirm the order
payment_methodstringRequired when order_confirmed is true. Payment method
bank_idstringRequired for bank transfers. Bank account ID
bank_transfer_sourcestringRequired for bank transfers. Source country

Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "5632c710-05a9-11f0-8901-e37ae8ddf37d",
"customer_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"customer_name": "هاجر بنعامر",
"customer_email": "hajarb424@gmail.com",
"customer_country": "المغرب",
"number": 2503202567,
"status": "pending",
"payment_method": "bank_transfer",
"discount": "0.00",
"price_without_discount": "190.44",
"price_after_discount": "190.44",
"price_without_tax": "190.44",
"total_price": "190.44",
"coupon": null,
"products": [
{
"id": "569ba740-4700-11ee-9a7b-11b6864f4035",
"name": "نداء الاثير",
"course_name": null,
"type": "course",
"count": 2,
"poster": "http://192.168.0.139:8080/storage/24886/نداء-الأثير.png",
"old_price": null,
"price": "190.44",
"certificate_price": 0,
"summary_price": 0,
"subtotal": "190.44",
"subtotal_after_tax": "190.44",
"duration": 730,
"with_certificate": true,
"with_summary": true,
"gift_email": null,
"subscription_type": null,
"affiliate_email": null,
"affiliate_name": null,
"meta": null,
"has_subscription": false,
"subscriptions_count": 0
}
],
"notes": [],
"paid_at": "2025-03-20 19:35:30",
"paid_currency": null,
"paid_amount": null,
"transfers": null,
"charge_id": null,
"bank_name": "بنك الإنماء - INMA BANK",
"can_download_invoice": false,
"tax": "0.00",
"meta": {
"bank_transfer_id": null,
"tap_id": null,
"order_created_at": "2025-03-20 19:35:30",
"order_updated_at": "2025-03-20 19:35:30",
"subscriptions_started_at": null
},
"activities_count": 1,
"order_notes_activities_count": 0
},
"status_code": 200
}

Update Order

PATCH /v1/admin/orders/{id}

Update an existing order.

Request Body

ParameterTypeDescription
statusstringOrder status
transfersarrayBank transfer images
deleted_transfersarrayTransfer images to delete

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "75fcbd50-0481-11f0-abeb-5f31b6df026e",
"customer_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"customer_name": "اسم العميل",
"customer_email": "aalbaiti360@gmail.com",
"customer_country": "السعودية",
"number": 2503202566,
"status": "accepted",
"payment_method": "wallet",
"discount": "0.00",
"price_without_discount": "333.00",
"price_after_discount": "333.00",
"price_without_tax": "333.00",
"total_price": "382.95",
"coupon": null,
"products": [
{
"id": "8a620ad0-a5a2-11ee-8c63-07e9c26c60de",
"name": "مصادر الثراء",
"course_name": null,
"type": "course",
"count": 9,
"poster": "http://192.168.0.139:8080/storage/20786/مصادر-الثراء.png",
"old_price": null,
"price": "333.00",
"certificate_price": 0,
"summary_price": 0,
"subtotal": "333.00",
"subtotal_after_tax": "382.95",
"duration": 730,
"with_certificate": false,
"with_summary": false,
"gift_email": null,
"subscription_type": null,
"affiliate_email": null,
"affiliate_name": null,
"meta": null,
"has_subscription": false,
"subscriptions_count": 0
}
],
"notes": [],
"paid_at": "2025-03-19 08:17:32",
"paid_currency": null,
"paid_amount": null,
"transfers": null,
"charge_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"bank_name": null,
"can_download_invoice": true,
"tax": "15.00",
"meta": {
"bank_transfer_id": null,
"tap_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"order_created_at": "2025-03-19 08:17:32",
"order_updated_at": "2025-03-20 19:33:40",
"subscriptions_started_at": null
},
"activities_count": 3,
"order_notes_activities_count": 0
},
"status_code": 200
}

Delete Order Item

PATCH /v1/admin/orders/{id}/remove-item

Delete an item from an order.

Request Body

ParameterTypeDescription
product_idstringRequired. UUID of product to delete

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "75fcbd50-0481-11f0-abeb-5f31b6df026e",
"customer_avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"customer_name": "اسم العميل",
"customer_email": "aalbaiti360@gmail.com",
"customer_country": "السعودية",
"number": 2503202566,
"status": "pending",
"payment_method": "wallet",
"discount": "0.00",
"price_without_discount": 0,
"price_after_discount": 0,
"price_without_tax": 0,
"total_price": 0,
"coupon": null,
"products": [],
"notes": [],
"paid_at": "2025-03-19 08:17:32",
"paid_currency": null,
"paid_amount": null,
"transfers": null,
"charge_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"bank_name": null,
"can_download_invoice": false,
"tax": "15.00",
"meta": {
"bank_transfer_id": null,
"tap_id": "ec6e005c-f1b0-4a89-a826-7bc8a7040ab8",
"order_created_at": "2025-03-19 08:17:32",
"order_updated_at": "2025-03-20 19:34:22",
"subscriptions_started_at": null
},
"activities_count": 5,
"order_notes_activities_count": 0
},
"status_code": 200
}

Transfer Subscriptions

PATCH /v1/admin/orders/transfer-subscriptions

Transfer subscriptions for completed orders.

Request Body

ParameterTypeDescription
idsarrayRequired. Array of order UUIDs

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": null,
"status_code": 200
}

Delete Orders

DELETE /v1/admin/orders

Delete multiple orders.

Request Body

ParameterTypeDescription
idsarrayRequired. Array of order UUIDs to delete

Response

{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}

Download Invoice

GET /v1/admin/orders/{id}/download-invoice

Download the invoice for an order in PDF format.

Response

Returns a PDF file with the invoice details.

Export Pending Orders

GET /v1/admin/orders-export

Export pending orders to Excel format.

Response

Returns an Excel file containing pending orders.

Get Order Statistics

GET /v1/admin/statistics/orders

Returns statistics about orders including total count, sales, payment methods distribution, and top ordering countries.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"total_orders": "196.8K",
"total_sales": "61.9M",
"payment_types": [
{
"type": "credit_card",
"percentage": "10400.9%"
},
{
"type": "tabby",
"percentage": "2509.5%"
},
{
"type": "paytabs_credit_card",
"percentage": "2085.3%"
},
{
"type": "tamara",
"percentage": "1665.2%"
},
{
"type": "bank_transfer",
"percentage": "1284.6%"
},
{
"type": "apple_pay",
"percentage": "995.5%"
},
{
"type": "spotii",
"percentage": "740.3%"
},
{
"type": "wallet",
"percentage": "0.1%"
}
],
"total_orders_by_country": [
{
"name": "السعودية",
"percentage": "10851.1%"
},
{
"name": "الإمارات",
"percentage": "1595.3%"
},
{
"name": "الكويت",
"percentage": "1107.3%"
},
{
"name": "العراق",
"percentage": "829.8%"
}
]
},
"status_code": 200
}

Order Callback

POST /v1/admin/orders/callback

Handle payment gateway callbacks.

Request Body

ParameterTypeDescription
idstringRequired. Order UUID
payment_idstringPayment gateway transaction ID

Response

{
"success": true,
"message": null,
"data": null,
"status_code": 204
}

Authorization

All order management endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.

Notes

  • Orders can only be deleted if they are in pending, rejected, or certain payment-specific statuses
  • Items can only be deleted from orders in bank pending or rejected status
  • Bank transfer orders require valid transfer images and source country
  • Subscription transfers are only processed for completed orders
  • Invoice downloads are only available for orders that meet specific criteria