Sales orders, returns and availability: serving, reception and buyer lifecycle
Serving an order from several warehouses, the serving plan, order lifecycle rules, availability that counts delivery notes, returns with per-line reception and refund preview, buyer identity on contacts and the storefront tracking. 11 new operations, 89 updated ones, 11 new MCP tools and 14 new rejection codes.
2 December 2026 — The sales side of the omnichannel ERP gains the operations that take an
order from confirmation to invoice and from delivery to refund: serving an order from one or
several warehouses, a plan that previews what can be served and invoiced, rules for the
order lifecycle, an availability figure that counts what is already on delivery notes,
returns that are received line by line, and the buyer's address on the contact. The
company axis (/v1/companies/{company}/…) is unchanged, and no operation is removed or
renamed.
What is new
- Sales orders, 6 new operations.
sales_orders.serving_plan(GET …/serving-plan) returns what each line can serve from each warehouse and the preview of the invoice.sales_orders.convert_to_delivery_notes(POST …/convert-to-delivery-notes) serves an order from several warehouses in one call, with one delivery note per group.sales_orders.link_contact(POST …/link-contact) links the buyer to a contact of the address book.sales_orders.public_link.getand.updateread and change the public link of the order, andsales_orders.activitieslists its activity feed. - Returns, 4 new operations.
returns.origins(GET /returns/origins) lists the documents that can be returned,returns.refund_previewshows what the refund would be before it is registered, andreturns.pdfandreturns.sendproduce and email the return sheet. - Recurring invoices, 1 new operation.
recurring_invoices.unskipreverts the skip of a generation. - MCP. 11 new tools:
convert_sales_order_to_delivery_notes,get_sales_order_serving_plan,link_sales_order_contact,get_sales_order_public_link,update_sales_order_public_link,list_sales_order_activities,list_returnable_origins,get_return_refund_preview,get_return_pdf,send_returnandunskip_recurring_invoice. Twenty-three existing tools publish a new description. See the tool catalog. The OAuth scopessales_orders.read,purchase_orders.read,stock_transfers.readandreturns.readalso grantpdfs:readandevents:read, so they reach the PDF and the activity log of their document. See Scopes & permissions. - Rejection codes. 14 new codes in the Sales Orders, Returns and Recurring Invoices groups. See All rejection codes.
Existing operations that change
Eighty-nine operations that already existed describe more in the contract. Request and response examples are also added or refreshed in 136 further operations whose contract does not change.
- Sales orders (23 operations). The order publishes
lifecycle(stages and what each stage allows),fulfilment(what is picked, served, pending and in return per line),can_confirm,can_edit_lines,can_delete,can_cancel,cancel_blocked_reason,document_holderandlast_reversion. Each line addssku,product_name,price_list_name,quantity_pending_to_invoice,quantity_in_returnanditem_kind. The buyer addscontact_person, each related documentreasonandreason_label, and the serving planunassigned_quantity. The list accepts new filters, includingpending=invoiceable, and a new order. Cancelling takes an optionalreasonof up to 500 characters. Update accepts the buyer, billing and shipping fields (buyer_name,buyer_tax_id,billing_*,shipping_*) while the order is a draft, sending acceptsinclude_public_link, and converting to an invoice acceptsbilling_address,buyer_tax_id,date,operation_dateandsave_send_to_contact. See Sales orders. - Availability (4 operations). Availability, its batch, its commitments and the
availability of one product publish
reserved_total,in_delivery_notes_total,incoming_totalandnext_incoming, and per warehousereserved_quantity,in_delivery_notes_quantity,incoming[]andin_transit_transfers. Withfor_sales_orderthey also publishreserved_ownandin_delivery_notes_own, the part that belongs to that order. Each commitment carries itskind. See Inventory and warehouses. - Quotes and pro-forma invoices (20 operations).
clientpublishes the sharedConvertibleClientRef, the document addsapproved_at(quotes) andaccepted_at(pro-forma invoices), and converting to a sales order acceptsbuyer_contact. The summary of the converted sales order addscreated_at. - Contacts (18 operations). The contact publishes
delivery_addressand accepts it on creation and update, so a sales order can start from the delivery address of its customer. Bulk creation, import and its preview describe it too. - Returns (11 operations). The return publishes
buyer,warehouse,window,origin_date,documents,order,stages,totals,rejection_reasons,refund_blockerandcorrective_candidates_count, and its lines addsku,unit_code,delivered_quantity,returnable_quantity,received_quantity,restocked_quantity,returned_in_other_returns,conditionandorigin_line_id. Thebuyeraddscountry,provinceandcontact_id,windowandorigin_dateare also published for rejected returns,returns.refund_previewaddscorrective_number, andreturns.originsaddsclient_tax_id,client_has_contactand the resolved buyer inclient_name. Receiving takeslines[]andregister_covered_adjustment, rejecting takesnotify_buyer, approving takessend_sheet, the candidate invoices of a refund publishcovers_returned_linesandrecommended, andreturnable-linespublishesis_service,non_returnable_reasonandreturned_elsewhere_quantity. See Fulfilment and returns. - Stock ledger (2 operations). The
reasonof a movement describes the movements that a return reception writes. - Storefront (5 operations). The tracking of an order publishes
prepared_at,handed_over_at,in_transit_at,delivered_at,failed_at,attempt,order_expected_delivery_dateand the listshipments[]withpending[]; the flat keys keep giving the most recent shipment. Creating an order and confirming its payment declare the409they can return. The availability of an item and of a whole cart describe their figure as the physical stock minus what is committed by live reservations and by undelivered sales-order delivery notes. See Storefront. - Delivery notes, events, webhook deliveries and member module access (6 operations).
Updating a delivery note declares the
409of its presentation. Events and webhook deliveries carry the new shapes of the resources above, and module access publishesrestrictionsas a map from section to capabilities.
Behaviors the contract defines
- Availability counts delivery notes. The available figure subtracts
reservedand what iscommittedon delivery notes that were born from an order and are not yet delivered (in_delivery_notes), per warehouse and in total. Loose delivery notes do not count. The storefront availability (storefront.availability.showand.bulk_resolve) publishes the same figure and its description says so: physical minus committed, with200, the same four fields and no per-warehouse breakdown. - A web draft awaiting payment is handled by its payment. A draft order of your own
online shop that is waiting for its payment is not confirmed, edited or deleted by
hand: confirming, deleting, and creating, changing or removing lines respond
422withsales_order_awaiting_payment, withsubcodeconfirm,edit_linesordeleteandparamlineswhen lines are edited. The payment confirms it, andcan_confirm,can_edit_linesandcan_deletearefalsemeanwhile. - An invoiced order is not cancelled. An order that has a net invoiced amount (its
invoices minus the corrective ones) responds
422withsales_order_has_invoicesto cancel, singly or in a batch.can_cancelisfalseandcancel_blocked_reasonnames the reason. - The public link of a cancelled order. The link of a cancelled order responds
200, withstatuscancelled,cancelled_at, the lines and the total, and with nofulfilment, payment or download. The recipient publishes only the name: the tax ID and the billing address are not part of a cancelled order link. When an order link has expired or been deactivated, reading and downloading respond410(link_expiredorlink_revoked) withdocument_typesales-orderand the issuer inissuer(display_name,logo_url,emailandphone), so the buyer knows whom to contact; never with order data. The410of the other document families keeps its body. This is a behavior of the public document, not a v1 operation;sales_orders.public_link.getreads the link. - Buyers outside Spain. Converting an order to an invoice for a buyer with a billing
country other than Spain, or an intra-community, reverse-charge or export regime, and
no identifier responds
422withbuyer_identity_incomplete_for_full_invoice: a simplified invoice (F2) is not issued to them. The serving plan reports it asinvoice_preview.typeblockedwithblocked_reason.code. - One calendar month per invoice. The invoice of an order does not gather delivery
notes of different calendar months.
422withcodebusiness_rule_violationandsubcodeinvoice_spans_several_months,paramlinesanddetails.months(YYYY-MM). The serving plan listspending_by_monthandoldest_month. - The invoice takes the date of the day it is issued. Without
date, the draft invoice of the order carries today's date. The invoice issued from an order (modeissueorissue_and_send) is dated the day of issue (Europe/Madrid) and an earlier date asked for is kept as its operation date,operation_on, when none was given.requested_dateandoperation_dateare separate, the response carriesmeta.requested_dateand answers201, and a date later than today responds422withsubcodeinvoice_date_in_futureandparamdate. - Skipped periods do not overlap. Only a recurring invoice that is not skipped in the
period overlaps with the invoice of the order (
422,subcodesales_order_recurring_invoice_overlap,details.recurring_invoice), in the conversion and in the automatic invoicing of the online shop. Reverting a skip isrecurring_invoices.unskip,200, or422withrecurring_invoice_cannot_be_unskipped. - New fields and codes. The fields
lifecycle,fulfilmentanddelivery_address, the operationsserving-plan,convert-to-delivery-notesandreturns/origins, and these codes, all422:sales_order_awaiting_payment,sales_order_has_invoices,return_origin_not_delivered,return_reception_empty,return_received_exceeds_authorized,return_rejection_reason_not_applicable,corrective_target_invoice_not_covering,invoice_date_in_future,invoice_spans_several_months,recurring_invoice_cannot_be_unskipped,return_line_not_returnable,return_not_sendable,sales_order_buyer_tax_id_conflictandsales_order_serving_groups_invalid.invoice_spans_several_months,invoice_date_in_future,sales_order_buyer_tax_id_conflictandsales_order_serving_groups_invalidtravel as thesubcodeofbusiness_rule_violation; the others are thecodeitself.
Where to read more
Sales orders, Inventory and warehouses, Fulfilment and returns, Storefront, the tool catalog and All rejection codes.