Skip to main content

REST API: Retrieving data for billing systems

Technical guide to integrate purchases and sales from tSpoonLab with external accounting and billing systems.

Notice: some calls in this article will stop working on 31 January 2027.

This affects purchase delivery notes, purchase invoices and sales invoices: fetching pending or all documents (/pending, /all) and marking them as processed, accounted or not accounted (/processed, /accounted, /not/accounted).

To keep these documents up to date, use Purchase and sales sync: it also returns updates and deletions, without marking anything.

Purchase orders, sales delivery notes, locking (/lock) and creating purchase and sales orders keep working.

Bring purchase and sales orders, delivery notes and invoices into a billing or accounting system, mark them as processed, and create purchase and sales orders.

GET  /integration/purchases/orders/pending
PUT /integration/purchases/orders/processed
GET /integration/purchases/deliveries/pending
GET /integration/purchases/deliveries/all
PUT /integration/purchases/deliveries/processed
PUT /integration/purchases/deliveries/lock
GET /integration/purchases/invoices/pending
GET /integration/purchases/invoices/all
GET /exportFileBoundFile/{fileName}
PUT /integration/purchases/invoices/accounted
PUT /integration/purchases/invoices/not/accounted
PUT /integration/purchases/invoices/lock
GET /integration/purchases/totals
GET /integration/sales/deliveries/pending
GET /integration/sales/deliveries/all
PUT /integration/sales/deliveries/accounted
PUT /integration/sales/deliveries/not/accounted
PUT /integration/sales/deliveries/lock
GET /integration/sales/invoices/pending
PUT /integration/sales/invoices/accounted
PUT /integration/sales/invoices/not/accounted
PUT /integration/sales/invoices/lock
POST /integration/purchases/orders
PUT /vendorOrder/{idProvCom}/sent
PUT /vendorOrder/{idProvCom}/received/date
POST /integration/sales/orders

Before you start

Base URL: https://app.tspoonlab.com/recipes/api

Headers

  • rememberme · required — Session token returned by login.

  • order · optional — Cost center id (Cost centers). Defaults to the user's active cost center. Every call works on that cost center.

Login — Returns the token as plain text.

curl https://app.tspoonlab.com/recipes/api/login \
-d [email protected] \
-d password=XXXXXXX

Permissions — Reading purchases and downloading documents: permission to view purchase orders. Marking purchases, creating purchase orders and marking them as sent: permission to edit purchase orders. Receiving orders: permission to receive orders. Locking purchase invoices: permission to edit supplier invoices. Locking purchase delivery notes: permission to edit suppliers. Reading sales: permission to view sales. Marking sales and creating sales orders: permission to edit sales. Locking sales: permission to edit customers.

Dates — Returned in milliseconds since 1970 (epoch). In query parameters, send them as YYYY-MM-DD; ranges include the first and last day. In the body, milliseconds or ISO 8601 with time are accepted (2026-11-03T08:00:00.000+01:00).

Responses may include fields other than the documented ones. Use only the documented fields.


List pending purchase orders

Orders sent to the supplier that are not marked as processed. An order created with the API shows up once it is marked as sent.

GET /integration/purchases/orders/pending

Query parameters

  • startDate date · optional — From this sent date. Without dates, returns all.

  • endDate date · optional — Up to this sent date.

  • includeInternal boolean · optional — false excludes internal-type suppliers. Defaults to true.

  • idVendor string · optional — Only this supplier's orders (Suppliers and purchases).

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/orders/pending?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020001",
"numOrder": "PED-0153",
"idVendor": "3515834441676562996102020004",
"vendor": "Distribuciones García",
"codeVendor": "P001",
"accountVendor": "40000001",
"nif": "B12345678",
"date": 1761897600000,
"dateFormatted": "2026/10/31",
"dateReception": 1761984000000,
"dateReceptionFormatted": "2026/11/01",
"sentBy": "Ana López",
"listOrders": [
{
"id": "3515834441676562996102020007",
"position": 1,
"idComponent": "3515834441676562996102020008",
"component": "Plum tomato",
"codeComponent": "ING-0042",
"codeVendorComponent": "TP-5",
"comment": null,
"quantity": 20.0,
"idUnit": "3515834441676562996102020009",
"unit": "kg",
"cost": 5.0,
"hasFormat": true,
"quantityFormat": 4.0,
"idUnitFormat": "3515834441676562996102020010",
"unitFormat": "5 kg box",
"costFormat": 25.0,
"iva": 10.0,
"listTypes": [ { "id": "3515834441676562996102020011", "descr": "Vegetables" } ]
}
]
}
]
  • id string — Order id.

  • numOrder string — Order number.

  • idVendor, vendor, codeVendor, accountVendor, nif string — Supplier: id, name, code, ledger account and tax id.

  • date date — Sent date. dateFormatted string — The same, as YYYY/MM/DD.

  • dateReception date — Expected delivery date. dateReceptionFormatted string — The same, as YYYY/MM/DD.

  • sentBy string — Who placed the order.

  • listOrders array — Order lines.

