Factuarea APIDevelopers
Added

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.get and .update read and change the public link of the order, and sales_orders.activities lists its activity feed.
  • Returns, 4 new operations. returns.origins (GET /returns/origins) lists the documents that can be returned, returns.refund_preview shows what the refund would be before it is registered, and returns.pdf and returns.send produce and email the return sheet.
  • Recurring invoices, 1 new operation. recurring_invoices.unskip reverts 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_return and unskip_recurring_invoice. Twenty-three existing tools publish a new description. See the tool catalog. The OAuth scopes sales_orders.read, purchase_orders.read, stock_transfers.read and returns.read also grant pdfs:read and events: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_holder and last_reversion. Each line adds sku, product_name, price_list_name, quantity_pending_to_invoice, quantity_in_return and item_kind. The buyer adds contact_person, each related document reason and reason_label, and the serving plan unassigned_quantity. The list accepts new filters, including pending=invoiceable, and a new order. Cancelling takes an optional reason of 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 accepts include_public_link, and converting to an invoice accepts billing_address, buyer_tax_id, date, operation_date and save_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_total and next_incoming, and per warehouse reserved_quantity, in_delivery_notes_quantity, incoming[] and in_transit_transfers. With for_sales_order they also publish reserved_own and in_delivery_notes_own, the part that belongs to that order. Each commitment carries its kind. See Inventory and warehouses.
  • Quotes and pro-forma invoices (20 operations). client publishes the shared ConvertibleClientRef, the document adds approved_at (quotes) and accepted_at (pro-forma invoices), and converting to a sales order accepts buyer_contact. The summary of the converted sales order adds created_at.
  • Contacts (18 operations). The contact publishes delivery_address and 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_blocker and corrective_candidates_count, and its lines add sku, unit_code, delivered_quantity, returnable_quantity, received_quantity, restocked_quantity, returned_in_other_returns, condition and origin_line_id. The buyer adds country, province and contact_id, window and origin_date are also published for rejected returns, returns.refund_preview adds corrective_number, and returns.origins adds client_tax_id, client_has_contact and the resolved buyer in client_name. Receiving takes lines[] and register_covered_adjustment, rejecting takes notify_buyer, approving takes send_sheet, the candidate invoices of a refund publish covers_returned_lines and recommended, and returnable-lines publishes is_service, non_returnable_reason and returned_elsewhere_quantity. See Fulfilment and returns.
  • Stock ledger (2 operations). The reason of 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_date and the list shipments[] with pending[]; the flat keys keep giving the most recent shipment. Creating an order and confirming its payment declare the 409 they 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 409 of its presentation. Events and webhook deliveries carry the new shapes of the resources above, and module access publishes restrictions as a map from section to capabilities.

