Skip to content

FISCALISTO / API / REFERENCE

Create an order · Orders

Open in ChatGPTOpen in ClaudeOpen in Cursor
POST
/v1/sales_orders

What your customer ordered, with an invoice's line items and payment terms (they're checked with the same rules, so each invoice that comes from it stamps). customer is a customer from your catalog or one with their tax data (added to your customers). With quote (quo_…) it makes it from a quote. It stays in draft, or confirmed with confirm: true (sales_order.confirmed arrives and what was ordered is reserved in the warehouse).

Before you call

  • Sales orders in the plan of your empresa, if your API account belongs to an empresa: it comes with Operaciones, which is added to any paid plan in Ajustes › Plan y pagos and comes in Corporativo. In test mode you can already use it.

Authorization

bearerAuth
headerAuthorizationBearer <key>

Your secret key: fk_test_… in test mode, fk_live_… in production. Desarrolladores › Llaves.

Headers

Idempotency-Key?string

Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge).

Length1 <= length <= 255

Request body

application/json
  1. body
issuer?string

Issuer (iss_…). If the key has a single issuer or the account has only one, it can be left out.

quote?string

Make it from a quote (quo_…): takes its customer and its line items, and the quote becomes accepted. Without customer or items.

customer?|

A customer from your catalog (cus_…) or one with their tax data (as in POST /v1/invoices: added to your customers).

items?array<>

The line items, as in POST /v1/invoices (up to 200).

Items1 <= items <= 200
confirm?boolean

Confirm it in the same step (false by default: it stays in draft). Once confirmed, it reserves what was ordered in the warehouse.

currency?string

Currency, an ISO 4217 key from c_Moneda (MXN, USD, EUR…). MXN by default.

Length3 <= length <= 3
exchange_rate?number

Exchange rate to pesos (TipoCambio). Required if the currency isn't MXN; use the DOF's from the previous day.

Range0 < value <= 1000000
payment_form?string

Payment form (FormaPago), a c_FormaPago key: 01 cash, 03 transfer, 04 credit card, 28 debit, 99 to be defined… Required with PUE; with PPD it's 99.

Pattern^\d{2}$
payment_method?string

Payment method (MetodoPago): PUE (a single payment, the default) or PPD (in installments or deferred, collected with payment complements).

One of"PUE""PPD"
use?string

CFDI use (UsoCFDI), a c_UsoCFDI key. G03 by default, or S01 with regime 616.

Pattern^[A-Z]{1,2}\d{2}$
notes?string

Remarks that appear on the PDF (they don't go into the XML).

Lengthlength <= 1000
customer_po?string

Your customer's purchase order number (it goes in each invoice's note).

Lengthlength <= 60
email?string

Where to send the order and its delivery notes (up to 5 emails, separated by commas). By default, the customer's.

Lengthlength <= 500
expected_on?string

Estimated delivery (YYYY-MM-DD).

Pattern^\d{4}-\d{2}-\d{2}$
payment_days?integer

Credit days (0: cash).

Range0 <= value <= 365
invoice_policy?string

What's invoiced: delivered (the default), what's already delivered; ordered, everything ordered from the start (for example with payment in advance).

One of"delivered""ordered"
ship_to?string

Where it's delivered.

Lengthlength <= 500
terms?string

The order's terms.

Lengthlength <= 2000
internal_note?string

Internal note (your customer doesn't see it).

Lengthlength <= 1000

Response body

OK.

application/json
  1. response

A sales order: what your customer ordered, how it is delivered (delivery notes) and how it is invoiced and collected.

id*string

Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_).

livemode*boolean

true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT.

object*string

What kind of object it is («invoice», «customer»…).

issuer*string

The issuer (iss_…).

number*string

Its series and folio (PED-12).

status*string

draft, confirmed, partially_delivered, delivered (all delivered), invoiced (all invoiced), paid (its invoices paid), closed (marked as finished) or canceled. It changes on its own, with what happens.

One of"draft""confirmed""partially_delivered""delivered""invoiced""paid""closed""canceled"
stage*|

The business stage it is at («Por empacar», «En ruta»…), or null. Chosen in the app.

url*|

The link where your customer views the order, confirms it, signs each delivery and opens their invoices. null while it is a draft or hasn't been sent.

customer*

The customer: their RFC, name, email and their id in your catalog.

customer_po*|

Your customer's purchase order number, or null.

quote*|

The quote (quo_…) it came from, or null.

currency*string

The currency.

items*array<>

The line items: id (to deliver or invoice part of it), what was ordered, delivered, invoiced and what will no longer be delivered (canceled). goods is true when it leaves the warehouse.

subtotal*number

The subtotal, without taxes.

total*number

The total with taxes.

invoiced_total*number

The sum of its stamped invoices (without the canceled ones).

paid_total*number

What has already been paid of those invoices.

expected_on*|

The estimated delivery (YYYY-MM-DD), or null.

payment_days*integer

Credit days: each invoice is due that many days after its date.

Range-9007199254740991 <= value <= 9007199254740991
invoice_policy*string

