# ✏️ Update a draft invoice

Update an existing draft invoice.

Completely replaces the draft content with the provided data.
The draft will be re-validated after the update.

Endpoint: PUT /drafts/{draft_id}
Version: 0.29.6
Security: APIKeyHeader

## Path parameters:

  - `draft_id` (string, required)

## Header parameters:

  - `X-PDP-Client-Id` (string, required)
    ID of the PDP Client for which the operation is performed

## Request fields (application/json):

  - `specification_identifier` (any)
    Specification identifier (BT-24). None means no profile has been chosen yet - resolved to a concrete value at finalization (see resolve_draft_invoice_type).

  - `issue_date` (string, required)
    Invoice issue date (BT-2)

  - `due_date` (any)
    Payment due date (BT-9)

  - `type_code` (string, required)
    Enum: "380", "381", "383", "384", "389"

  - `currency_code` (string, required)
    Invoice currency code (BT-5) - ISO 4217

  - `tax_currency_code` (any)
    VAT accounting currency code (BT-6) - ISO 4217

  - `tax_point_date` (any)
    Tax point date (BT-7)

  - `value_added_tax_point_date` (any)
    Value added tax point date (BT-8)

  - `business_process_type` (any)
    Business process type (BT-23)

  - `buyer_reference` (any)
    Buyer reference (BT-10) - An identifier assigned by the buyer used for internal routing. Either buyer_reference or purchase_order_reference must be provided.

  - `purchase_order_reference` (any)
    Purchase order reference (BT-13)

  - `sales_order_reference` (any)
    Sales order reference (BT-14)

  - `receiving_advice_reference` (any)
    Receiving advice reference (BT-15)

  - `despatch_advice_reference` (any)
    Despatch advice reference (BT-16)

  - `tender_or_lot_reference` (any)
    Tender or lot reference (BT-17)

  - `invoice_object_identifier` (any)
    Invoiced object identifier (BT-18)

  - `buyer_accounting_reference` (any)
    Buyer accounting reference (BT-19)

  - `project_reference` (any)
    Project reference (BT-11)

  - `contract_reference` (any)
    Contract reference (BT-12)

  - `seller` (object, required)
    Seller party information (BG-4).

  - `seller.name` (string, required)
    Seller name

  - `seller.postal_address` (object, required)

  - `seller.postal_address.street_name` (any)

  - `seller.postal_address.additional_street_name` (any)

  - `seller.postal_address.city_name` (string, required)

  - `seller.postal_address.postal_zone` (any)

  - `seller.postal_address.country_subdivision` (any)

  - `seller.postal_address.country_code` (string, required)
    ISO 3166-1 alpha-2 country code

  - `seller.electronic_address` (any)

  - `seller.electronic_address.scheme_id` (string, required)
    Electronic address scheme identifier

  - `seller.electronic_address.value` (string, required)
    Electronic address

  - `seller.tax_registrations` (any)

  - `seller.tax_registrations.scheme_id` (string, required)
    Tax registration scheme (e.g., 'VAT')

  - `seller.tax_registrations.value` (string, required)
    Tax registration number

  - `seller.legal_registration_name` (any)

  - `seller.trading_name` (any)

  - `seller.party_identifier` (any)
    Party identifier

  - `seller.party_identifier_scheme` (any)
    Party identifier scheme

  - `seller.seller_identifier` (any)
    Seller identifier (BT-29)

  - `seller.seller_identifier_scheme` (any)
    Seller identifier scheme

  - `seller.seller_vat_identifier` (any)
    Seller VAT identifier (BT-31)

  - `seller.seller_tax_registration_identifier` (any)
    Seller tax registration identifier (BT-32)

  - `seller.seller_additional_legal_information` (any)
    Seller additional legal information (BT-33)

  - `buyer` (object, required)
    Buyer party information (BG-7).

  - `buyer.name` (string, required)
    Buyer name

  - `buyer.electronic_address` (any)

  - `buyer.tax_registrations` (any)

  - `buyer.legal_registration_name` (any)

  - `buyer.trading_name` (any)

  - `buyer.party_identifier` (any)
    Party identifier

  - `buyer.party_identifier_scheme` (any)
    Party identifier scheme

  - `buyer.buyer_identifier` (any)
    Buyer identifier (BT-46)

  - `buyer.buyer_identifier_scheme` (any)
    Buyer identifier scheme

  - `buyer.buyer_legal_registration_identifier` (any)
    Buyer legal registration identifier (BT-47)

  - `buyer.buyer_vat_identifier` (any)
    Buyer VAT identifier (BT-48)

  - `payee` (any)
    Payee party (BG-10)

  - `payee.name` (string, required)
    Payee name (BT-59)

  - `payee.identifier` (any)
    Payee identifier (BT-60)

  - `payee.identifier_scheme` (any)
    Payee identifier scheme

  - `payee.legal_registration_id` (any)
    Payee legal registration identifier (BT-61)

  - `payee.legal_registration_id_scheme` (any)
    Payee legal registration identifier scheme (BT-61 schemeID)

  - `seller_tax_representative` (any)
    Seller tax representative party (BG-11)

  - `seller_tax_representative.name` (string, required)
    Seller tax representative name (BT-62)

  - `seller_tax_representative.vat_identifier` (any)
    Seller tax representative VAT identifier (BT-63)

  - `invoice_lines` (array, required)
    Invoice lines (BG-25)

  - `invoice_lines.line_id` (string, required)
    Invoice line identifier

  - `invoice_lines.invoiced_quantity` (any, required)
    Invoiced quantity

  - `invoice_lines.unit_of_measure` (string, required)
    Unit of measure code (BT-130) - Must be valid UN/ECE Recommendation 20 code (BR-CL-23). Common codes: C62 (unit/piece), HUR (hour), DAY (day), MON (month), MTR (meter), KGM (kilogram), LTR (liter)

  - `invoice_lines.line_net_amount` (any, required)
    Invoice line net amount

  - `invoice_lines.item_name` (string, required)
    Item name

  - `invoice_lines.item_description` (any)

  - `invoice_lines.item_seller_identifier` (any)
    Item Seller's identifier (BT-155)

  - `invoice_lines.item_buyer_identifier` (any)
    Item Buyer's identifier (BT-156)

  - `invoice_lines.item_standard_identifier` (any)
    Item standard identifier (BT-157), e.g. GTIN

  - `invoice_lines.item_standard_identifier_scheme` (any)
    Scheme identifier for BT-157 (BT-157-1), e.g. 0160 for GTIN

  - `invoice_lines.item_classification_identifiers` (any)
    Item classification identifiers (BT-158), e.g. UNSPSC codes

  - `invoice_lines.item_price` (any, required)
    Item net price

  - `invoice_lines.item_price_discount` (any)
    Item price discount (BT-147) - subtracted from the gross price (BT-148) to obtain the net price (BT-146). Requires item_gross_price.

  - `invoice_lines.item_gross_price` (any)
    Item gross price (BT-148) - the unit price before the item price discount (BT-147)

  - `invoice_lines.item_price_base_quantity` (any)
    Item price base quantity (BT-149) - The number of item units to which the price applies. When set, line_net_amount = (invoiced_quantity × item_price) / item_price_base_quantity. Useful for prices expressed per 100 or 1000 units to avoid rounding errors. Defaults to 1.

  - `invoice_lines.item_price_base_quantity_unit` (any)
    Item price base quantity unit of measure code (BT-150). Must be a valid UN/ECE Recommendation 20 code. Defaults to unit_of_measure if not set.

  - `invoice_lines.vat_category_code` (string, required)
    VAT category code (BT-118), the UNTDID 5305 subset rule G2.31 accepts.

