Orders

Managing orders using API endpoints

Overview of Simplio3D API Orders Endpoints

The Simplio3D API provides a set of endpoints that allow users to manage orders efficiently. Among these endpoints, the GET /orders/{orderId} endpoint is specifically designed to retrieve detailed information about a particular order by its unique ID. This enables users to monitor and track individual orders, ensuring they have access to up-to-date status and details of their transactions.

For more information on utilizing the Orders endpoints, please refer to the API documentation for additional details and examples.

GET /orders/{orderId}

GET Endpoint: Retrieve an Order by ID

Endpoint URL

GET open-api/v1/orders/{orderId}

Description

Retrieve detailed information about a specific order using its unique identifier.

Path Parameter

  • orderId: The unique identifier for the order you wish to retrieve.

Response

  • 200 OK: Successfully retrieved the order details.

  • 404 Not Found: No order was found with the provided ID.

  • 500 Internal Server Error: An error occurred on the server.

Example Request

GET open-api/v1/orders/12345

Example Response

{
  "orderId": "12345",
  "customerName": "John Doe",
  "orderDate": "2023-10-05",
  "status": "Shipped",
  "items": [
    {
      "productId": "A100",
      "quantity": 2
    }
  ],
  "totalAmount": 150.00
}

Get order by ID

get

Get a specific order by ID.

Authorizations
Path parameters
idinteger · int64Required

ID of the order

Responses
200
Order retrieved successfully
get
GET /api/open-api/v1/orders/{id} HTTP/1.1
Host: app.simplio3d.com
Authorization: Bearer JWT
Accept: */*

No content

POST /orders

POST Endpoint: Create a New Order

Endpoint URL

POST /orders

Description

This endpoint allows you to create a new order in the system.

Request Headers

  • Content-Type: application/json

  • Authorization: Bearer <token>

Request Body

{
  "customer_id": "string",
  "product_id": "string",
  "quantity": "integer",
  "shipping_address": {
    "street": "string",
    "city": "string",
    "postcode": "string",
    "country": "string"
  }
}

Response

  • 200 OK: Order created successfully

    {
      "order_id": "string",
      "status": "string",
      "created_at": "datetime"
    }
  • 400 Bad Request: Invalid input data

  • 401 Unauthorized: Missing or invalid authentication token

Example

curl -X POST "https://api.simplio3d.com/orders" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "customer_id": "12345",
  "product_id": "67890",
  "quantity": 2,
  "shipping_address": {
    "street": "123 Main St",
    "city": "Anytown",
    "postcode": "12345",
    "country": "USA"
  }
}'

Create a new order

post

Create a new order.

Authorizations
Body
pricenumberRequired

Configurator total amount

Example: 3400
customer_detailsstringRequired

Customer details in JSON format

Example: {'First Name':'Jhon','Last Name':'Smith','Company':'Google Inc.','Address':'Wall Street'}
configurator_summarystringRequired

Configurator summary in JSON format

Example: {'Catalog':'Teacup classic','Material':'Glossy white','Quantity':'230'}
configurator_snapshotstring · binaryOptional

Configurator snapshot image file

configurator_print_mapstring · binary[]Optional

Array of print map image files

Responses
201
Order created successfully
application/json
post
POST /api/open-api/v1/orders HTTP/1.1
Host: app.simplio3d.com
Authorization: Bearer JWT
Content-Type: multipart/form-data
Accept: */*
Content-Length: 291

{
  "price": 3400,
  "customer_details": "{'First Name':'Jhon','Last Name':'Smith','Company':'Google Inc.','Address':'Wall Street'}",
  "configurator_summary": "{'Catalog':'Teacup classic','Material':'Glossy white','Quantity':'230'}",
  "configurator_snapshot": "binary",
  "configurator_print_map": [
    "binary"
  ]
}
{
  "id": 1,
  "price": 149.99,
  "status": "completed",
  "customer_details": {
    "name": "John Doe",
    "email": "[email protected]"
  },
  "configurator_summary": {
    "config_id": 123,
    "options": {
      "color": "red",
      "size": "L"
    }
  },
  "configurator_snapshot": "https://cdn.simplio3d.com/orders/107/original/print_snapshot.png",
  "configurator_print_map": [
    "https://cdn.simplio3d.com/orders/107/original/print_map_1.png"
  ],
  "invoice_url": "https://example.com/invoice/12345",
  "order_shopify": "SH123456789",
  "created_at": "2024-03-01T10:30:00Z",
  "updated_at": "2024-03-02T12:45:00Z"
}

GET /orders

GET Endpoint: Fetch All Orders

Endpoint URL

GET /open-api/v1/orders

Description

This endpoint retrieves a comprehensive list of all orders in the system, allowing users to manage and review order details efficiently.

Query Parameters

  • status (optional): Filter orders by their status (e.g., pending, completed).

  • limit (optional): Limit the number of orders returned.

  • offset (optional): Specify the starting point for the list of orders returned.

Headers

  • Authorization: Bearer token required for authentication.

Response

  • 200 OK: Successfully retrieved the list of orders.

    • Content: JSON array of order objects, each containing:

      • order_id: Unique identifier for the order.

      • customer_name: Name of the customer.

      • total_amount: Total amount of the order.

      • status: Current status of the order.

      • created_at: Timestamp of order creation.

    Example Request

    GET /open-api/v1/orders?status=pending&limit=10 HTTP/1.1
    Host: api.simplio3d.com
    Authorization: Bearer your-token-here

    Example Response

    [
        {
            "order_id": "12345",
            "customer_name": "John Doe",
            "total_amount": 250.00,
            "status": "pending",
            "created_at": "2023-09-12T10:20:30Z"
        },
        {
            "order_id": "12346",
            "customer_name": "Jane Smith",
            "total_amount": 135.75,
            "status": "completed",
            "created_at": "2023-09-11T08:15:00Z"
        }
    ]

    Error Responses

    • 401 Unauthorized: Authentication failed; token missing or invalid.

    • 500 Internal Server Error: An error occurred on the server.

Fetch all orders

get
Authorizations
Query parameters
per_pageintegerOptional

Number of results per page

Example: 25
pageintegerOptional

Number of page

Example: 2
order_bystringOptional

Field to sort orders by

Example: created_at
orderstring · enumOptional

Sort order (asc or desc)

Example: descPossible values:
configurator_idintegerOptional

Filter orders by specific configurator ID

Example: 127
start_datestring · dateOptional

Filter orders created after this date

Example: 2024-01-01
end_datestring · dateOptional

Filter orders created before this date

Example: 2024-12-31
Responses
200
Successful response
application/json
get
GET /api/open-api/v1/orders HTTP/1.1
Host: app.simplio3d.com
Authorization: Bearer JWT
Accept: */*
{
  "data": [
    {
      "configurator": {
        "id": 1,
        "configurator_name": "Custom 3D Configurator"
      }
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 25,
    "total": 200,
    "last_page": 8,
    "next_page_url": "https://api.example.com/orders?page=2",
    "prev_page_url": null
  }
}

Last updated

Was this helpful?