BimpHelp

Purchasing via the API: from a supplier order to payment

Updated 10 min read

On this page
In short

The purchasing chain in the API mirrors the interface: Supplier order (invoiceForSupplierPayment/api-create), Goods receipt (purchaseInvoice/api-create referencing the order) and Supplier payment (paymentToSupplier/api-create with paymentDetails). Each document is created with a separate request and canceled with api-cancel.

What we are building

Purchasing automation: a planning system, ERP or supplier integration creates Supplier orders in Bimp and records Goods receipts and payments. The document logic is described in Supplier order, Goods receipt and Supplier payment. Below are the same steps at the API level. The company token is passed in the access-token header (Getting started with the API).

Term mapping:

In the interfaceIn the API
Supplier orderinvoiceForSupplierPayment
Goods receiptpurchaseInvoice
Supplier paymentpaymentToSupplier
Return to supplierrefundSupplier
Additional costsadditionalSpendings

Which methods to call and in what order

StepMethodWhy
1counterparty/api-readList (types: ["isSupplier"])Find the supplier; if missing, use counterparty/api-insert with isSupplier: true
2contract/api-readListFind the contract with the supplier
3organization/api-readList, warehouse/api-readList, project/api-readList, lineOfBusiness/api-readListGet reference values for the document
4invoiceForSupplierPayment/api-createCreate the Supplier order with lines
5purchaseInvoice/api-createPost the goods to the warehouse based on the order
6paymentToSupplier/api-createPay the Supplier order
7refundSupplier/api-createIf needed, return goods to the supplier
8invoiceForSupplierPayment/api-readList, purchaseInvoice/api-readList, paymentToSupplier/api-readListMonitor the state: what was ordered, received and paid

How to create a Supplier order

The invoiceForSupplierPayment/api-create method requires the supplier counterparty, the contract contract, the organization organization, the warehouse warehouse, the project project and the author author. Lines are passed as the products array; for each line nomenclature, quantity, price, lineOfBusiness, project and unitOfMeasurment are required.

curl -X POST https://app.bimpsoft.com/org2/invoiceForSupplierPayment/api-create \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "counterparty": "<supplier-uuid>",
    "contract": "<contract-uuid>",
    "organization": "<organization-uuid>",
    "warehouse": "<warehouse-uuid>",
    "project": "<project-uuid>",
    "author": "<employee-uuid>",
    "date": "2026-11-06T09:00:00",
    "automaticPaymentsPlanning": true,
    "products": [
      {
        "nomenclature": "<product-uuid>",
        "quantity": 100,
        "price": 85.5,
        "unitOfMeasurment": "<unit-uuid>",
        "lineOfBusiness": "<line-of-business-uuid>",
        "project": "<project-uuid>"
      }
    ]
  }'

Response: { "success": true, "data": { "uuid": "<supplier-order-uuid>" } }. The automaticPaymentsPlanning: true flag adds the document to the payment calendar. In a line you can pass invoiceForCustomerPayment, the Customer order the goods are being purchased for (purchasing “to order”), and supplierNomenclature, the product name at the supplier. Name mapping is described in Supplier products.

Modifications in lines. A product modification (size, color) is passed in a products line in one of two ways, in both api-create and api-update:

  • the modification uuid in nomenclature, without characteristic: Bimp writes the parent product to the line and the modification as its characteristic, the same as in a Customer order;
  • the parent product uuid in nomenclature and the modification uuid in characteristic.

api-read and api-readList return characteristic and modification in each line, both holding the modification uuid, or null if the line has no modification. The modification field duplicates characteristic and is named the same as in a Customer order.

Supplier order statuses are returned by invoiceForSupplierPayment/api-readStatuses.

How to post goods

purchaseInvoice/api-create creates a Goods receipt document based on a Supplier order. Required header fields: organization, responsible, counterparty, warehouse, contract, invoiceForSupplierPayment, the accounting flags VATaccounted, costWithoutVAT, bookkeperAccounting, managerialAccounting, taxAccounting, and the products array.

For each products line, the required fields are product, orderedCount (ordered), warehouseCount (actually received), cost, sum, VATsum, lineOfBusiness, project and invoiceForCustomerPayment (can be null).

curl -X POST https://app.bimpsoft.com/org2/purchaseInvoice/api-create \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "organization": "<organization-uuid>",
    "responsible": "<employee-uuid>",
    "counterparty": "<supplier-uuid>",
    "warehouse": "<warehouse-uuid>",
    "contract": "<contract-uuid>",
    "invoiceForSupplierPayment": "<supplier-order-uuid>",
    "date": "2026-11-10T12:00:00",
    "VATaccounted": false,
    "costWithoutVAT": false,
    "bookkeperAccounting": true,
    "managerialAccounting": true,
    "taxAccounting": false,
    "products": [
      {
        "product": "<product-uuid>",
        "orderedCount": 100,
        "warehouseCount": 98,
        "cost": 85.5,
        "sum": 8379,
        "VATsum": 0,
        "lineOfBusiness": "<line-of-business-uuid>",
        "project": "<project-uuid>",
        "invoiceForCustomerPayment": null
      }
    ]
  }'

