Connect API Documentation

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

Read a delivery

Returns a single delivery with all available information for the given id.

Request

GET /deliveries/:id

Parameters

  • id: The delivery identifier

Status codes

  • 200 on success
  • 404 if no delivery with the given id was found

Response properties

  • id: The delivery identifier
  • type: One of "DELIVERY" or "RETURN"
  • status: One of "REQUESTED", "ACCEPTED", "REJECTED", "CANCELLED" or "DELIVERED"
  • customer: The customer object:
    • id: The customer ID
    • company: The name of the customer company, or null
    • address: The customer address object:
      • address1: The first line of the address
      • address2: The second line of the address, if provided
      • zip: The ZIP code
      • city: The city name
      • country: A country ISO code
    • contact: The customer contact object:
      • name: The name of the customer contact
      • email: The email address of the customer contact
  • request: The request object:
    • timestamp: The timestamp when the delivery was requested in ISO 8601 format
    • company: The requesting company name, or null
    • customer_id: The customer ID, or null
    • cost_center: The cost center, or null
    • address: The delivery address:
      • address1: The first line of the address
      • address2: The second line of the address, if provided
      • zip: The ZIP code
      • city: The city name
      • country: A country ISO code
    • user: The user who sent the delivery:
      • name: The name of the user
      • email: The email address of the user
    • scheduled: The desired schedule date and optional time, or null if none was specified:
      • date: The date in the format YYYY-MM-DD
      • time: The optional time in the format HH:mm
    • items: The array of item objects:
      • id: The product identifier
      • name: The product name
      • order_by: Only present if specified on the product. One of "vessel" or "kg".
      • vessel: The vessel object, if available (null if order_by is "kg"):
        • id: The custom vessel identifier
        • size: Size of the vessel in the specified unit
        • unit: One of "l", "dl", "cl", "ml", "kg", "g" or "quantity"
        • type: See vessel and bundle types
      • count: The count of bundles, vessels or kilos ordered. Always a whole number, unless order_by is set to "kg".
      • bundle: The bundle object, or null:
        • id: The custom 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:
      • vessel_count: The total count of vessels (count * bundle.size or count * bundle.size * bundle.pallet_bundle.size)
      • price: The expected unit price in cents
      • price_per: Only present if specified on the product. One of "vessel", "l", "kg" or "100g"
      • message: An optional message for the item provided by the user
    • message: An optional message for the delivery provided by the user
  • responses: An array of response objects:
    • type: Either "ACCEPT" or "REJECT"
    • timestamp: The timestamp when the response was received in ISO 8601 format
    • reference: An optional delivery reference
    • scheduled: Only when accepted, an optional alternative schedule date and time:
      • date: The date in the format YYYY-MM-DD
      • time: The optional time in the format HH:mm
    • items: Only when accepted, an optional array of item objects with updated count and price:
      • id: The product ID
      • count: The count of bundles or vessels actually available
      • bundle: The bundle object, or null:
        • id: The bundle identifier, if available
        • type: One of "box", "pack", "carton", "tray" or "pallet"
        • size: The number of vessels in the bundle
        • pallet_bundle: Only if type is "pallet". Specifies the bundle on the pallet:
          • type: One of "box", "pack", "carton" or "tray"
          • size: The number of vessels in the bundle
      • vessel_count: The total count of vessels (count * bundle.size or count * bundle.size * bundle.pallet_bundle.size)
      • price: The actual unit price in cents
    • user: An optional user who sent the response:
      • name: The name of the user
      • email: The email address of the user
    • message: An optional message provided by the user
  • cancelled: The cancel data:
    • timestamp: The timestamp when the delivery was cancelled in ISO 8601 format
    • user: The user who cancelled the delivery:
      • name: The name of the user
      • email: The email address of the user
    • message: A message provided by the user

Example response

{
"id": 123456789,
"type": "DELIVERY",
"status": "REQUESTED",
"customer": {
"id": "12345",
"company": "Mein Club AG",
"address": {
"address1": "Beispielstrasse 1",
"zip": "8045",
"city": "Zürich",
"country": "CH"
},
"contact": {
"name": "Besitzer",
"email": "besitzer@mein-club.ch"
}
},
"request": {
"timestamp": "2021-06-23T14:46:48.309Z",
"address": {
"address1": "Beispielstrasse 42",
"zip": "8045",
"city": "Zürich",
"country": "CH"
},
"scheduled": {
"date": "2020-05-26",
"time": "12:30"
},
"items": [
{
"id": "2",
"name": "Gin",
"vessel": {
"size": 7,
"unit": "dl"
},
"count": 2,
"bundle": {
"id": "001",
"type": "carton",
"size": 6
},
"vessel_count": 12,
"price": 750
}
],
"user": {
"name": "Lagerist",
"email": "lagerist@mein-club.ch"
},
"message": "Vielen Dank!"
},
"responses": [
{
"type": "ACCEPT",
"timestamp": "2021-06-23T14:46:48.309Z",
"reference": "delivery-123",
"scheduled": {
"date": "2020-05-26",
"time": "14:00"
},
"items": [
{
"id": "2",
"count": 1,
"bundle": {
"id": "002",
"type": "carton",
"size": 12
},
"vessel_count": 12,
"price": 720
}
],
"user": {
"name": "Lieferant",
"email": "lieferant@beispiel-lieferant.ch"
},
"message": "Gerne!"
}
]
}