Each line:

  • id string — Line id. position integer — Order.

  • idComponent, component, codeComponent string — Product: id, name and code.

  • codeVendorComponent string — Product code at the supplier.

  • comment string — Comment.

  • quantity number, idUnit, unit string — Quantity in the product's base unit.

  • cost number — Cost per base unit.

  • hasFormat boolean — Whether it is ordered in a format (e.g. boxes).

  • quantityFormat number, idUnitFormat, unitFormat string, costFormat number — Format: quantity, unit and price per format. null if hasFormat is false.

  • iva number — VAT %.

  • idCostType, costType, codeCostType, accountCostType, accountAuxCostType string — Line cost account: id, name, code, ledger account and auxiliary account.

  • idBusinessLine, businessLine, codeBusinessLine string — Line business line.

  • listTypes array — Product families: id and descr.


Mark purchase orders as processed

They no longer appear in List pending purchase orders. When the order is received, the delivery note becomes unprocessed again.

PUT /integration/purchases/orders/processed

Query parameters

  • lock boolean · required — true marks and also locks; false only marks. Without it, the call fails.

Body

  • listIds array · required — Order ids.

Example

curl -X PUT "https://app.tspoonlab.com/recipes/api/integration/purchases/orders/processed?lock=false" \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020001", "3515834441676562996102020002"]}'

Response — No content.


List pending purchase delivery notes

Retiring on 31 January 2027. Use Purchase and sales sync. Received delivery notes that are not marked as processed.

GET /integration/purchases/deliveries/pending

Query parameters

  • startDate date · optional — From this reception date. Without dates, returns all.

  • endDate date · optional — Up to this reception date.

  • includeInternal boolean · optional — false excludes internal-type suppliers. Defaults to true.

  • idVendor string · optional — Only this supplier's delivery notes.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/deliveries/pending?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020002",
"deliveryNum": "A-7781",
"deliveryFor": "PED-0153",
"date": 1761984000000,
"dateFormatted": "2026/11/01",
"dateSent": 1761897600000,
"dateSentFormatted": "2026/10/31",
"idVendor": "3515834441676562996102020004",
"vendor": "Distribuciones García",
"codeVendor": "P001",
"accountVendor": "40000001",
"nif": "B12345678",
"vendorType": "Fruit and vegetables",
"vendorTypeCode": "FV",
"vendorTypeInternal": false,
"locked": false,
"sentBy": "Ana López",
"receivedBy": "Marc Puig",
"baseCalculated": 100.0,
"base": 100.0,
"taxes": 10.0,
"total": 110.0,
"listTaxes": [
{ "id": "3515834441676562996102020006", "type": 0, "base": 100.0, "percent": 10.0, "total": 10.0 }
],
"listDeliveries": [
{
"id": "3515834441676562996102020007",
"position": 1,
"idComponent": "3515834441676562996102020008",
"component": "Plum tomato",
"quantity": 20.0,
"unit": "kg",
"cost": 5.0,
"hasFormat": true,
"quantityFormat": 4.0,
"unitFormat": "5 kg box",
"costFormat": 25.0,
"iva": 10.0,
"recibido": true,
"idStore": "3515834441676562996102020012",
"store": "Cold room"
}
],
"listSent": [ … ]
}
]
  • id string — Delivery note id.

  • deliveryNum string — Delivery note number.

  • deliveryFor string — Delivery note reference, usually the order number.

  • date date — Reception date; if there is none, the sent date. dateFormatted string — The same, as YYYY/MM/DD.

  • dateSent date — Date the order was sent. dateSentFormatted string — The same, as YYYY/MM/DD.

  • idVendor, vendor, codeVendor, accountVendor, nif string — Supplier: id, name, code, ledger account and tax id.

  • vendorType, vendorTypeCode string, vendorTypeInternal boolean — Supplier type: name, code and whether it is internal.

  • locked boolean — Locked.

  • sentBy, receivedBy string — Who placed the order and who received it.

  • idCostType, costType, codeCostType, accountCostType, accountAuxCostType string — Delivery note cost account. If assigned per line, it is on each line.

  • idBusinessLine, businessLine, codeBusinessLine string — Business line.

  • baseCalculated number — Base calculated from the received lines, with 5 decimals.

  • base, taxes, total number — Base, taxes (includes shipping, discounts and others) and total.

  • listTaxes array — Taxes: id, type, base, percent and total. type: 0 VAT · 1 shipping · 2 discount · 3 other.

  • listDeliveries array — Received lines.

  • listSent array — Lines of the order as sent.

