Orders

GET

Retrieves all orders for the authenticated user.

get
Responses
200
Orders retrieved successfully
application/json
get
GET /orders HTTP/1.1
Host: 
Accept: */*
[
  {
    "id": 1,
    "userId": 1,
    "date": "2023-01-01T00:00:00Z",
    "products": [
      {
        "id": 1,
        "name": "Product Name",
        "quantity": 2,
        "priceInCents": 1000
      }
    ],
    "amountInCents": 2000,
    "clientSecret": "client_secret",
    "status": "pending"
  }
]

Retrieves a demo cart with sample products.

get
Responses
200
Demo cart retrieved successfully
application/json
get
GET /orders/demo-cart HTTP/1.1
Host: 
Accept: */*
200

Demo cart retrieved successfully

[
  {
    "id": 1,
    "name": "Product Name",
    "quantity": 2,
    "priceInCents": 1000
  }
]

Retrieves an order by its ID for the authenticated user.

get
Path parameters
idnumberRequired
Responses
200
Order retrieved successfully
application/json
get
GET /orders/{id} HTTP/1.1
Host: 
Accept: */*
{
  "id": 1,
  "userId": 1,
  "date": "2023-01-01T00:00:00Z",
  "products": [
    {
      "id": 1,
      "name": "Product Name",
      "quantity": 2,
      "priceInCents": 1000
    }
  ],
  "amountInCents": 2000,
  "clientSecret": "client_secret",
  "status": "pending"
}

POST

Creates a new order for the authenticated user.

post
Bodystring[]
string[]Optional
Responses
201
Order created successfully
application/json
post
POST /orders/new HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 8

[
  "text"
]
{
  "id": 1,
  "userId": 1,
  "date": "2023-01-01T00:00:00Z",
  "products": [
    {
      "id": 1,
      "name": "Product Name",
      "quantity": 2,
      "priceInCents": 1000
    }
  ],
  "amountInCents": 2000,
  "clientSecret": "client_secret",
  "status": "pending"
}

Updates the status of an order.

post
Body
orderIdnumberRequired

ID of the order

Example: 123
statusstring · enumRequired

Status of the order

Example: PendingPossible values:
Responses
200
Order status updated successfully
application/json
post
POST /orders/status-update HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "orderId": 123,
  "status": "Pending"
}
{
  "id": 1,
  "status": "completed"
}

PUT

Updates the order of lead statuses.

put
Bodyobject[]
idnumberOptionalExample: 1
statusOrdernumberOptionalExample: 1
Responses
200
Lead statuses order updated successfully
application/json
put
PUT /leads/statuses/order HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "id": 1,
  "statusOrder": 1
}
[
  {
    "id": 1,
    "statusOrder": 1
  }
]

Last updated