Create Delivery
POSThttps://api.goodsdelivery.io/v1/deliveries
Authorization: x-api-key
name: x-api-keytype: apiKeyscopes: brand
in: header
To create a delivery, use this endpoint. Your request body should include a JSON object with several required fields. The endpoint also checks whether the provided zip codes for pick-up and destination are within the Goods coverage area.
Request
- application/json
Body
required
jobDetails objectrequired
consumer objectrequired
pickUp objectrequired
dropOff objectrequired
Responses
- 201
- 400
- 401
- 403
If all required fields are provided and the zip codes are valid, a success response with a code of 201, as well as an ID and Short ID, will be returned. Short ID of the delivery, which is more readable and human friendly ID primarily used in consumer communication.
- application/json
- Schema
- Example (from schema)
- Example
Schema
object objectrequired
{
"success": true,
"object": {
"id": "string",
"shortId": "string",
"trackingUrl": "string",
"labelUrl": "string"
}
}
{
"success": true,
"object": {
"id": "9vSVMvvj8VKLLUWuPZTG",
"shortId": "D23D21",
"trackingUrl": "https://tracking.goodsdelivery.io/D23D21",
"labelUrl": "https://storage.googleapis.com/goods-sandbox.appspot.com/labels%2FNjY2MWIyMTZkNjYxNmViZGM4NmI4YzMz"
}
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
Human readable error message.
Machine readable error message.
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
Human readable error message.
Machine readable error message.
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
Human readable error message.
Machine readable error message.
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.goodsdelivery.io/v1/deliveries' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-api-key: <API_KEY_VALUE>' \
--data-raw '{
"jobDetails": {
"serviceType": "SAME_DAY",
"scheduledDate": "2023-06-02",
"externalId": "string",
"brandId": "string",
"packagesTotalValueUsd": 0,
"packages": [
{
"volumeFt3": 0,
"weightLbs": 0,
"lengthIn": 0,
"widthIn": 0,
"heightIn": 0
}
],
"addons": [
"EXTRA_INSURANCE"
],
"note": "string",
"contactlessPreferred": true
},
"consumer": {
"firstName": "string",
"lastName": "string",
"phone": "string",
"email": "user@example.com"
},
"pickUp": {
"name": "string",
"address1": "string",
"address2": "string",
"city": "string",
"zipCode": "string",
"state": "string",
"country": "string",
"note": "string"
},
"dropOff": {
"name": "string",
"address1": "string",
"address2": "string",
"city": "string",
"zipCode": "string",
"state": "string",
"country": "string",
"note": "string"
}
}'