Each received line (listDeliveries):

  • id string — Line id. position integer — Order.

  • idComponent, component, codeComponent string — Product: id, name and code.

  • codeVendorComponent string — Product code at the supplier.

  • comment string — Comment.

  • recibido boolean — Always true.

  • quantity number, idUnit, unit string — Quantity in the product's base unit.

  • cost number — Cost per base unit. Line amount: quantity × cost.

  • hasFormat boolean — Whether it was bought in a format (e.g. boxes).

  • quantityFormat number, idUnitFormat, unitFormat string, costFormat number — Format: quantity, unit and price per format. null if hasFormat is false.

  • idStore, store string — Store.

  • iva number — VAT %.

  • idCostType, costType, codeCostType, accountCostType, accountAuxCostType string — Line cost account.

  • idBusinessLine, businessLine, codeBusinessLine string — Line business line.

  • listTypes array — Product families: id and descr.

Each line of the order as sent (listSent): the same product, comment and format fields as a received line, with quantity, idUnit and unit in the purchase unit and cost as the purchase price.


List all purchase delivery notes

Retiring on 31 January 2027. Use Purchase and sales sync. Like List pending purchase delivery notes, including processed ones.

GET /integration/purchases/deliveries/all

Query parameters — The same as List pending purchase delivery notes.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/deliveries/all?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response — The same fields as List pending purchase delivery notes.


Mark purchase delivery notes as processed

Retiring on 31 January 2027. Use Purchase and sales sync. They no longer appear in List pending purchase delivery notes.

PUT /integration/purchases/deliveries/processed

Query parameters

  • lock boolean · optional — true also locks them. Defaults to false.

Body

  • listIds array · required — Delivery note ids.

Example

curl -X PUT "https://app.tspoonlab.com/recipes/api/integration/purchases/deliveries/processed?lock=true" \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020002"]}'

Response — No content.


Lock purchase delivery notes

This API has no call to unlock them. It does not count as a change in Purchase and sales sync.

PUT /integration/purchases/deliveries/lock

Body

  • listIds array · required — Delivery note ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/purchases/deliveries/lock \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020002"]}'

Response — No content.


List pending purchase invoices

Retiring on 31 January 2027. Use Purchase and sales sync. Invoices that are not marked as accounted.

GET /integration/purchases/invoices/pending

Query parameters

  • startDate date · optional — From this invoice date. Without dates, returns all.

  • endDate date · optional — Up to this invoice date.

  • includeInternal boolean · optional — false excludes internal-type suppliers. Defaults to true.

  • onlyValidated boolean · optional — true returns only validated invoices. Defaults to false.

  • idVendor string · optional — Only this supplier's invoices.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/invoices/pending?startDate=2026-10-01&endDate=2026-10-31&onlyValidated=true" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020001",
