Connect API Documentation

https://connect.yourbarmate.com/api
Changelog

Respond to a delivery

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 success
  • 400 if the request is invalid
  • 404 if no delivery with the given id was found

Request properties

All properties are optional, except for the type.

  • type: One of "ACCEPT", "REJECT" or "UPDATE"
  • reference: The delivery reference to assign
  • scheduled: An alternative schedule date and time:
    • date: The date in the format YYYY-MM-DD
    • time: The optional time in the format HH:mm
  • items: An array of item objects with updated count or price:
    • id: The product ID
    • count: The count of bundles, vessels or kilos actually delivered
    • bundle: The bundle object:
      • id: The optional bundle identifier
      • type: See vessel and bundle types
      • size: The number of vessels in the bundle, or the number of bundles on the pallet if type is "PX"
      • pallet_bundle: Only if type is "PX". Specifies the bundle on the pallet:
    • price: The actual unit price in cents
  • user: The user who sent the response:
    • name: The name of the user
    • email: 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. The scheduled 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!"
}