Create Order
POSThttps://api.sandbox.daslab.health/v3/orders
Creates an order.
Request
- application/json
Body
required
address object[]required
customer object
placerId stringrequired
The order id within the placer's database.
products object[]required
consents string[]
Order consents
Responses
- 201
- 400
- 401
- 409
Created successfully.
- application/json
- Schema
- Example (from schema)
- Example
Schema
address object[]required
createdAt date-timerequired
customer objectrequired
id uuidrequired
organizationId uuidrequired
placerId stringrequired
products object[]required
reference stringnullablerequired
statuses object[]required
updatedAt date-timerequired
{
"address": [
{
"city": "string",
"country": "string",
"line": [
"string"
],
"postalCode": "string",
"use": "string",
"phone": "string"
}
],
"createdAt": "2024-06-27T13:57:15.152Z",
"customer": {
"email": "string",
"firstName": "string",
"lastName": "string",
"dateOfBirth": "string",
"gender": "string",
"isPatient": true,
"insuranceNumber": "string",
"id": "string",
"createdAt": "string",
"updatedAt": "string"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"organizationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"placerId": "string",
"products": [
{
"id": "string",
"name": "string",
"orderProductId": "string",
"sku": "string",
"specimens": [
{
"containerId": "string"
}
],
"statuses": [
{
"createdAt": "string",
"value": "string"
}
],
"trackingCompany": "string",
"trackingId": "string",
"trackingUrl": "string"
}
],
"reference": "string",
"statuses": [
{
"createdAt": "string",
"value": "string"
}
],
"updatedAt": "2024-06-27T13:57:15.152Z"
}
{
"address": [
{
"city": "Berlin",
"phone": null,
"country": "DE",
"line": [
"Friedrichstrasse 1"
],
"postalCode": "80801",
"use": "home"
},
{
"city": "Berlin",
"phone": null,
"country": "DE",
"line": [
"Friedrichstrasse 1"
],
"postalCode": "80801",
"use": "billing"
}
],
"createdAt": "2023-06-20T16:42:57.000Z",
"customer": {
"createdAt": "2023-06-20T16:39:24.479Z",
"email": "erika@example.com",
"id": "535cc664-e056-4ee3-95a1-31534ffaac5c",
"firstName": "Erika",
"lastName": "Spielmann",
"isPatient": true,
"gender": "female",
"dateOfBirth": "1945-12-10",
"updatedAt": "2023-06-20T16:39:24.479Z"
},
"id": "2212f50a-00ae-49ef-a4f4-9179626d6511",
"organizationId": "17ebfb0781c-8aa96f99-e785-48bb-a3b0-1c8a3d149689",
"placerId": "c84387e9-a2e7-4a9a-bf87-1529e079e156",
"products": [
{
"id": "d5e94406-efe6-47ec-b853-fc4485d726c1",
"name": "Chlamydia Single",
"sku": "ZAV-STI-01",
"orderProductId": "7c960abc-d0c4-4a6d-a80a-1e4164584f15",
"specimens": [
{
"containerId": "TESTSYLBXK"
}
],
"trackingId": "02925033455639S",
"trackingCompany": "DPD",
"trackingUrl": "https://tracking.dpd.de/parcelstatus?query=02925033455639S&locale=de_DE",
"statuses": [
{
"createdAt": "2023-06-20T16:42:57.001Z",
"value": "created"
}
]
}
],
"reference": "DEVYFSMR",
"statuses": [
{
"createdAt": "2023-06-20T16:42:57.898Z",
"value": "created"
}
],
"updatedAt": "2023-06-20T16:42:57.898Z"
}
The request was unacceptable. Usually due to parameters being missing or being sent in an invalid format.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error string
Default value: Bad Request
messages string[]
statusCode integer
Default value: 400
{
"error": "Bad Request",
"messages": [
"string"
],
"statusCode": 400
}
{
"error": "Bad Request",
"messages": [
"address must contain at least 1 elements",
"address must be an array",
"customer should not be null or undefined",
"placerId should not be empty",
"placerId must be a string",
"products must contain at least 1 elements",
"products must be an array"
],
"statusCode": 400
}
JWT is either missing, invalid, or expired.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error string
Default value: Unauthorized
messages string[]
statusCode integer
Default value: 401
{
"error": "Unauthorized",
"messages": [
"string"
],
"statusCode": 401
}
{
"error": "Unauthorized",
"messages": [
"Invalid JWT"
],
"statusCode": 401
}
The order could not be created because there is already an order for the same product id and insurance number which has not been completed nor cancelled.
- application/json
- Schema
- Example (from schema)
- Example
Schema
error string
Default value: Conflict
messages string[]
statusCode integer
Default value: 409
{
"error": "Conflict",
"messages": [
"string"
],
"statusCode": 409
}
{
"error": "Conflict",
"messages": [
"Open order for product id c84387e9-a2e7-4a9a-bf87-1529e079e152 with insurance number 123456 already exists"
],
"statusCode": 409
}
Authorization: http
name: bearertype: httpscheme: bearerbearerFormat: JWT
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.sandbox.daslab.health/v3/orders' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"address": [
{
"city": "string",
"country": "string",
"line": [
"string"
],
"postalCode": "string",
"use": "string",
"phone": "string"
}
],
"customer": {
"email": "string",
"firstName": "string",
"lastName": "string",
"dateOfBirth": "string",
"gender": "string",
"isPatient": true,
"insuranceNumber": "string"
},
"placerId": "string",
"products": [
{
"id": "string",
"sku": "string"
}
],
"consents": [
"string"
]
}'
ResponseClear