Ordering API
Authentication
All ordering endpoints require a valid session. Include your authentication token or session cookie in every request.
Create an Order
POST /orders/create
Creates a new order for a PCB circuit. Provide either a package_release_id
or the full circuit_json
. Optionally specify a customs_category
.
{
"package_release_id": "string (uuid, optional)",
"circuit_json": [ /* circuit JSON array, optional */ ],
"customs_category": "string (optional)"
}
Either package_release_id
or circuit_json
must be supplied.
Response
{
"order": {
"order_id": "string (uuid)",
"account_id": "string (uuid)",
"is_running": false,
"is_started": false,
"is_finished": false,
"error": null,
"has_error": false,
"created_at": "string (ISO timestamp)",
"started_at": "string (ISO timestamp or null)",
"completed_at": "string (ISO timestamp or null)",
"circuit_json": [ /* circuit JSON array */ ],
"customs_category": "string"
}
}
Example request:
curl -X POST https://api.tscircuit.com/orders/create \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"package_release_id": "123e4567-e89b-12d3-a456-426614174000"}'
Get Order Details
GET /orders/get
or POST /orders/get
Fetch details of a specific order.
Request parameters (query or JSON body):
{
"order_id": "string (uuid)"
}
Response
{
"order": {
"order_id": "string (uuid)",
"account_id": "string (uuid)",
"is_running": false,
"is_started": false,
"is_finished": false,
"error": null,
"has_error": false,
"created_at": "string (ISO timestamp)",
"started_at": "string (ISO timestamp or null)",
"completed_at": "string (ISO timestamp or null)",
"circuit_json": [ /* circuit JSON array */ ],
"customs_category": "string"
}
}
Example request:
curl -X GET "https://api.tscircuit.com/orders/get?order_id=123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer <token>"
Additional Notes
- Timestamps are returned in ISO-8601 format.
- Errors follow this structure:
{
"error_code": "string",
"message": "string"
}
Order Quote API
The Order Quote API lets you retrieve pricing quotes for PCB orders. Quotes include component pricing, PCB costs, shipping options, and overall totals.
Endpoint
Create an Order Quote
POST /order_quotes/create
Creates a new order quote for a PCB package release. Currently only the jlcpcb
vendor is supported.
Request body:
{
"package_release_id": "string (UUID)",
"vendor_name": "jlcpcb"
}
Response example:
{
"order_quote_id": "string (UUID)"
}
Get an Order Quote
GET /order_quotes/get?order_quote_id={uuid}
or POST /order_quotes/get
Request body:
{
"order_quote_id": "string (UUID)"
}
Response example:
{
"order_quote": {
"order_quote_id": "123e4567-e89b-12d3-a456-426614174000",
"vendor_name": "jlcpcb",
"is_completed": true,
"quoted_components": [
{
"manufacturer_part_number": "CC0603KRX7R9BB101",
"quantity": 10,
"total_cost": 0.5,
"available": true
}
],
"bare_pcb_cost": 20.0,
"shipping_options": [
{ "carrier": "dhl", "service": "express", "cost": 9.5 }
],
"total_cost_without_shipping": 25.0
}
}
Returns 404
if the quote is not found or not accessible.