PATCH /purchase/{uid}

Met à jour un achat existant.

Vous pouvez modifier :

  • Les informations fournisseur
  • Les lignes de l'achat
  • Les dates et échéances
  • L'état (pour marquer comme payé, etc.)

Événement déclenché

Un événement UPDATE_PURCHASE est émis après la mise à jour.

Path parameters

  • uid string Required

    Identifiant unique de l'achat

application/json

Body Required

  • invoiceNumber string
  • date string(date-time)
  • supplier string
  • supplier_name string
  • supplier_code string
  • supplierTvaNumber string
  • supplierReverseCharge boolean
  • total_ht number
  • total_ttc number
  • total_tva number
  • currency string
  • state string

    Values are draft, waiting, paid, to_pay, or notpaid.

  • type string

    Values are purchase or purchase_credit.

  • lines array[object]
    Hide lines attributes Show lines attributes object
    • title string
    • totalHt number
    • totalTva number
    • totalTtc number
    • tvaRate number
    • type string
  • payments array[object]
    Hide payments attributes Show payments attributes object
    • mode string
    • amount number
    • date string(date-time)
  • payment_date string(date-time)
  • payment_expiry_date string(date-time)
  • categories array[string]
  • analytical_code string

Responses

  • 200 application/json

    Achat mis à jour avec succès

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

        Unique identifier for the purchase

      • number string

        Purchase number

      • invoiceNumber string

        Supplier invoice number

      • date string(date-time)

        Purchase date

      • dateRecord string(date-time)

        Record date

      • company string

        Reference to the company

      • supplier string

        Reference to supplier (client)

      • supplier_name string

        Supplier name

      • supplier_code string

        Supplier code

      • supplierTvaNumber string

        Supplier VAT number

      • supplierReverseCharge boolean

        Reverse charge applicable

        Default value is false.

      • total_ht number

        Total without tax

      • total_ttc number

        Total with tax

      • total_tva number

        Total VAT amount

      • base_currency string

        Default value is EUR.

      • currency string

        Default value is EUR.

      • state string

        Values are draft, waiting, paid, to_pay, notpaid, or inactive. Default value is waiting.

      • type string

        Values are purchase_old, purchase, or purchase_credit. Default value is purchase.

      • lines array[object]
        Hide lines attributes Show lines attributes object
        • title string
        • totalHt number
        • totalTva number
        • totalTtc number
        • tvaRate number
        • tva string
        • type string

          Default value is product.

      • payments array[object]
        Hide payments attributes Show payments attributes object
        • mode string
        • method_name string
        • amount number
        • currency string
        • date string(date-time)
        • check_number string
      • payment_date string(date-time)
      • payment_expiry_date string(date-time)
      • payment_methods array[string]
      • categories array[string]

        Purchase category references

      • VatRates array[object]
        Hide VatRates attributes Show VatRates attributes object
        • amount number

          Amount of VAT

        • rate string

          VAT rate

        • total number

          Total amount with this VAT rate

      • url string

        Attached file URL

      • exported boolean

        Default value is false.

      • exportedFEC boolean

        Default value is false.

      • exportedPDF boolean

        Default value is false.

      • bank_reconciliations array[string]
      • bank_reconciliation_status string

        Values are unreconciliated, reconciliated, or partialreconciliated. Default value is unreconciliated.

      • bank_reconciliate_total number
      • creditForPurchase string

        Reference to original purchase for credit notes

      • analytical_code string
      • createdAt string(date-time)
      • updatedAt string(date-time)
  • 400

    Requête invalide - Données incorrectes

  • 404

    Achat non trouvé

PATCH /purchase/{uid}
curl \
 --request PATCH 'https://wuro.pro/api/v3.2/purchase/{uid}' \
 --header "X-APP-ID: $API_KEY" \
 --header "X-APP-SECRET: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"invoiceNumber":"string","date":"2025-05-04T09:42:00Z","supplier":"string","supplier_name":"string","supplier_code":"string","supplierTvaNumber":"string","supplierReverseCharge":true,"total_ht":42.0,"total_ttc":42.0,"total_tva":42.0,"currency":"string","state":"draft","type":"purchase","lines":[{"title":"string","totalHt":42.0,"totalTva":42.0,"totalTtc":42.0,"tvaRate":42.0,"type":"string"}],"payments":[{"mode":"string","amount":42.0,"date":"2025-05-04T09:42:00Z"}],"payment_date":"2025-05-04T09:42:00Z","payment_expiry_date":"2025-05-04T09:42:00Z","categories":["string"],"analytical_code":"string"}'
Request examples
{
  "invoiceNumber": "string",
  "date": "2025-05-04T09:42:00Z",
  "supplier": "string",
  "supplier_name": "string",
  "supplier_code": "string",
  "supplierTvaNumber": "string",
  "supplierReverseCharge": true,
  "total_ht": 42.0,
  "total_ttc": 42.0,
  "total_tva": 42.0,
  "currency": "string",
  "state": "draft",
  "type": "purchase",
  "lines": [
    {
      "title": "string",
      "totalHt": 42.0,
      "totalTva": 42.0,
      "totalTtc": 42.0,
      "tvaRate": 42.0,
      "type": "string"
    }
  ],
  "payments": [
    {
      "mode": "string",
      "amount": 42.0,
      "date": "2025-05-04T09:42:00Z"
    }
  ],
  "payment_date": "2025-05-04T09:42:00Z",
  "payment_expiry_date": "2025-05-04T09:42:00Z",
  "categories": [
    "string"
  ],
  "analytical_code": "string"
}
Response examples (200)
{
  "updatedPurchase": {
    "_id": "string",
    "number": "string",
    "invoiceNumber": "string",
    "date": "2025-05-04T09:42:00Z",
    "dateRecord": "2025-05-04T09:42:00Z",
    "company": "string",
    "supplier": "string",
    "supplier_name": "string",
    "supplier_code": "string",
    "supplierTvaNumber": "string",
    "supplierReverseCharge": false,
    "total_ht": 42.0,
    "total_ttc": 42.0,
    "total_tva": 42.0,
    "base_currency": "EUR",
    "currency": "EUR",
    "state": "waiting",
    "type": "purchase",
    "lines": [
      {
        "title": "string",
        "totalHt": 42.0,
        "totalTva": 42.0,
        "totalTtc": 42.0,
        "tvaRate": 42.0,
        "tva": "string",
        "type": "product"
      }
    ],
    "payments": [
      {
        "mode": "string",
        "method_name": "string",
        "amount": 42.0,
        "currency": "string",
        "date": "2025-05-04T09:42:00Z",
        "check_number": "string"
      }
    ],
    "payment_date": "2025-05-04T09:42:00Z",
    "payment_expiry_date": "2025-05-04T09:42:00Z",
    "payment_methods": [
      "string"
    ],
    "categories": [
      "string"
    ],
    "VatRates": [
      {
        "amount": 42.0,
        "rate": "string",
        "total": 42.0
      }
    ],
    "url": "string",
    "exported": false,
    "exportedFEC": false,
    "exportedPDF": false,
    "bank_reconciliations": [
      "string"
    ],
    "bank_reconciliation_status": "unreconciliated",
    "bank_reconciliate_total": 42.0,
    "creditForPurchase": "string",
    "analytical_code": "string",
    "createdAt": "2025-05-04T09:42:00Z",
    "updatedAt": "2025-05-04T09:42:00Z"
  }
}