Here 98 of 100 ordered units were received: the difference orderedCount − warehouseCount is shown in the document as a short delivery. After saving, the goods increase the stock in the warehouse warehouse, and the cost price is calculated according to the accounting rules, see Goods receipt. To change a document, use purchaseInvoice/api-update. To post goods without a supplier (surpluses, entering balances), see Inventory via the API.

How to pay a supplier

paymentToSupplier/api-create requires counterparty and currency. The amount and purpose are set by the paymentDetails array: each element has invoiceForSupplierPayment (the Supplier order) and payed (the payment amount). The cash desk or bank account is passed in the paymentEntity field; its value is taken from bankAccounts/api-readList or cashRegistry/api-readList.

curl -X POST https://app.bimpsoft.com/org2/paymentToSupplier/api-create \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "counterparty": "<supplier-uuid>",
    "currency": "<currency-uuid>",
    "organization": "<organization-uuid>",
    "paymentEntity": "<bank-account-uuid>",
    "date": "2026-11-12T10:00:00",
    "comment": "Оплата за замовленням постачальнику",
    "paymentDetails": [
      { "invoiceForSupplierPayment": "<supplier-order-uuid>", "payed": 8379 }
    ]
  }'

One payment can close several orders: add more elements to paymentDetails. For foreign currency payments, each element has a calculationRate field (cross rate). For payment details, see Payments and expenses via the API.

How to return goods to a supplier

refundSupplier/api-create creates a return based on a Goods receipt. Only baseDocument is required: the uuid of the Goods receipt document; the supplier, contract and organization are taken from it. Optional fields: products, warehouse (if omitted, the warehouse of the Goods receipt), responsible, date, number, comment, VATaccounted (if omitted, as in the Goods receipt) and processing. The response contains the uuid of the return. A refund of money from a supplier is a separate document, refundFromSupplier. For business rules, see Return to supplier.

curl -X POST https://app.bimpsoft.com/org2/refundSupplier/api-create \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "baseDocument": "<goods-receipt-uuid>",
    "date": "2026-11-14T10:00:00",
    "comment": "Return of defective goods",
    "products": [
      { "nomenclature": "<product-uuid>", "count": 2, "cost": 85.5 }
    ]
  }'

Each products line requires nomenclature, count (quantity) and cost (unit price); VAT is the uuid of a VAT rate, and without it the company’s default rate is used. The line amount equals cost × count, and VAT is calculated as included in the amount. cost and count must be greater than zero, otherwise a 400 error is returned. If products is omitted, the document amount and VAT are taken from the Goods receipt, that is, the whole receipt is returned.

The Processing flag

The processing key (boolean) is the “Processing” flag: an informational mark that the return relates to tolling. In refundSupplier/api-create you can omit it, and the value is then taken from the base document (the Goods receipt); if the base document has no flag, false is used. In refundSupplier/api-update an omitted processing stays unchanged. refundSupplier/api-read returns processing, while refundSupplier/api-readList does not.

How to update a return

refundSupplier/api-update takes the uuid of the return and only the fields that change: date, number, warehouse, responsible, comment, VATaccounted, processing, baseDocument and products (with the same line fields as on creation). Fields you omit stay as they were. The products you pass replace all lines of the return; the document amount and VAT are recalculated only when products is passed. An empty array products: [] does not clear the lines: it is treated as omitted, so you cannot delete all lines of a return via api-update. A new baseDocument also replaces the supplier, contract and organization with those of the new Goods receipt.

How to read a return and the list of returns

refundSupplier/api-read returns the full return by uuid: uuid, number, name, date, comment, organization, counterparty (the supplier), warehouse, contract, responsible, priceList, currency, documentSum, VATaccounted, VATamount, processing, baseDocument and the products lines (nomenclature, name, count, cost, sum, VAT, VATamount and others).

refundSupplier/api-readList returns an array of returns with pagination (offset, count up to 100). Filters:

FilterValue
periodablePeriod ["from", "to"] in ISO 8601 UTC, for example ["2026-11-01T00:00:00.000Z", "2026-12-01T00:00:00.000Z"]
organizationsArray of organization uuids
showAllAdd unposted documents: cancelled ones and drafts (default false, only posted documents are listed). Access rights by warehouse and line of business still apply

A list row contains uuid, number, name, date, comment, organization, counterparty, responsible, currency and documentSum. The warehouse, contract, VAT, processing, baseDocument and product lines are not returned in the list: call api-read for them. Canceled returns are not included in the list.

How to cancel a return

