Intercode SaaS Kit
  • Welcome to SaaS Starter Kit
  • Getting Started
    • Technology stack
    • Database Setup
    • Local Environment Setup
  • Basics
    • Dependencies
    • App architecture
    • Deployment
    • App roles
    • Endpoints List
      • Auth
      • Two Factor Auth
      • Businesses
      • Demo
      • Email
      • Export Document
      • Email Files
      • Files Demo
      • Leads
      • Orders
      • Payments
      • Subscriptions
      • Teams
      • Team Memberships
      • User Admin
  • Animation and Styles
    • Framer Motion
    • Ant Design and Styles
  • Pages
    • Auth
      • Working with PassportJS
      • Two-Factor Auth
      • OAuth Providers
    • Leads
    • Businesses
    • Team management
      • Ownership
    • Profile
    • User Settings
      • App Tour
    • App Settings
      • Lead Statuses
    • Dashboard
      • Lead volume widget
      • Doughnut chart widget
      • Recent leads table widget
      • Lead count over period widget
    • Demo
  • Features
    • Impersonation
    • Subscriptions (Stripe)
    • Search
    • Sentry
    • Captcha
    • Audit Logs
    • Internationalization
  • External integrations
    • Mailer
    • Google oAuth2
    • Facebook oAuth2
    • S3 compatible storage (AWS, MinIO)
Powered by GitBook
On this page
  1. Basics
  2. Endpoints List

Orders

PreviousLeadsNextPayments

Last updated 6 months ago

GET

POST

PUT

Retrieves all orders for the authenticated user.

get
Responses
200
Orders retrieved successfully
application/json
401
Unauthorized
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
401
Unauthorized
application/json
404
Order not found
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"
}
  • GET
  • GETRetrieves all orders for the authenticated user.
  • GETRetrieves a demo cart with sample products.
  • GETRetrieves an order by its ID for the authenticated user.
  • POST
  • POSTCreates a new order for the authenticated user.
  • POSTUpdates the status of an order.
  • PUT
  • PUTUpdates the order of lead statuses.

Creates a new order for the authenticated user.

post
Body
string[]Optional
Responses
201
Order created successfully
application/json
400
Invalid order data
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
400
Invalid order status data
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"
}

Updates the order of lead statuses.

put
Body
idnumberOptionalExample: 1
statusOrdernumberOptionalExample: 1
Responses
200
Lead statuses order updated successfully
application/json
500
Internal server error
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
  }
]