The two remaining UNTDID 5305 entries, L (Canary Islands) and M (Ceuta and Melilla), are
excluded: G2.31 lists them as not relevant to France.
    Enum: "S", "Z", "E", "AE", "K", "G", "O"

  - `invoice_lines.vat_rate` (any)
    VAT rate as percentage

  - `invoice_lines.allowances` (any)
    Invoice line allowances (BG-27) — per-line commercial discounts. Each amount (BT-136) is subtracted from the line net amount; the discount nature is implicit in this list.

  - `invoice_lines.allowances.amount` (any, required)
    Invoice line allowance amount (BT-136)

  - `invoice_lines.allowances.base_amount` (any)
    Invoice line allowance base amount (BT-137)

  - `invoice_lines.allowances.percentage` (any)
    Invoice line allowance percentage (BT-138)

  - `invoice_lines.allowances.reason` (any)
    Invoice line allowance reason (BT-139)

  - `invoice_lines.allowances.reason_code` (any)
    Invoice line allowance reason code (BT-140), from UNTDID 5189

  - `invoice_lines.charges` (any)
    Invoice line charges (BG-28) — per-line surcharges or assimilated taxes (e.g. eco-contribution). Each amount (BT-141) is added to the line net amount.

  - `invoice_lines.charges.amount` (any, required)
    Invoice line charge amount (BT-141)

  - `invoice_lines.charges.base_amount` (any)
    Invoice line charge base amount (BT-142)

  - `invoice_lines.charges.percentage` (any)
    Invoice line charge percentage (BT-143)

  - `invoice_lines.charges.reason` (any)
    Invoice line charge reason (BT-144)

  - `invoice_lines.charges.reason_code` (any)
    Invoice line charge reason code (BT-145), from UNTDID 7161

  - `vat_breakdowns` (array, required)
    VAT breakdown (BG-23)

  - `vat_breakdowns.rate` (any)
    VAT rate as percentage

  - `vat_breakdowns.taxable_amount` (any, required)
    VAT taxable amount

  - `vat_breakdowns.tax_amount` (any, required)
    VAT amount

  - `vat_breakdowns.exemption_reason` (any)

  - `vat_breakdowns.exemption_reason_code` (any)
    VAT exemption reason code (BT-121), e.g. a CEF VATEX code

  - `document_totals` (object, required)

  - `document_totals.sum_of_line_net_amounts` (any, required)
    Sum of Invoice line net amount (BT-106)

  - `document_totals.sum_of_allowances` (any)
    Sum of allowances on document level

  - `document_totals.sum_of_charges` (any)
    Sum of charges on document level

  - `document_totals.invoice_total_without_vat` (any, required)
    Invoice total amount without VAT (BT-109)

  - `document_totals.invoice_total_vat_amount` (any, required)
    Invoice total VAT amount (BT-110)

  - `document_totals.invoice_total_with_vat` (any, required)
    Invoice total amount with VAT (BT-112)

  - `document_totals.paid_amount` (any)
    Paid amount

  - `document_totals.rounding_amount` (any)
    Rounding amount

  - `document_totals.amount_due_for_payment` (any, required)
    Amount due for payment (BT-115)

  - `payment_terms` (any)
    Payment instructions (BG-16)

  - `payment_terms.description` (any)
    Payment terms text (BT-20)

  - `payment_terms.due_date` (any)

  - `payment_means_type_code` (any)
    Payment means type code (BT-81)

  - `payment_means_text` (any)
    Payment means text (BT-82)

  - `remittance_information` (any)
    Remittance information (BT-83)

  - `payment_account_identifier` (any)
    Payment account identifier / IBAN (BT-84)

  - `payment_account_name` (any)
    Payment account name (BT-85)

  - `payment_service_provider_identifier` (any)
    Payment service provider identifier / BIC (BT-86)

  - `notes` (any)
    Invoice notes with optional subject codes (BT-22)

  - `notes.content` (string, required)
    Note content

  - `notes.subject_code` (any)
    Note subject code (e.g., PMT, PMD, AAB)

  - `order_reference` (any)
    Deprecated: use purchase_order_reference instead

  - `invoice_note` (any)
    Deprecated: use notes instead. Invoice note (BT-22)

  - `preceding_invoice_reference` (any)
    For credit notes - reference to original invoice (BT-25)

  - `preceding_invoice_issue_date` (any)
    For credit notes - issue date of the referenced original invoice (BT-26)

  - `delivery` (any)
    Delivery information (BG-13) and deliver to address (BG-15)

  - `delivery.deliver_to_party_name` (any)
    Deliver to party name (BT-70)

  - `delivery.location_identifier` (any)
    Deliver to location identifier (BT-71)

  - `delivery.location_identifier_scheme` (any)
    Scheme identifier for the deliver to location identifier (BT-71-1)

  - `delivery.actual_delivery_date` (any)
    Actual delivery date (BT-72)

  - `delivery.deliver_to_address` (any)
    Deliver to address (BG-15)

  - `delivery.deliver_to_address.address_line_1` (any)
    Deliver to address line 1 (BT-75)

  - `delivery.deliver_to_address.address_line_2` (any)
    Deliver to address line 2 (BT-76)

  - `delivery.deliver_to_address.address_line_3` (any)
    Deliver to address line 3 (BT-163)

  - `delivery.deliver_to_address.city_name` (any)
    Deliver to city (BT-77)

  - `delivery.deliver_to_address.postal_zone` (any)
    Deliver to post code (BT-78)

  - `delivery.deliver_to_address.country_subdivision` (any)
    Deliver to country subdivision (BT-79)

  - `delivery.deliver_to_address.country_code` (any)
    Deliver to country code (BT-80) - ISO 3166-1 alpha-2. Mandatory when a deliver to address (BG-15) is present (BR-57).

## Response 400 fields (application/json):

  - `error` (string, required)

  - `code` (integer, required)

  - `trace_id` (string, required)

## Response 401 fields (application/json):

  - `error` (string, required)

  - `code` (integer, required)

  - `trace_id` (string, required)

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array, required)

  - `detail.msg` (string, required)

  - `detail.type` (string, required)

