Skip to content

Get User Orders

Get all orders for the authenticated user, grouped by payment.

Endpoint

GET /v1/products/order/user/

Authentication

Required (User role)

Request Body

No body required.

Response

Success (200 OK)

Returns an array of payment groups, each containing payment details and associated orders:

[
  {
    "payment": {
      "id": 1,
      "user_id": 5,
      "order_id": "ORDER123456",
      "amount": 150.00,
      "currency_name": "AZN",
      "status": "2",
      "transaction_id": "TRANS123",
      "card_number": "4111******1111",
      "created": "2025-01-15T10:30:00Z"
    },
    "orders": [
      {
        "id": 1,
        "user_id": 5,
        "store_id": 3,
        "product_variant_id": 10,
        "quantity": 2,
        "price": 75.00,
        "currency_name": "AZN",
        "payment_status": "1",
        "status": "1",
        "address": {...},
        "product_variant": {...},
        "store": {...},
        "created": "2025-01-15T10:30:00Z"
      }
    ]
  }
]

Error Responses

Unauthorized (401)

{
  "error": "Missing token on header!"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/products/order/user/" \
  -H "Authorization: Token your_access_token"

Notes

  • Only returns orders with successful payments (status: "2")
  • Only returns orders that are not cancelled (status != "7")
  • Orders are grouped by payment transaction
  • Results are ordered by payment order ID descending (newest first)
  • Includes full order details with product, store, and address information