"invoiceNum": "F-2026-0042",
"documentNum": "000123",
"date": 1761955200000,
"dateAccounting": null,
"dateDue": 1764547200000,
"idVendor": "3515834441676562996102020004",
"vendor": "Distribuciones García",
"codeVendor": "P001",
"accountVendor": "40000001",
"nif": "B12345678",
"inEuropeanUnion": false,
"inVies": false,
"country": "ES",
"paid": false,
"validated": true,
"locked": false,
"comment": null,
"codePaymentType": "TRANSF",
"idDocument": "3515834441676562996102020013",
"extDocument": "pdf",
"base": 100.0,
"taxes": 10.0,
"total": 110.0,
"listTaxes": [
{ "id": "3515834441676562996102020006", "type": 0, "base": 100.0, "percent": 10.0, "total": 10.0 }
],
"listCostTypeTaxes": [
{
"id": "3515834441676562996102020014",
"descr": "Raw materials",
"listTaxes": [ { "type": 0, "base": 100.0, "percent": 10.0, "total": 10.0 } ]
}
],
"listDeliveries": [ … ]
}
]
  • id string — Invoice id.

  • invoiceNum string — Supplier's invoice number.

  • documentNum string — Internal document number.

  • date, dateAccounting, dateDue date — Invoice date, accounting date (if null, use date) and due date.

  • idVendor, vendor, codeVendor, accountVendor, nif string — Supplier: id, name, code, ledger account and tax id.

  • inEuropeanUnion, inVies boolean — Intra-EU supplier and registered in VIES.

  • country string — Supplier's country.

  • paid, validated, locked boolean — Paid, validated and locked.

  • comment string — Comment.

  • codePaymentType string — Payment method code.

  • idCostTypeVendor, costTypeVendor, codeCostTypeVendor, accountCostTypeVendor, accountAuxCostTypeVendor string — Supplier's default cost account: id, name, code, ledger account and auxiliary account.

  • idBusinessLine, businessLine, codeBusinessLine string — Business line.

  • idDocument, extDocument string — Attached document: id and extension (see Download an invoice document).

  • base, taxes, total number — Taxable base, taxes and total. total includes withholding.

  • listTaxes array — Taxes: id, type, base, percent and total. type: 0 VAT · 1 shipping · 2 discount · 3 other · 4 withholding.

  • listCostTypeTaxes array — VAT per cost account, calculated from the received lines: account id and descr (null if the lines have none) and listTaxes (base, percent, total).

  • listDeliveries array — The invoice's delivery notes, with the fields of List pending purchase delivery notes.


List all purchase invoices

Retiring on 31 January 2027. Use Purchase and sales sync. Like List pending purchase invoices, including accounted ones.

GET /integration/purchases/invoices/all

Query parameters — The same as List pending purchase invoices.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/invoices/all?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response — The same fields as List pending purchase invoices.


Download an invoice document

Returns the file attached to an invoice.

GET /exportFileBoundFile/{fileName}

Path parameters

  • fileName string · required — File name, e.g. {idDocument}.{extDocument}. The file downloads with its original name.

Query parameters

  • id string · required — The invoice's idDocument.

Example

curl -OJ "https://app.tspoonlab.com/recipes/api/exportFileBoundFile/3515834441676562996102020013.pdf?id=3515834441676562996102020013" \
-H "rememberme: $TOKEN"

Response — The file.


Mark purchase invoices as accounted

Retiring on 31 January 2027. Use Purchase and sales sync. They no longer appear in List pending purchase invoices.

PUT /integration/purchases/invoices/accounted

Query parameters

  • lock boolean · optional — true also locks them. Defaults to false.

Body

  • listIds array · required — Invoice ids.

Example

curl -X PUT "https://app.tspoonlab.com/recipes/api/integration/purchases/invoices/accounted?lock=true" \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020001"]}'

Response — No content.


Mark purchase invoices as not accounted

Retiring on 31 January 2027. Use Purchase and sales sync. They appear again in List pending purchase invoices.

PUT /integration/purchases/invoices/not/accounted

Body

  • listIds array · required — Invoice ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/purchases/invoices/not/accounted \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020001"]}'