delivered: each invoice carries what has been delivered; ordered: what was ordered is invoiced, delivered or not.

One of"delivered""ordered"
ship_to*|

Where it is delivered, or null.

terms*|

The terms printed on the order, or null.

notes*|

The notes, like an invoice's.

internal_note*|

The internal note (your customer doesn't see it), or null.

deliveries*array<>

Its deliveries, each with its delivery note.

invoices*array<>

Its stamped invoices (inv_…), with what is left to pay on each (balance).

customer_confirmed_at*|

When your customer confirmed it on their link, or null.

sent_at*|

When it was sent, or null.

viewed_at*|

When your customer first opened the link, or null.

confirmed_at*|

When it was confirmed, or null.

delivered_at*|

When everything was delivered, or null.

invoiced_at*|

When everything was invoiced, or null.

paid_at*|

When its invoices were paid, or null.

closed_at*|

When it was closed, or null.

canceled_at*|

When it was canceled, or null.

cancel_reason*|

Why it was canceled, or null.

created_at*|

When it was created.

Errors

  • The issuer is archived and no longer stamps. Its documents can still be read and canceled.

  • The account has several issuers and the request doesn't say which: send issuer (iss_…).

  • The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

  • The sales order couldn't be saved or can't do that in its current status (for example, nothing left to deliver or invoice, or it's canceled). message_es says why.

  • Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.

  • That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.

  • This key can't use that issuer.

  • There is no such issuer in the account (or it belongs to the other mode).

  • There's no object with that id (or it belongs to another issuer or the other mode).

  • You reached today's limit of something not paid with stamps. Retry-After says how many seconds until midnight in Mexico City.

Plus those of any call (key, fields, limits): Errors. They all carry code, message and, when it's about a field, param.

curl -X POST 'https://api.fiscalisto.com/v1/sales_orders' \  -H 'Authorization: Bearer fk_test_…' \  -H 'Idempotency-Key: pedido-A-1042' \  -H 'Content-Type: application/json' \  -d '{  "customer": "cus_OufpKqnrvx9p42",  "customer_po": "OC-778",  "payment_form": "99",  "payment_method": "PPD",  "items": [    {      "description": "Silla de oficina ergonómica",      "product_key": "56101504",      "quantity": 100,      "unit_price": 1850    }  ],  "expected_on": "2026-11-20",  "payment_days": 30,  "confirm": true}'
{  "id": "sor_OufpKqnrvx9p5Rt2mZr1XyT5uBcW8sKdLx",  "object": "sales_order",  "livemode": false,  "issuer": "iss_OufpKqnrvx9p",  "number": "PED-12",  "status": "partially_delivered",  "stage": "En ruta",  "url": "https://fiscalisto.com/pedido/Rt2mZr1XyT5uBcW8sKdLx0VeNOufpKqnrvx9p5Rt2mZr1",  "customer": {    "tax_id": "ICV060329BY0",    "name": "INMOBILIARIA CVA",    "email": "compras@cva.example",    "catalog_id": "cus_OufpKqnrvx9p42"  },  "customer_po": "OC-778",  "quote": null,  "currency": "MXN",  "items": [    {      "id": 31,      "description": "Silla de oficina ergonómica",      "product_key": "56101504",      "quantity": 100,      "unit": "Pieza",      "unit_price": 1850,      "discount": 0,      "amount": 185000,      "goods": true,      "delivered": 60,      "invoiced": 60,      "canceled": 0    }  ],  "subtotal": 185000,  "total": 214600,  "invoiced_total": 128760,  "paid_total": 0,  "expected_on": "2026-11-20",  "payment_days": 30,  "invoice_policy": "delivered",  "ship_to": "Av. Vallarta 1500, Guadalajara",  "terms": "Entrega en dos partes.",  "notes": null,  "internal_note": null,  "deliveries": [    {      "id": "dlv_OufpKqnrvx9p7",      "object": "sales_order_delivery",      "number": "REM-1",      "status": "delivered",      "delivered_on": "2026-11-10",      "carrier": "Paquetexpress",      "tracking": "PX-90122",      "note": null,      "received_by": "Laura Méndez",      "received_at": "2026-11-10T13:20:00-06:00",      "items": [        {          "line": 31,          "quantity": 60        }      ],      "created_at": "2026-11-10T09:05:00-06:00"    }  ],  "invoices": [    {      "id": "inv_OufpKqnrvx9p9Qt6vB3nMc8xZl1kJh4gFd",      "status": "stamped",      "total": 128760,      "balance": 128760    }  ],  "customer_confirmed_at": "2026-11-04T17:42:00-06:00",  "sent_at": "2026-11-04T10:15:00-06:00",  "viewed_at": "2026-11-04T17:40:00-06:00",  "confirmed_at": "2026-11-04T10:12:00-06:00",  "delivered_at": null,  "invoiced_at": null,  "paid_at": null,  "closed_at": null,  "canceled_at": null,  "cancel_reason": null,  "created_at": "2026-11-04T10:05:00-06:00"}

Was this page helpful?