refundSupplier/api-cancel with a uuid cancels the return: the document is archived and disappears from the api-readList results.

How to pass the external document number and date

The number and date of the supplier’s document (an invoice or a delivery note) are stored in the “External document number” and “External document date” fields. In the API they are externalNumber and externalDate, available in three documents:

DocumentMethods
Supplier orderinvoiceForSupplierPayment: api-create, api-update, api-read, api-readList
Goods receiptpurchaseInvoice: api-create, api-update, api-read, api-readList
Additional costsadditionalSpendings: api-create, api-update, api-read, api-readList
FieldFormat
externalNumberA string of up to 50 characters
externalDateAn ISO 8601 date, for example 2026-11-10
curl -X POST https://app.bimpsoft.com/org2/purchaseInvoice/api-update \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "uuid": "<goods-receipt-uuid>", "externalNumber": "INV-004512", "externalDate": "2026-11-10" }'
  • Creating and updating. The fields are optional. In api-update a field you do not pass stays unchanged.
  • Checks in a Supplier order and a Goods receipt. A date later than today, or a string that is not a date, returns error 400.
  • Reading. api-read and api-readList return externalNumber and externalDate. If the date is empty, externalDate is null; a filled date comes as 2026-11-10T00:00:00.
  • Required fields. If the company requires the external number and date (Settings → Accounting), a Supplier order or a Goods receipt without both fields is not created: the API returns 400 with the same text as the interface, “Fill in the external document number and date”. api-update checks the values after the change: if a field is already filled in the document, you do not have to pass it.

How to find Additional costs by base document

additionalSpendings/api-readList accepts the baseDocument field in filters: an array of base document uuids. The list returns Additional costs created from these documents, for example from an assembly. A document matches if the uuid equals the base document of the Additional costs document itself or the base document of any product line.

curl -X POST https://app.bimpsoft.com/org2/additionalSpendings/api-readList \
  -H "access-token: $COMPANY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "pagination": { "offset": 0, "count": 100 },
    "filters": { "baseDocument": ["<base-document-uuid>"] }
  }'

Each row of the list contains baseDocument, the uuid of the base document. If the document has no base document, the field is absent from the response. Product lines have their own baseDocument, returned by api-read.

How to avoid duplicates

The API specification has no external ID methods for purchasing documents (they exist for Customer orders, shipments, products and counterparties, see External IDs). So store the link to your system like this:

  1. Pass your number in the document’s number field (Supplier order, Goods receipt) and keep a “your ID, Bimp uuid” pair in your own database. readList for purchasing documents has no search by number, and the API does not check that a number is unique, so do not rely on it as a key.
  2. After api-create, immediately record the received uuid in your database, before the next steps.
  3. Before retrying creation after a failure, check api-readList by period (periodable for receipts and payments, the date filter for Supplier orders) and compare number or comment.
  4. Map suppliers through counterparty/api-saveExternalId and products through nomenclature/api-saveExternalId.

Common errors

The Goods receipt is not created, a required field error. Cause: invoiceForSupplierPayment or one of the five accounting fields (VATaccounted, costWithoutVAT, bookkeperAccounting, managerialAccounting, taxAccounting) was not passed. Solution: pass all required header and line fields.

The payment was created, but the order is not considered paid. Cause: a different order is specified in paymentDetails, or the payed amount is less than the order amount. Solution: check invoiceForSupplierPayment and the amount; the remainder is visible in the response (remainder).

A document cannot be changed. If api-update rejects the changes, cancel the document with api-cancel and create a corrected one. A refusal comes from the Bimp back end with an HTTP status and an errors array with a message field; the API itself checks only that the document and reference records exist (404) and that cost and count are greater than zero (400).

Error 429. More than 15 requests per second from an IP were sent, see Limits.

FAQ

Which API method creates a Supplier order?

invoiceForSupplierPayment/api-create. In Bimp, a Supplier order is the document "Invoice for supplier payment", and in the API it is called invoiceForSupplierPayment.

Can I create a Goods receipt without a Supplier order?

In the purchaseInvoice/api-create specification the invoiceForSupplierPayment field is required, so a Goods receipt is created based on a Supplier order. If there is no order, create it as the first step.

How do I pay a Supplier order via the API?

Call paymentToSupplier/api-create: specify the supplier, the currency and, in the paymentDetails array, the Supplier order and the payed amount.

How do I cancel a purchasing document?

Each document has an api-cancel method: purchaseInvoice, invoiceForSupplierPayment, paymentToSupplier, refundSupplier. Pass the document uuid.

How do I pass the supplier's invoice number and date via the API?

Use the externalNumber (up to 50 characters) and externalDate (an ISO 8601 date) fields in api-create or api-update of a Supplier order, a Goods receipt or Additional costs. api-read and api-readList return the same fields.

Was this article helpful?

Read next

Didn't find the answer?Write to us — support replies during business hours.