Behaviors the contract defines

  1. Availability counts delivery notes. The available figure subtracts reserved and what is committed on 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.show and .bulk_resolve) publishes the same figure and its description says so: physical minus committed, with 200, the same four fields and no per-warehouse breakdown.
  2. 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 422 with sales_order_awaiting_payment, with subcode confirm, edit_lines or delete and param lines when lines are edited. The payment confirms it, and can_confirm, can_edit_lines and can_delete are false meanwhile.
  3. An invoiced order is not cancelled. An order that has a net invoiced amount (its invoices minus the corrective ones) responds 422 with sales_order_has_invoices to cancel, singly or in a batch. can_cancel is false and cancel_blocked_reason names the reason.
  4. The public link of a cancelled order. The link of a cancelled order responds 200, with status cancelled, cancelled_at, the lines and the total, and with no fulfilment, 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 respond 410 (link_expired or link_revoked) with document_type sales-order and the issuer in issuer (display_name, logo_url, email and phone), so the buyer knows whom to contact; never with order data. The 410 of the other document families keeps its body. This is a behavior of the public document, not a v1 operation; sales_orders.public_link.get reads the link.
  5. 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 422 with buyer_identity_incomplete_for_full_invoice: a simplified invoice (F2) is not issued to them. The serving plan reports it as invoice_preview.type blocked with blocked_reason.code.
  6. One calendar month per invoice. The invoice of an order does not gather delivery notes of different calendar months. 422 with code business_rule_violation and subcode invoice_spans_several_months, param lines and details.months (YYYY-MM). The serving plan lists pending_by_month and oldest_month.
  7. 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 (mode issue or issue_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_date and operation_date are separate, the response carries meta.requested_date and answers 201, and a date later than today responds 422 with subcode invoice_date_in_future and param date.
  8. Skipped periods do not overlap. Only a recurring invoice that is not skipped in the period overlaps with the invoice of the order (422, subcode sales_order_recurring_invoice_overlap, details.recurring_invoice), in the conversion and in the automatic invoicing of the online shop. Reverting a skip is recurring_invoices.unskip, 200, or 422 with recurring_invoice_cannot_be_unskipped.
  9. New fields and codes. The fields lifecycle, fulfilment and delivery_address, the operations serving-plan, convert-to-delivery-notes and returns/origins, and these codes, all 422: 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_conflict and sales_order_serving_groups_invalid. invoice_spans_several_months, invoice_date_in_future, sales_order_buyer_tax_id_conflict and sales_order_serving_groups_invalid travel as the subcode of business_rule_violation; the others are the code itself.

Where to read more

Sales orders, Inventory and warehouses, Fulfilment and returns, Storefront, the tool catalog and All rejection codes.

New endpoints11

EndpointDescription
POST/v1/companies/{company}/recurring-invoices/{recurring_invoice}/unskipUndo the skip of a recurring invoice generation
GET/v1/companies/{company}/returns/originsList the returnable origins
GET/v1/companies/{company}/returns/{return}/pdfDownload return sheet PDF
GET/v1/companies/{company}/returns/{return}/refund-previewPreview the refund of a return
POST/v1/companies/{company}/returns/{return}/sendSend a return sheet
GET/v1/companies/{company}/sales-orders/{sales_order}/activitiesList sales order activity
POST/v1/companies/{company}/sales-orders/{sales_order}/convert-to-delivery-notesServe a sales order from several warehouses
POST/v1/companies/{company}/sales-orders/{sales_order}/link-contactLink a contact to a sales order
GET/v1/companies/{company}/sales-orders/{sales_order}/public-linkRetrieve a sales order public link
PATCH/v1/companies/{company}/sales-orders/{sales_order}/public-linkUpdate a sales order public link
GET/v1/companies/{company}/sales-orders/{sales_order}/serving-planRetrieve the serving plan of a sales order

Updated endpoints89

EndpointDescription
PATCH/v1/accounts/{account}/members/{member}/module-accessSet a member module access level
POST/v1/companies/{company}/contacts/{contact}/archiveArchive a contact
POST/v1/companies/{company}/contacts/{contact}/roles/{role}Assign a contact role
POST/v1/companies/{company}/contacts/bulk-createCreate contacts in bulk
PATCH/v1/companies/{company}/contacts/{contact}/roles/{role}/statusChange a contact role status
POST/v1/companies/{company}/contactsCreate a contact
POST/v1/companies/{company}/contacts/find-by-external-idFind a contact by external ID
POST/v1/companies/{company}/contacts/find-by-tax-idFind a contact by tax ID
POST/v1/companies/{company}/contacts/importImport contacts
GET/v1/companies/{company}/contactsList contacts
POST/v1/companies/{company}/contacts/import/previewPreview a contact import
DEL/v1/companies/{company}/contacts/{contact}/roles/{role}Remove a contact role
POST/v1/companies/{company}/contacts/{contact}/restoreRestore an archived contact
GET/v1/companies/{company}/contacts/searchSearch contacts
GET/v1/companies/{company}/contacts/{contact}Retrieve a contact
PATCH/v1/companies/{company}/contacts/{contact}Update a contact
PATCH/v1/companies/{company}/contacts/{contact}/bank-accountsReplace the bank accounts of a contact
PATCH/v1/companies/{company}/contacts/{contact}/customer-profileUpdate a customer profile
PATCH/v1/companies/{company}/contacts/{contact}/supplier-profileUpdate a supplier profile
PATCH/v1/companies/{company}/delivery-notes/{delivery_note}Update a delivery note
GET/v1/companies/{company}/eventsList all events
GET/v1/companies/{company}/events/{event}Retrieve an event
GET/v1/companies/{company}/products/{product}/stock-movementsList stock movements of a product
POST/v1/companies/{company}/proformas/{proforma}/acceptAccept a proforma
POST/v1/companies/{company}/proformas/{proforma}/convert-to-sales-orderConvert proforma to sales order
POST/v1/companies/{company}/proformasCreate a proforma
POST/v1/companies/{company}/proformas/{proforma}/duplicateDuplicate a proforma
POST/v1/companies/{company}/proformas/find-by-external-idFind a proforma by external ID
GET/v1/companies/{company}/proformasList all proformas
POST/v1/companies/{company}/proformas/{proforma}/rejectReject a proforma
POST/v1/companies/{company}/proformas/{proforma}/sendSend proforma by email
GET/v1/companies/{company}/proformas/{proforma}Retrieve a proforma
PATCH/v1/companies/{company}/proformas/{proforma}Update a proforma
POST/v1/companies/{company}/quotes/{quote}/acceptAccept a quote
POST/v1/companies/{company}/quotes/{quote}/convert-to-sales-orderConvert quote to sales order
POST/v1/companies/{company}/quotesCreate a quote
POST/v1/companies/{company}/quotes/{quote}/duplicateDuplicate a quote
POST/v1/companies/{company}/quotes/find-by-external-idFind a quote by external ID
GET/v1/companies/{company}/quotesList all quotes
POST/v1/companies/{company}/quotes/{quote}/rejectReject a quote
POST/v1/companies/{company}/quotes/{quote}/sendSend quote by email
GET/v1/companies/{company}/quotes/{quote}Retrieve a quote
PATCH/v1/companies/{company}/quotes/{quote}Update a quote
POST/v1/companies/{company}/returns/{return}/approveApprove a return
GET/v1/companies/{company}/returns/{return}/corrective-candidatesList the corrective invoice candidates of a return
POST/v1/companies/{company}/returnsRequest a return
DEL/v1/companies/{company}/returns/{return}Delete a return
GET/v1/companies/{company}/returnsList all returns
POST/v1/companies/{company}/returns/{return}/receiveReceive a return
POST/v1/companies/{company}/returns/{return}/refundRefund a return
POST/v1/companies/{company}/returns/{return}/rejectReject a return
GET/v1/companies/{company}/returns/returnable-linesList the returnable lines of a document
GET/v1/companies/{company}/returns/{return}Retrieve a return
PATCH/v1/companies/{company}/returns/{return}Update a return
POST/v1/companies/{company}/sales-orders/bulk-createBulk create sales orders
POST/v1/companies/{company}/sales-orders/bulk-deleteBulk delete sales orders
POST/v1/companies/{company}/sales-orders/bulk-statusBulk change sales order status
PATCH/v1/companies/{company}/sales-orders/{sales_order}/buyerUpdate the buyer of a sales order
POST/v1/companies/{company}/sales-orders/{sales_order}/cancelCancel a sales order
POST/v1/companies/{company}/sales-orders/{sales_order}/closeClose a sales order
POST/v1/companies/{company}/sales-orders/{sales_order}/confirmConfirm a sales order
POST/v1/companies/{company}/sales-orders/{sales_order}/convert-to-delivery-noteConvert a sales order to a delivery note
POST/v1/companies/{company}/sales-orders/{sales_order}/convert-to-invoiceConvert a sales order to an invoice
POST/v1/companies/{company}/sales-ordersCreate a sales order
DEL/v1/companies/{company}/sales-orders/{sales_order}Delete a sales order
POST/v1/companies/{company}/sales-orders/find-by-external-idFind a sales order by external id
POST/v1/companies/{company}/sales-orders/importImport sales orders
POST/v1/companies/{company}/sales-orders/{sales_order}/linesAdd a line to a sales order
DEL/v1/companies/{company}/sales-orders/{sales_order}/lines/{line}Delete a line of a sales order
GET/v1/companies/{company}/sales-orders/{sales_order}/linesList the lines of a sales order
PATCH/v1/companies/{company}/sales-orders/{sales_order}/lines/{line}Update a line of a sales order
GET/v1/companies/{company}/sales-ordersList all sales orders
POST/v1/companies/{company}/sales-orders/import/previewPreview an import of sales orders
POST/v1/companies/{company}/sales-orders/{sales_order}/sendSend a sales order
PATCH/v1/companies/{company}/sales-orders/{sales_order}/shipping-addressUpdate the shipping address of a sales order
GET/v1/companies/{company}/sales-orders/{sales_order}Retrieve a sales order
PATCH/v1/companies/{company}/sales-orders/{sales_order}Update a sales order
POST/v1/companies/{company}/stock-availability/batchRetrieve stock availability in batch
GET/v1/companies/{company}/stock-availability/{product}/commitmentsList the commitments over an article
GET/v1/companies/{company}/stock-availabilityList stock availability
GET/v1/companies/{company}/stock-availability/{product}Retrieve the stock availability of an article
GET/v1/companies/{company}/stock-movementsList the stock movements of the company
POST/v1/companies/{company}/storefront/availability/bulk-resolveResolve storefront availability in bulk
GET/v1/companies/{company}/storefront/availabilityRetrieve storefront availability
POST/v1/companies/{company}/storefront/orders/{order}/confirm-paymentConfirm the payment of a storefront order
POST/v1/companies/{company}/storefront/ordersCreate a storefront order
GET/v1/companies/{company}/storefront/orders/{order}/trackingRetrieve the shipment tracking of a storefront order
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriesList webhook deliveries
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}Retrieve webhook delivery

On this page

Need a hand?Contact support