Response — No content.


Lock purchase invoices

This API has no call to unlock them. It does not count as a change in Purchase and sales sync.

PUT /integration/purchases/invoices/lock

Body

  • listIds array · required — Invoice ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/purchases/invoices/lock \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020001"]}'

Response — No content.


Get purchase totals by status

Sum of the lines of the period's purchases in a given status, excluding taxes, shipping and discounts. Each purchase counts by its reception date or, if it has none, by its sent date.

GET /integration/purchases/totals

Query parameters

  • startDate date · required — From this date.

  • endDate date · required — Up to this date.

  • type integer · required — Status: 0 not sent · 1 not received · 2 received, not invoiced · 3 received and invoiced · 4 received, invoice accounted · 5 received, invoice not accounted · 6 pending approval · 7 pending review · 8 scanned, pending validation · 9 received · 10 received, invoice validated · 11 received, invoice not validated.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/purchases/totals?startDate=2026-10-01&endDate=2026-10-31&type=2" \
-H "rememberme: $TOKEN"

Response

{ "value": 1250.75 }
  • value number — Total amount. 0 if there are no purchases.


List pending sales delivery notes

Sales delivery notes and orders not marked as accounted, including those not yet sent.

GET /integration/sales/deliveries/pending

Query parameters

  • startDate date · optional — From this delivery date (or creation date, if it has none). Without dates, returns all.

  • endDate date · optional — Up to this date.

  • includeInternal boolean · optional — false excludes internal-type customers. Defaults to true.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/sales/deliveries/pending?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020020",
"invoiceNum": "AV-0311",
"date": 1761984000000,
"idCustomer": "3515834441676562996102020010",
"customer": "Hotel Mediterráneo",
"customerCode": "C015",
"nif": "A87654321",
"address": "Passeig Marítim 12",
"cp": "08003",
"city": "Barcelona",
"contact": "Laura Vidal",
"phone": "933000000",
"mail": "[email protected]",
"customerType": "Hotels",
"customerTypeCode": "HOT",
"customerTypeInternal": false,
"base": 180.0,
"listLines": [
{
"id": "3515834441676562996102020021",
"position": 0,
"idComponent": "3515834441676562996102020022",
"component": "Tomato sauce",
"codeComponent": "ELB-0007",
"codeCustomerProduct": "ST-1",
"sent": true,
"quantity": 12.0,
"unit": "kg",
"cost": 15.0,
"costRecipe": 6.2,
"iva": 10.0
}
],
"listLinesPending": []
}
]
  • id string — Delivery note id.

  • invoiceNum string — Delivery note number.

  • date date — Delivery date.

  • idCustomer, customer, customerCode, nif string — Customer: id, name, code and tax id.

  • address, cp, city string — Customer's address, postcode and city.

  • contact, phone, contactAux, phoneAux, mail, mailAux, mailCC, web string — Customer contacts.

  • customerType, customerTypeCode string, customerTypeInternal boolean — Customer type: name, code and whether it is internal.

  • base number — Base of the sent lines.

  • listLines, listLinesPending array — Sent lines and lines pending to send.

Each line (listLines, listLinesPending):

  • id string — Line id. position integer — Order within the list, from 0.

  • idComponent, component, codeComponent string — Product sold.

  • idMenu, menu, codeMenu string — Group sold.

  • codeCustomerProduct string — Product's sales code for the customer.

  • idCustomerGroup, customerGroup string — Product group.

  • comment string — Comment. On lines with no product or group, the name of the sales product.

  • sent boolean — Sent.

  • quantity number, idUnit, unit string — Quantity and unit.

  • cost number — Unit sale price excluding VAT.

  • costRecipe number — Recipe unit cost.

  • iva number — VAT %.

  • listTypes array — Product families: id and descr.


List all sales delivery notes

Like List pending sales delivery notes, including accounted ones.

GET /integration/sales/deliveries/all

Query parameters — The same as List pending sales delivery notes.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/sales/deliveries/all?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response — The same fields as List pending sales delivery notes.


Mark sales delivery notes as accounted

They no longer appear in List pending sales delivery notes.

PUT /integration/sales/deliveries/accounted

