Webhook

Vous pouvez, lors de la 2ème étape (Précommander la livraison), nous spécifier une URL de webhook. Un appel HTTPS POST sera ensuite effectué pour chacun des événements (event) ci-dessous :

  • state_changed : changement de statut de la livraison
  • slot_updated : modification du jour ou de l’heure de la livraison
  • address_updated : modification de l’adresse

Les différents statuts qui peuvent déclencher l’event state_changed : pre_ordered, confirmed, picked_up, pick_up_failed, delivered, delivery_failed, package_returned et canceled

Header HTTP

Par défaut nous n’avons pas d’entête spécifique. Si vous souhaitez sécuriser votre endpoint, il est possible de nous transmettre un (ou plusieurs) couple clé-valeur que nous intégrerons à l’entête de chaque appel.

Certificat SSL

L’URL spécifiée doit utiliser un certificat SSL valide.

Voici un exemple de JSON qui pourrait vous être envoyé :

{
  "delivery": {
    "uuid": "dabf2570-1e2c-4cc2-9293-28cad7444c41",
    "primary_order_reference": "12345",
    "secondary_order_reference": "",
    "packaging": {
      "global_description": "",
      "packaging_ref": "",
      "width": 10,
      "length": 10,
      "height": 10,
      "weight": 10,
      "packets_quantity": 5,
      "packets": []
    },
    "route": [
      {
        "type": "pickup",
        "location": {
          "type": "store",
          "society": "Lambda",
          "name": "John DOE",
          "first_name": "John",
          "last_name": "DOE",
          "line1": "271 rue de Solférino",
          "line2": "",
          "postal_code": "59000",
          "city": "Lille",
          "country": "France",
          "additional_informations": "",
          "primary_phone": "0707070707",
          "secondary_phone": "",
          "email": "john.doe@lambda.com",
          "store_code": "123"
        },
        "calendar": {
          "starts_at": "2018-10-10T15:00:00Z",
          "ends_at": "2018-10-10T17:00:00Z"
        }
      },
      {
        "type": "shipping",
        "location": {
          "type": "address",
          "society": "",
          "name": "Will SMITH",
          "first_name": "Will",
          "last_name": "SMITH",
          "line1": "2 Avenue des Saules",
          "line2": "BATIMENT Doge",
          "postal_code": "59160",
          "city": "LILLE",
          "country": "FRANCE",
          "additional_informations": "Euratechnologies",
          "primary_phone": "0606060606",
          "secondary_phone": "",
          "email": "will.smith@colisweb.com"
        },
        "calendar": {
          "starts_at": "2018-10-10T15:00:00Z",
          "ends_at": "2018-10-10T17:00:00Z"
        }
      }
    ],
    "status": {
      "global": "delivered",
      "pickup_problems": [],
      "shipping_problems": []
    },
    "post_purchase_url": "https://sandbox.api.colisweb.com/p/dabf2570-1e2c-4cc2-9293-28cad7444c41",
    "tracking_number": "123456",
    "required_skills": []
  },
  "event": "state_changed"
}