Scheda dell'endpoint
POST /1.0/shipments/create
Create a shipment
Shipments
POST
Endpoint
Scegli l'ambiente e l'indirizzo cambia con lui.
http://173.249.30.252/spedireweb/api/1.0/shipments/create
Richiesta
Quelli segnati come necessari non si possono omettere.
| Nome | Dove | Tipo | Serve | Descrizione |
|---|---|---|---|---|
| Authorization | header | string | Sì | Bearer access token. Example: Bearer <TOKEN>. |
| Accept | header | string | Sì | Expected response format. |
| Content-Type | header | string | No | Request body format when a JSON body is sent. |
Authorization
Serve
header
string
Bearer access token. Example: Bearer <TOKEN>.
Accept
Serve
header
string
Expected response format.
Content-Type
header
string
Request body format when a JSON body is sent.
Esempio richiesta
Metti il tuo token dove c'è scritto TOKEN.
curl -X POST "http://173.249.30.252/spedireweb/api/1.0/shipments/create" \
-H "Authorization: Bearer <TOKEN>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{\"sender\":{\"city\":1},\"receiver\":{\"city\":2},\"shipping\":[{\"depth\":10,\"width\":10,\"height\":10,\"weight\":1}],\"payment_type\":\"wallet\",\"rate_card_id\":123}'
Corpo richiesta
{
"sender": {
"city": 1
},
"receiver": {
"city": 2
},
"shipping": [
{
"depth": 10,
"width": 10,
"height": 10,
"weight": 1
}
],
"payment_type": "wallet",
"rate_card_id": 123
}
Risposta
Un blocco per ogni risposta che l'endpoint può dare.
{
"success": true
}
{
"error": {
"code": "REQUEST_1001",
"message": "Invalid request."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "AUTH_1001",
"message": "Authentication required."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "AUTH_1003",
"message": "Permission denied."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "APP_1004",
"message": "Resource not found."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "VALIDATION_1001",
"message": "Validation failed."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "RATE_LIMIT_1001",
"message": "Too many requests."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
{
"error": {
"code": "SERVER_1001",
"message": "Internal server error."
},
"success": false,
"request_id": "req_01k5example000000000000000"
}
Da sapere
Requires shipments.create. Creates and pays for a final scope 1 shipment for the authenticated API-key owner. Set payment_type to wallet or business; no separate payments.charge permission is required. Use /1.0/drafts/create when you want to save a draft first. Requires a Bearer access token.