Body

  • listIds array · required — Sales delivery note ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/deliveries/accounted \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020020"]}'

Response — No content.


Mark sales delivery notes as not accounted

They appear again in List pending sales delivery notes.

PUT /integration/sales/deliveries/not/accounted

Body

  • listIds array · required — Sales delivery note ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/deliveries/not/accounted \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020020"]}'

Response — No content.


Lock sales delivery notes

This API has no call to unlock them.

PUT /integration/sales/deliveries/lock

Body

  • listIds array · required — Sales delivery note ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/deliveries/lock \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020020"]}'

Response — No content.


List pending sales invoices

Retiring on 31 January 2027. Use Purchase and sales sync. Invoices that are not marked as accounted.

GET /integration/sales/invoices/pending

Query parameters

  • startDate date · optional — From this invoice date. Without dates, returns all.

  • endDate date · optional — Up to this invoice date.

  • includeInternal boolean · optional — false excludes internal-type customers. Defaults to true.

  • onlyValidated boolean · optional — true returns only validated invoices. Defaults to false.

Example

curl "https://app.tspoonlab.com/recipes/api/integration/sales/invoices/pending?startDate=2026-10-01&endDate=2026-10-31" \
-H "rememberme: $TOKEN"

Response

[
{
"id": "3515834441676562996102020003",
"invoiceNum": "V-2026-0010",
"documentNum": "000045",
"date": 1761955200000,
"dateAccounting": null,
"dateDue": 1764547200000,
"idCustomer": "3515834441676562996102020010",
"customer": "Hotel Mediterráneo",
"codeCustomer": "C015",
"accountCustomer": "43000015",
"nif": "A87654321",
"paid": false,
"locked": false,
"comment": null,
"codePaymentType": "TRANSF",
"base": 180.0,
"taxes": 18.0,
"total": 198.0,
"listTaxes": [
{ "id": "3515834441676562996102020015", "type": 0, "base": 180.0, "percent": 10.0, "total": 18.0 }
],
"listCostTypeTaxes": [ … ],
"listDeliveries": [ … ]
}
]
  • id string — Invoice id.

  • invoiceNum string — Invoice number.

  • documentNum string — Document number.

  • date, dateAccounting, dateDue date — Invoice date, accounting date (if null, use date) and due date.

  • idCustomer, customer, codeCustomer, accountCustomer, nif string — Customer: id, name, code, ledger account and tax id.

  • paid, locked boolean — Collected and locked.

  • comment string — Comment.

  • codePaymentType string — Payment method code.

  • idCostTypeVendor, costTypeVendor, codeCostTypeVendor, accountCostTypeVendor, accountAuxCostTypeVendor string — Customer's default cost account: id, name, code, ledger account and auxiliary account.

  • idDocument, extDocument string — Attached document: id and extension.

  • base, taxes, total number — Taxable base, taxes and total.

  • listTaxes array — Taxes: id, type, base, percent and total. type: 0 VAT · 1 shipping · 2 discount · 3 other.

  • listCostTypeTaxes array — VAT per cost account, calculated from the sent lines: account id and descr (null if the lines have none) and listTaxes (base, percent, total).

  • listDeliveries array — The invoice's sales delivery notes, with the fields of List pending sales delivery notes.


Mark sales invoices as accounted

Retiring on 31 January 2027. Use Purchase and sales sync. They no longer appear in List pending sales invoices.

PUT /integration/sales/invoices/accounted

Body

  • listIds array · required — Sales invoice ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/invoices/accounted \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020003"]}'

Response — No content.


Mark sales invoices as not accounted

Retiring on 31 January 2027. Use Purchase and sales sync. They appear again in List pending sales invoices.

PUT /integration/sales/invoices/not/accounted

Body

  • listIds array · required — Sales invoice ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/invoices/not/accounted \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020003"]}'

Response — No content.


Lock sales invoices

This API has no call to unlock them. It does not count as a change in Purchase and sales sync.

PUT /integration/sales/invoices/lock

Body

  • listIds array · required — Sales invoice ids.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/integration/sales/invoices/lock \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"listIds": ["3515834441676562996102020003"]}'

