Adds a response to a requested delivery and changes the delivery status. Multiple responses may be sent to update the reference, schedule date, product availability or the actual unit price.
Customers may receive email notifications for new responses. Please avoid sending updates for each item individually.
Request
POST /deliveries/:id/responses
Parameters
id
: The delivery identifier
Status codes
200
on success400
if the request is invalid404
if no delivery with the givenid
was found
Request properties
All properties are optional, except for the
type
.
type
: One of"ACCEPT"
,"REJECT"
or"UPDATE"
reference
: The delivery reference to assignscheduled
: An alternative schedule date and time:date
: The date in the formatYYYY-MM-DD
time
: The optional time in the formatHH:mm
items
: An array of item objects with updated count or price:id
: The product IDcount
: The count of bundles, vessels or kilos actually deliveredbundle
: The bundle object:id
: The optional bundle identifiertype
: See vessel and bundle typessize
: The number of vessels in the bundle, or the number of bundles on the pallet iftype
is"PX"
pallet_bundle
: Only iftype
is"PX"
. Specifies the bundle on the pallet:type
: See vessel and bundle typessize
: The number of vessels in the bundle
price
: The actual unit price in cents
user
: The user who sent the response:name
: The name of the useremail
: The email address of the user
message
: A message provided by the user
All fields except type
are optional. When items
are provided, all item
fields except id
are optional. Items without changes can be omitted.
Update types
"ACCEPT"
: Changes the delivery status to"ACCEPTED"
. Further responses with type"UPDATE"
or"REJECT"
may be sent."REJECT"
: Changes the delivery status to"REJECTED"
. No further responses are allowed. Thescheduled
field is not allowed. You may set all item counts to zero, if that is the reason for the rejection."UPDATE"
: Does not affect the delivery status. Updates can only be sent after accepting the delivery.
Response properties
The full delivery as returned by GET /deliveries/:id
.
Example request
{
"type": "ACCEPT",
"reference": "delivery-123",
"scheduled": {
"date": "2020-05-26",
"time": "12:30"
},
"items": [
{
"id": "1",
"count": 0
},
{
"id": "2",
"price": 700
},
{
"id": "3",
"count": 1,
"bundle": {
"type": "CT",
"size": 6
}
}
],
"user": {
"name": "Lieferant",
"email": "lieferant@mein-lieferant.ch"
},
"message": "Gerne!"
}