Stocks - Send instructions
Send release instructions for a held shipment
Stocks/{id}/instructions
This endpoint lets you send the courier the release instructions for a held shipment (redelivery, return to sender, etc.), an operation previously available only through the web interface.
POST https://api.gsped.it/[INSTANCE]/Stocks/{id}/instructions
The available instructions depend on the courier of the held shipment. Not all couriers support all actions, and some (e.g. UPS) do not allow release through this channel at all. See the Actions supported by courier table.
Path parameters
id*
int
ID of the held shipment to act on
Headers
x-api-key*
string
API key provided by Gsped
Content-Type*
string
application/json
Request body
action*
string
Instruction to apply. See Available actions.
notes
string
Free-text notes for the courier (max 65 characters, truncated if longer)
scheduled_date
string
Requested redelivery date, format YYYY-MM-DD (where supported by the courier)
new_address
object
New delivery address. Required when action is retry_new_address.
options
object
Additional options ("detailed" couriers only: BRT, GLS, FedEx, DHL). See Options.
new_address object
name
string
Recipient name (max 30)
address
string
Address (max 35)
city
string
City (max 40)
province
string
Province, abbreviation (max 2)
postal_code
string
Postcode (max 5)
phone
string
Phone (max 20, where supported)
options object
Available only for "detailed" couriers (BRT, GLS, FedEx, DHL); ignored by the others.
phone_prenotification
bool
Redelivery with phone notice
cancel_cash_on_delivery
bool
Cancel the cash on delivery (COD)
change_cod_amount
decimal
New cash on delivery (COD) amount
change_shipping_terms
string
Shipping terms: franco or assegnato
charge_to_sender
bool
Costs charged to the sender
charge_to_recipient
bool
Costs charged to the recipient
Available actions
retry_same_address
Redeliver to the same address
retry_new_address
Deliver to a new address (requires new_address)
return_to_sender
Return to sender
hold_at_depot
Keep on hold at depot at the branch
destroy
Destroy the goods
deliver_with_reserve
Deliver accepting a specific reservation
deliver_without_reserve
Deliver without adding a reservation
recipient_pickup
The recipient collects the goods at the branch
Actions supported by courier
retry_same_address
✓
✓
✓
retry_new_address
✓
✓
✓
return_to_sender
✓
✓
✓
hold_at_depot
✓
destroy
✓
deliver_with_reserve
✓
deliver_without_reserve
✓
recipient_pickup
✓
The options are available only for the BRT / GLS / FedEx / DHL column. UPS is not supported.
Example code snippets
Last updated
