Skip to main content
All order endpoints require authentication with auth:sanctum.

Create Order

Request

payment_type
string
required
Payment method: cash_on_delivery, wallet, manual_payment_1, or online payment gateway name

Response

result
boolean
Success status
message
string
Success or error message
combined_order_id
integer
Combined order ID (0 if failed)

Example

curl -X POST https://your-domain.com/api/v2/order/store \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_type": "cash_on_delivery"
  }'
The order creation process:
  1. Validates minimum order amount (if configured)
  2. Checks cart is not empty
  3. Gets shipping address from cart
  4. Creates combined order and individual orders per seller
  5. Reduces product stock
  6. Applies coupons and calculates totals
  7. Clears cart
  8. Sends notifications

Cancel Order

Path Parameters

id
integer
required
Order ID

Response

{
  "result": true,
  "message": "Order has been canceled successfully"
}
Orders can only be cancelled if:
  • Delivery status is “pending”
  • Payment status is “unpaid”
  • Order belongs to the authenticated user

Example

curl -X GET https://your-domain.com/api/v2/order/cancel/123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Purchase History

Get Order List

Response

Paginated list of orders with details.

Example

curl -X GET https://your-domain.com/api/v2/purchase-history \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Get Order Details

Path Parameters

id
integer
required
Order ID

Get Order Items

Path Parameters

id
integer
required
Order ID

Re-order

Path Parameters

id
integer
required
Order ID to re-order

Digital Products

Get Digital Purchased Products

Download Digital Product

Path Parameters

id
integer
required
Product ID

Invoice

Path Parameters

id
integer
required
Order ID

Example

curl -X GET https://your-domain.com/api/v2/invoice/download/123 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --output invoice-123.pdf

Refund Requests

Get Refund Request List

Send Refund Request

order_detail_id
integer
required
Order detail ID
refund_reason
string
required
Reason for refund
refund_amount
number
Requested refund amount

Order Tracking

Orders go through the following delivery statuses:
  1. pending - Order placed, awaiting confirmation
  2. confirmed - Order confirmed by seller
  3. picked_up - Picked up by delivery person
  4. on_the_way - Out for delivery
  5. delivered - Successfully delivered
  6. cancelled - Order cancelled
Payment statuses:
  • unpaid - Payment not received
  • paid - Payment received

Order Response Structure

Typical order object includes:
id
integer
Order ID
code
string
Unique order code
user_id
integer
Customer ID
grand_total
number
Total order amount
payment_type
string
Payment method used
payment_status
string
Payment status (paid/unpaid)
delivery_status
string
Current delivery status
shipping_address
object
Shipping address details (JSON)
coupon_discount
number
Discount from coupon
shipping_type
string
Shipping method (home_delivery, pickup_point, carrier)
order_from
string
Order source (app, web)
date
integer
Order timestamp

Build docs developers (and LLMs) love