POST /delivery-receipt

Crée un nouveau bon de livraison.

Numérotation automatique

Le numéro est attribué automatiquement lorsque le bon passe en état validé (waiting, shipped, delivered). Un bon en brouillon (draft) n'a pas de numéro.

Structure des lignes

Les lignes peuvent être de deux types :

  • product : Ligne produit avec quantité, référence, poids
  • header : Ligne de séparation/titre pour organiser le bon

Lien avec devis/facture

Vous pouvez créer un bon de livraison depuis un devis via /quote/{uid}/delivery-receipt ou depuis une facture via /invoice/{uid}/delivery-receipt.

Événement déclenché

Un événement CREATE_RECEIPT est émis après la création.

application/json

Body Required

  • client string Required

    Référence du client (obligatoire)

  • client_name string

    Nom du client (copié du client si non fourni)

  • client_address string

    Adresse de livraison

  • client_city string

    Ville de livraison

  • client_zip_code string

    Code postal

  • client_country string

    Pays de livraison

    Default value is France.

  • client_email string

    Email du client (pour envoi du bon)

  • date string(date-time)

    Date du bon (par défaut aujourd'hui)

  • shipping_date string(date-time)

    Date d'expédition prévue

  • state string

    État initial du bon

    Values are draft, waiting, shipped, or delivered. Default value is draft.

  • lines array[object]

    Lignes du bon de livraison

    Hide lines attributes Show lines attributes object
    • title string

      Titre de la ligne

    • description string

      Description détaillée

    • quantity number

      Quantité

      Default value is 1.

    • reference string

      Référence produit

    • type string

      Type de ligne :

      • product : Ligne produit standard
      • header : Ligne de titre/séparation

      Values are product or header. Default value is product.

    • weight number

      Poids unitaire (en kg)

    • order integer

      Ordre d'affichage de la ligne

  • title string

    Description courte ou libellé du bon

  • type string

    Type de document (delivery par défaut)

    Value is delivery. Default value is delivery.

Responses

  • 201 application/json

    Bon de livraison créé avec succès

    Hide response attribute Show response attribute object
    • newReceipt object
      Hide newReceipt attributes Show newReceipt attributes object
      • _id string

        Unique identifier for the delivery receipt

      • client string

        Reference to the client

      • client_name string

        Name of the client

      • client_contact string

        Contact person at the client

      • client_email string

        Email of the client

      • client_mobile string

        Mobile phone of the client

      • comment string

        Additional comments

      • company string

        Reference to the company

      • company_name string

        Name of the company

      • date string(date-time)

        Date of the delivery receipt

      • delivery_address string

        Delivery address

      • delivery_city string

        Delivery city

      • delivery_country string

        Delivery country

      • delivery_zip_code string

        Delivery zip code

      • delivery_date string

        Delivery date

      • fromInvoice string

        Reference to the invoice if created from an invoice

      • fromQuote string

        Reference to the quote if created from a quote

      • lines array[object]

        List of delivery receipt lines

        Hide lines attributes Show lines attributes object
        • description string

          Description of the line

        • quantity number

          Quantity

          Default value is 1.

        • reference string

          Reference of the product

        • title string

          Title of the line

        • type string

          Type of the line

          Values are product or header. Default value is product.

        • weight number

          Weight of the product

      • number string

        Receipt number

      • numberOrder string

        Order number

      • notes string

        Additional notes

      • shipping_date string(date-time)

        Shipping date

      • shipping_method string

        Shipping method

      • shippingNbPackages number

        Number of packages

      • state string

        State of the delivery receipt

        Values are draft, waiting, shipped, delivered, refused, canceled, or inactive. Default value is draft.

      • title string

        Short description or label of the delivery receipt

      • totalWeight number

        Total weight of all products

      • totalQuantity number

        Total quantity of all products

        Default value is 0.

      • type string

        Type of the receipt

        Value is delivery. Default value is delivery.

  • 400

    Requête invalide - Client manquant ou données incorrectes

  • 403

    Non autorisé - Droits insuffisants pour créer un bon

POST /delivery-receipt
curl \
 --request POST 'https://wuro.pro/api/v3.2/delivery-receipt' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"client":"string","client_name":"string","client_address":"string","client_city":"string","client_zip_code":"string","client_country":"France","client_email":"string","date":"2025-05-04T09:42:00Z","shipping_date":"2025-05-04T09:42:00Z","state":"draft","lines":[{"title":"string","description":"string","quantity":1,"reference":"string","type":"product","weight":42.0,"order":42}],"title":"string","type":"delivery"}'
Request examples
{
  "client": "string",
  "client_name": "string",
  "client_address": "string",
  "client_city": "string",
  "client_zip_code": "string",
  "client_country": "France",
  "client_email": "string",
  "date": "2025-05-04T09:42:00Z",
  "shipping_date": "2025-05-04T09:42:00Z",
  "state": "draft",
  "lines": [
    {
      "title": "string",
      "description": "string",
      "quantity": 1,
      "reference": "string",
      "type": "product",
      "weight": 42.0,
      "order": 42
    }
  ],
  "title": "string",
  "type": "delivery"
}
Response examples (201)
{
  "newReceipt": {
    "_id": "string",
    "client": "string",
    "client_name": "string",
    "client_contact": "string",
    "client_email": "string",
    "client_mobile": "string",
    "comment": "string",
    "company": "string",
    "company_name": "string",
    "date": "2025-05-04T09:42:00Z",
    "delivery_address": "string",
    "delivery_city": "string",
    "delivery_country": "string",
    "delivery_zip_code": "string",
    "delivery_date": "string",
    "fromInvoice": "string",
    "fromQuote": "string",
    "lines": [
      {
        "description": "string",
        "quantity": 1,
        "reference": "string",
        "title": "string",
        "type": "product",
        "weight": 42.0
      }
    ],
    "number": "string",
    "numberOrder": "string",
    "notes": "string",
    "shipping_date": "2025-05-04T09:42:00Z",
    "shipping_method": "string",
    "shippingNbPackages": 42.0,
    "state": "draft",
    "title": "string",
    "totalWeight": 42.0,
    "totalQuantity": 0,
    "type": "delivery"
  }
}