Create Return
POSThttps://api.goodsdelivery.io/v1/returns
Authorization: x-api-key
name: x-api-keytype: apiKeyscopes: brand
in: header
To create a return pick-up, 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.
- application/json
- Schema
- Example (from schema)
- Example
Schema
success booleanrequired
object objectrequired
{
"success": true,
"object": {
"id": "string",
"shortId": "string",
"trackingUrl": "string",
"labelUrl": "string"
}
}
{
"success": true,
"object": {
"id": "7vSVMvvj8VKLLUWuPZTa",
"shortId": "R23D21",
"trackingUrl": "https://tracking.goodsdelivery.io/R23D21",
"labelUrl": "https://storage.googleapis.com/goods-sandbox.appspot.com/labels%2FNjY2MWIyMTZkNjYxNmViZGM4NmI4YzMz"
}
}
Bad request
- application/json
- Schema
- Example (from schema)
Schema
message stringrequired
Human readable error message.
code stringrequired
Machine readable error message.
more url
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
message stringrequired
Human readable error message.
code stringrequired
Machine readable error message.
more url
More help on the error here.
{
"message": "string",
"code": "string",
"more": "string"
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
message stringrequired
Human readable error message.
code stringrequired
Machine readable error message.
more url
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/returns' \
-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"
}
}'
ResponseClear