Response — No content.


Create a purchase order

Creates the order as pending to send, with each product's price from the supplier's catalogue. Returns its id. Each line is identified by ids or by codes.

POST /integration/purchases/orders

Body

  • idVendor string · required unless you send codeVendor — Supplier id (Suppliers and purchases). If you send both, idVendor wins.

  • codeVendor string · required unless you send idVendor — Supplier code.

  • dateSend date · optional — Order date.

  • dateReception date · optional — Expected delivery date.

  • listLines array · optional — Order lines.

The supplier must belong to the cost center.

Each line:

  • idComponent string · required unless you send codeComponent — Product id (idComponent of the supplier's products).

  • codeComponent string · required unless you send idComponent — Product or format code at the supplier. If you send both, they must match.

  • quantity number · required — Quantity, in the line's unit.

  • idUnit string · required unless you send unit — Unit id (Units).

  • unit string · required unless you send idUnit — Unit name.

The unit must be the product's purchase unit at the supplier or its format's unit.

Example

curl https://app.tspoonlab.com/recipes/api/integration/purchases/orders \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"codeVendor": "P001",
"dateSend": "2026-11-03T08:00:00.000+01:00",
"dateReception": "2026-11-04T08:00:00.000+01:00",
"listLines": [
{ "codeComponent": "TP-5", "quantity": 4, "unit": "5 kg box" },
{ "idComponent": "3515834441676562996102020016", "quantity": 2, "idUnit": "3515834441676562996102020009" }
]
}'

Response

{ "id": "3515834441676562996102020001" }

Errors — If the supplier, a product or a unit does not exist or does not match, it returns 406 with { "message": "…" }.


Mark a purchase order as sent

Nothing is sent to the supplier. The sent date becomes the time of the call. If the order is already received, it does not change.

PUT /vendorOrder/{idProvCom}/sent

Path parameters

  • idProvCom string · required — Order id.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/vendorOrder/3515834441676562996102020001/sent \
-H "rememberme: $TOKEN"

Response — No content.


Receive a purchase order

Marks every line as received and creates the delivery note. If the order was marked as processed, it is unmarked.

PUT /vendorOrder/{idProvCom}/received/date

Path parameters

  • idProvCom string · required — Order id.

Body

  • date date · optional — Reception date. Only applied if the order does not already have one.

  • deliveryNum string · optional — Delivery note number.

Example

curl -X PUT https://app.tspoonlab.com/recipes/api/vendorOrder/3515834441676562996102020001/received/date \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"date": "2026-11-04T09:30:00.000+01:00", "deliveryNum": "A-7781"}'

Response — No content.


Create a sales order

Creates a sales order with each product's price from the customer's sales products. Returns its id. Each line is identified by ids or by codes.

POST /integration/sales/orders

Body

  • idCustomer string · required unless you send codeCustomer — Customer id (Customers). If you send both, idCustomer wins.

  • codeCustomer string · required unless you send idCustomer — Customer code.

  • dateSend date · optional — Order date.

  • dateReception date · optional — Expected delivery date.

  • listLines array · optional — Order lines.

The customer must belong to the cost center.

Each line:

  • idComponent string · required unless you send codeComponent — Id of the customer's sales product.

  • codeComponent string · required unless you send idComponent — Product's sales code for the customer. If you send both, they must match.

  • quantity number · required — Quantity.

  • idUnit string · required unless you send unit — Unit id (Units).

  • unit string · required unless you send idUnit — Unit name.

The unit must be the unit of the customer's sales product.

Example

curl https://app.tspoonlab.com/recipes/api/integration/sales/orders \
-H "rememberme: $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"codeCustomer": "C015",
"dateSend": "2026-11-03T08:00:00.000+01:00",
"dateReception": "2026-11-05T08:00:00.000+01:00",
"listLines": [
{ "codeComponent": "ST-1", "quantity": 12, "unit": "kg" }
]
}'

Response

{ "id": "3515834441676562996102020020" }

Errors — If the customer, a product or a unit does not exist or does not match, it returns 406 with { "message": "…" }.

Need help? Message us from the support chat in the bottom-right corner.

Did this answer your question?