Hoppa till innehållet

Inköpsorder

Purchase orders with lines, confirmation status and goods receipts. Addressed by orderNumber. Unlike sales orders, draft purchase orders are visible — an order created through this API starts in Draft.

13 anrop GET POST PATCH DELETE Bas-URL https://api.erp.fluit.cloud/preview

Autentisering, felkoder, rate limits, idempotens och paginering gäller alla anrop och står samlade under Kom igång.

GET /purchase-orders

List purchase orders

Returns a paginated list of purchase orders for the authenticated tenant. The status filter is matched case-insensitively and an unknown value returns 400. ?modifiedSince= (ISO 8601 UTC datetime) returns records created or changed at or after that instant, and is the intended way to run an incremental sync.

Visa hela beskrivningen

A change anywhere inside the record counts: editing a line moves the parent's modifiedDate too, so no change can hide below the resource level. Deletions are not visible here: a deleted record is really gone, so it simply stops appearing, which is indistinguishable from "unchanged". Poll GET /preview/deletions?deletedSince= alongside this endpoint to learn what was removed. Unlike sales orders, Draft purchase orders ARE included — an order created via POST /preview/purchase-orders starts in Draft and the caller has to be able to find it again. Sorted by order date descending, then order number.

Frågeparametrar

Fält Typ Beskrivning
status enum Filters on where the order stands in its lifecycle. Draft orders are included in this list, so ?status=Draft narrows to the ones not yet sent. Draft Sent PartiallyConfirmed Confirmed PartiallyReceived Received Closed Cancelled
supplierNumber string Returns only the orders placed with this supplier number.
orderDateFrom string(date) Returns only orders dated on or after this date (ISO 8601 date).
orderDateTo string(date) Returns only orders dated on or before this date (ISO 8601 date).
search string Matches order number and supplier reference, case-insensitively and on partial words.
modifiedSince string(date-time) Returns only records created or changed at or after this instant (ISO 8601 UTC datetime). A change anywhere inside the record counts, including on its lines.
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicPurchaseOrderListItem

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the order was created.
currencyCode string · nullable ISO 4217 currency code for all monetary values on this order.
expectedDeliveryDate string(date) · nullable Date we expect the goods to arrive. Null if not set.
id string(uuid) Internal unique identifier (UUID v7).
lineCount integer Number of purchase order lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp of the last modification. Null if never modified after creation.
orderDate string(date) Date the order was placed (ISO 8601 date).
orderNumber string · nullable Unique purchase order number, e.g. `PO-2026-00042`.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier. Null until confirmed.
status enum Purchase order status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderStatus` name-for-name and value-for-value so the query projections can cast directly — a cast is translatable to SQL where a switch over a helper method is not. `PublicPurchaseEnumParityTests` fails the build if the two ever drift apart, which is what stops a new domain value from silently serialising as a bare number. Unlike sales orders, `Draft`<b>is</b> part of the public contract: a purchase order created through POST /preview/purchase-orders starts in Draft, and the caller has to be able to read back the order it just created before sending it. Draft Sent PartiallyConfirmed Confirmed PartiallyReceived Received Closed Cancelled
supplierName string · nullable Display name of the supplier.
supplierNumber string · nullable Supplier number of the seller.
supplierReference string · nullable The supplier's own order reference. Null if not provided.
totalAmount decimal Total order amount excluding tax, in the order currency. Serialised as a decimal string.
warehouseCode string · nullable Code of the warehouse the goods are received into.
400 ProblemDetails ?status= got a value outside its list.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/purchase-orders" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "createdDate": "2026-06-11T09:24:13.418",
      "currencyCode": "SEK",
      "expectedDeliveryDate": "2026-06-11",
      "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
      "lineCount": 42,
      "links": {
        "self": "string"
      },
      "modifiedDate": "2026-06-11T09:24:13.418",
      "orderDate": "2026-06-11",
      "orderNumber": "SO-2026-1041",
      "promisedDeliveryDate": "2026-06-11",
      "status": "Draft",
      "supplierName": "Nordic Components AB",
      "supplierNumber": "SUP-001",
      "supplierReference": "string",
      "totalAmount": "299.00",
      "warehouseCode": "MAIN"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders

Create a purchase order

Creates a new purchase order for the authenticated tenant. Only supplierNumber is required; all other fields default from the supplier or tenant settings.

Visa hela beskrivningen

The order is created in Draft status and is NOT sent to the supplier — call POST /preview/purchase-orders/{orderNumber}/send when it is ready to go out. orderNumber: if omitted a number is auto-generated from the tenant number sequence. Lines are created atomically with the order — if any line is rejected, no order is created. On a line, omit unitPrice to use the supplier price list, and omit unit to use the item's base unit (400 if the item has no base unit). The response body is the same representation as GET /preview/purchase-orders/{orderNumber}; the canonical URL is returned in the Location header and in links.self.

purchase-orders:write Kräver Idempotency-Key

Body krävs

Fält Typ Beskrivning
currencyCode string · nullable ISO 4217 currency code, e.g. `SEK`, `EUR`. Defaults to the supplier's currency.
deliveryTermCode string · nullable Delivery term / Incoterm code — overrides the supplier default.
expectedDeliveryDate string(date) · nullable Date the goods are expected to arrive. Calculated from the supplier lead time if omitted.
externalNotes string · nullable Free-text notes printed on the purchase order document.
lines CreatePurchaseOrderLine[] · nullable Purchase order lines to create atomically with the order.
orderDate string(date) · nullable Order date. Defaults to today if omitted.
orderNumber string · nullable Custom order number. Auto-generated if omitted. Returns 409 if already in use.
paymentTermCode string · nullable Payment term code — overrides the supplier default.
shippingMethodCode string · nullable Shipping method / carrier code — overrides the supplier default.
supplierNumber Krävs string Number of an existing supplier (exact match).
supplierReference string · nullable Our reference at the supplier, or the supplier's own order number.
warehouseCode string · nullable Code of the warehouse to receive into. Defaults to the tenant's default warehouse.

Svar

201 PublicPurchaseOrderResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the order was created.
currencyCode string · nullable ISO 4217 currency code for all monetary values on this order.
deliveryAddress PurchaseDeliveryAddress Delivery address attached to a purchase order.
deliveryTermCode string · nullable Delivery / Incoterm code, e.g. `DAP`. Null if not set.
deliveryTermName string · nullable Display name of the delivery term. Null if not set.
expectedDeliveryDate string(date) · nullable Date we expect the goods to arrive. Null if not set.
externalNotes string · nullable Free-text notes printed on the purchase order document. Null if not set.
id string(uuid) Internal unique identifier (UUID v7).
isDropShipment boolean Whether the goods ship directly from the supplier to an end customer.
lines PurchaseOrderLine[] · nullable Purchase order lines. Empty list if the order has no lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp of the last modification. Null if never modified after creation.
orderDate string(date) Date the order was placed (ISO 8601 date).
orderNumber string · nullable Unique purchase order number, e.g. `PO-2026-00042`.
paymentTermCode string · nullable Payment term code, e.g. `NET30`. Null if not set.
paymentTermName string · nullable Display name of the payment term. Null if not set.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier. Null until confirmed.
shippingMethodCode string · nullable Shipping method / carrier code. Null if not set.
shippingMethodName string · nullable Display name of the shipping method. Null if not set.
status enum Purchase order status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderStatus` name-for-name and value-for-value so the query projections can cast directly — a cast is translatable to SQL where a switch over a helper method is not. `PublicPurchaseEnumParityTests` fails the build if the two ever drift apart, which is what stops a new domain value from silently serialising as a bare number. Unlike sales orders, `Draft`<b>is</b> part of the public contract: a purchase order created through POST /preview/purchase-orders starts in Draft, and the caller has to be able to read back the order it just created before sending it. Draft Sent PartiallyConfirmed Confirmed PartiallyReceived Received Closed Cancelled
supplierName string · nullable Display name of the supplier.
supplierNumber string · nullable Supplier number of the seller.
supplierReference string · nullable The supplier's own order reference / confirmation number. Null if not provided.
totalAmount decimal Total order amount excluding tax, in the order currency. Serialised as a decimal string.
warehouseCode string · nullable Code of the warehouse the goods are received into.
warehouseName string · nullable Display name of the receiving warehouse.
400 ProblemDetails A field failed validation, one of the referenced codes (supplier, item, warehouse, terms, shipping method) does not exist, or a line omitted unit for an item that has no base unit.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order number passed in orderNumber is already in use.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Full purchase order
{
  "currencyCode": "SEK",
  "deliveryTermCode": "DAP",
  "expectedDeliveryDate": "2026-08-15",
  "lines": [
    {
      "itemNumber": "WIDGET-A",
      "quantity": "100",
      "unit": "st",
      "unitPrice": "42.50"
    },
    {
      "expectedDate": "2026-08-22",
      "itemNumber": "WIDGET-B",
      "quantity": "25"
    }
  ],
  "orderDate": "2026-08-01",
  "paymentTermCode": "NET30",
  "supplierNumber": "SUP-001",
  "supplierReference": "OUR-REF-4711",
  "warehouseCode": "MAIN"
}
Minimal — supplier and one line
{
  "lines": [
    {
      "itemNumber": "WIDGET-A",
      "quantity": "100"
    }
  ],
  "supplierNumber": "SUP-001"
}
Svar 201
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "deliveryAddress": {
    "city": "Stockholm",
    "contactPerson": "string",
    "countryCode": "SE",
    "email": "order@acme.se",
    "name": "Acme AB",
    "phone": "+46 8 123 45 67",
    "postalCode": "11122",
    "street1": "Storgatan 1",
    "street2": "string"
  },
  "deliveryTermCode": "STD",
  "deliveryTermName": "DAP Stockholm",
  "expectedDeliveryDate": "2026-06-11",
  "externalNotes": "string",
  "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
  "isDropShipment": true,
  "lines": [
    {
      "confirmedDeliveryDate": "2026-06-11",
      "confirmedQuantity": "10",
      "confirmedUnitPrice": "299.00",
      "expectedDate": "2026-06-11",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "outstandingQuantity": "10",
      "promisedDeliveryDate": "2026-06-11",
      "quantity": "10",
      "receivedQuantity": "10",
      "status": "Ordered",
      "unit": "st",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderDate": "2026-06-11",
  "orderNumber": "SO-2026-1041",
  "paymentTermCode": "STD",
  "paymentTermName": "30 days net",
  "promisedDeliveryDate": "2026-06-11",
  "shippingMethodCode": "STD",
  "shippingMethodName": "Parcel, next day",
  "status": "Draft",
  "supplierName": "Nordic Components AB",
  "supplierNumber": "SUP-001",
  "supplierReference": "string",
  "totalAmount": "299.00",
  "warehouseCode": "MAIN",
  "warehouseName": "Main warehouse"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /purchase-orders/{orderNumber}

Get a purchase order

Returns a single purchase order identified by its order number (exact match, case-sensitive), including all lines. Line numbers in the response are the business keys used by the line endpoints, e.g.

Visa hela beskrivningen

PATCH /preview/purchase-orders/{orderNumber}/lines/{lineNumber}. confirmedQuantity, confirmedUnitPrice and confirmedDeliveryDate are null until the supplier has confirmed the line. Responses carry a weak ETag; pass it back in If-None-Match to get 304 Not Modified while the record is unchanged. The validator follows the whole record, so a change to a nested part invalidates it too.

purchase-orders:read Stödjer ETag

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order to read. Matched exactly, case-sensitively.

Svar

200 PublicPurchaseOrderResponse
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the order was created.
currencyCode string · nullable ISO 4217 currency code for all monetary values on this order.
deliveryAddress PurchaseDeliveryAddress Delivery address attached to a purchase order.
deliveryTermCode string · nullable Delivery / Incoterm code, e.g. `DAP`. Null if not set.
deliveryTermName string · nullable Display name of the delivery term. Null if not set.
expectedDeliveryDate string(date) · nullable Date we expect the goods to arrive. Null if not set.
externalNotes string · nullable Free-text notes printed on the purchase order document. Null if not set.
id string(uuid) Internal unique identifier (UUID v7).
isDropShipment boolean Whether the goods ship directly from the supplier to an end customer.
lines PurchaseOrderLine[] · nullable Purchase order lines. Empty list if the order has no lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp of the last modification. Null if never modified after creation.
orderDate string(date) Date the order was placed (ISO 8601 date).
orderNumber string · nullable Unique purchase order number, e.g. `PO-2026-00042`.
paymentTermCode string · nullable Payment term code, e.g. `NET30`. Null if not set.
paymentTermName string · nullable Display name of the payment term. Null if not set.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier. Null until confirmed.
shippingMethodCode string · nullable Shipping method / carrier code. Null if not set.
shippingMethodName string · nullable Display name of the shipping method. Null if not set.
status enum Purchase order status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderStatus` name-for-name and value-for-value so the query projections can cast directly — a cast is translatable to SQL where a switch over a helper method is not. `PublicPurchaseEnumParityTests` fails the build if the two ever drift apart, which is what stops a new domain value from silently serialising as a bare number. Unlike sales orders, `Draft`<b>is</b> part of the public contract: a purchase order created through POST /preview/purchase-orders starts in Draft, and the caller has to be able to read back the order it just created before sending it. Draft Sent PartiallyConfirmed Confirmed PartiallyReceived Received Closed Cancelled
supplierName string · nullable Display name of the supplier.
supplierNumber string · nullable Supplier number of the seller.
supplierReference string · nullable The supplier's own order reference / confirmation number. Null if not provided.
totalAmount decimal Total order amount excluding tax, in the order currency. Serialised as a decimal string.
warehouseCode string · nullable Code of the warehouse the goods are received into.
warehouseName string · nullable Display name of the receiving warehouse.
304 Tom body.
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "deliveryAddress": {
    "city": "Stockholm",
    "contactPerson": "string",
    "countryCode": "SE",
    "email": "order@acme.se",
    "name": "Acme AB",
    "phone": "+46 8 123 45 67",
    "postalCode": "11122",
    "street1": "Storgatan 1",
    "street2": "string"
  },
  "deliveryTermCode": "STD",
  "deliveryTermName": "DAP Stockholm",
  "expectedDeliveryDate": "2026-06-11",
  "externalNotes": "string",
  "id": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
  "isDropShipment": true,
  "lines": [
    {
      "confirmedDeliveryDate": "2026-06-11",
      "confirmedQuantity": "10",
      "confirmedUnitPrice": "299.00",
      "expectedDate": "2026-06-11",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "outstandingQuantity": "10",
      "promisedDeliveryDate": "2026-06-11",
      "quantity": "10",
      "receivedQuantity": "10",
      "status": "Ordered",
      "unit": "st",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderDate": "2026-06-11",
  "orderNumber": "SO-2026-1041",
  "paymentTermCode": "STD",
  "paymentTermName": "30 days net",
  "promisedDeliveryDate": "2026-06-11",
  "shippingMethodCode": "STD",
  "shippingMethodName": "Parcel, next day",
  "status": "Draft",
  "supplierName": "Nordic Components AB",
  "supplierNumber": "SUP-001",
  "supplierReference": "string",
  "totalAmount": "299.00",
  "warehouseCode": "MAIN",
  "warehouseName": "Main warehouse"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

PATCH /purchase-orders/{orderNumber}

Update a purchase order

Partially updates a purchase order header. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged. Pass null to clear a nullable field.

Visa hela beskrivningen

Unknown fields are rejected with 400, naming the field and listing the ones this endpoint accepts. orderNumber and supplierNumber cannot be changed — the order number is the resource's address, and changing supplier would invalidate the prices on every line. orderDate, warehouseCode and currencyCode cannot be set to null. Reference codes that do not exist return 400 with the offending field named. To change lines, use the line endpoints.

purchase-orders:write

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order to update.

Body krävs

Fält Typ Beskrivning
currencyCode string · nullable ISO 4217 currency code, e.g. `SEK`, `EUR`. Cannot be null.
deliveryTermCode string · nullable Delivery term / Incoterm code. Pass `null` to clear.
expectedDeliveryDate string(date) · nullable Date the goods are expected to arrive. Pass `null` to clear.
externalNotes string · nullable Free-text notes printed on the purchase order document. Pass `null` to clear.
orderDate string(date) · nullable Order date. Cannot be null.
paymentTermCode string · nullable Payment term code. Pass `null` to clear.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier. Pass `null` to clear.
shippingMethodCode string · nullable Shipping method / carrier code. Pass `null` to clear.
supplierReference string · nullable Our reference at the supplier, or the supplier's order number. Pass `null` to clear.
warehouseCode string · nullable Code of the warehouse to receive into. Cannot be null.

Svar

204 Tom body.
400 ProblemDetails The body is not a JSON object, contains a field this endpoint does not have, a reference code does not exist, or orderDate, warehouseCode or currencyCode was sent as null.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is cancelled or closed and no longer accepts changes.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X PATCH "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/cancel

Cancel a purchase order

Cancels a purchase order. Only orders where nothing has been received can be cancelled — use close instead when goods have already arrived but no more are expected.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order to cancel.

Svar

204 Tom body.
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails Goods have already been received on the order, or it is already closed or cancelled.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/cancel" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)"
Svar 404
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/close

Close a purchase order

Closes a purchase order so that no further receipts are expected, even if quantities remain outstanding. Use this to settle short deliveries the supplier will not complete.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order to close.

Svar

204 Tom body.
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is already closed or cancelled.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/close" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)"
Svar 404
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/confirm

Confirm a purchase order

Records that the supplier has confirmed the order, moving it to Confirmed. Pass supplierReference to store the supplier's own order number from their confirmation. The request body is optional.

Visa hela beskrivningen

This is a header-level status transition only: it does not populate the per-line confirmation fields (confirmedQuantity, confirmedUnitPrice, confirmedDeliveryDate), which stay null and are reserved for the structured confirmation flow that is not yet part of the public API. If the supplier confirmed different quantities or dates, patch the affected lines (PATCH /preview/purchase-orders/{orderNumber}/lines/{lineNumber}) — note that this changes what is ordered, so the deviation is applied rather than recorded alongside the original values.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order the supplier has confirmed.

Body

Fält Typ Beskrivning
supplierReference string · nullable The supplier's own order or confirmation number, if they quoted one.

Svar

204 Tom body.
400 ProblemDetails supplierReference is longer than 100 characters.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is not Sent or PartiallyConfirmed, so there is nothing to confirm.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/confirm" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Confirm with the supplier's order number
{
  "supplierReference": "SO-99887"
}
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /purchase-orders/{orderNumber}/lines

List purchase order lines

Returns the lines on a purchase order, sorted by line number ascending. The same lines are also embedded in GET /preview/purchase-orders/{orderNumber}; this endpoint exists so that orders with many lines can be paged through.

purchase-orders:read Paginerad

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order whose lines to list.

Frågeparametrar

Fält Typ Beskrivning
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicPurchaseOrderLineResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
confirmedDeliveryDate string(date) · nullable Delivery date confirmed by the supplier. Null until confirmed.
confirmedQuantity decimal · nullable Quantity confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
confirmedUnitPrice decimal · nullable Unit price confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
expectedDate string(date) · nullable Expected delivery date for this line (ISO 8601 date). Null if not set.
itemName string · nullable Display name of the ordered item.
itemNumber string · nullable Item number of the ordered item.
lineNumber integer 1-based sequential line number within the order — the business key used in line URLs.
lineTotal decimal Line total excluding tax (UnitPrice × Quantity). Serialised as a decimal string.
notes string · nullable Free-text line notes. Null if not set.
outstandingQuantity decimal Remaining quantity not yet received (Quantity − ReceivedQuantity). Serialised as a decimal string.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier for this line. Null until confirmed.
quantity decimal Ordered quantity. Serialised as a decimal string.
receivedQuantity decimal Quantity already received into stock. Serialised as a decimal string.
status enum Purchase order line status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderLineStatus` — see PublicApi.Preview.Purchasing.Queries.PublicPurchaseOrderStatus. Ordered Confirmed ConfirmedWithDeviations PartiallyReceived Received Cancelled
unit string · nullable Unit of measure code, e.g. `st`, `kg`.
unitPrice decimal Purchase price per unit in the order currency. Serialised as a decimal string.
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/lines" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "confirmedDeliveryDate": "2026-06-11",
      "confirmedQuantity": "10",
      "confirmedUnitPrice": "299.00",
      "expectedDate": "2026-06-11",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "outstandingQuantity": "10",
      "promisedDeliveryDate": "2026-06-11",
      "quantity": "10",
      "receivedQuantity": "10",
      "status": "Ordered",
      "unit": "st",
      "unitPrice": "299.00"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/lines

Add a line to a purchase order

Adds a line to an existing purchase order. If unitPrice is omitted the price is resolved from the supplier price list for the item. If unit is omitted the item's base unit is used (400 if the item has no base unit). The Location header points at the new line's address, purchase-orders/{orderNumber}/lines/{lineNumber}.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order to add the line to.

Body krävs

Fält Typ Beskrivning
expectedDate string(date) · nullable Expected delivery date for this line.
itemNumber Krävs string Item number of an existing item.
notes string · nullable Free-text line notes.
quantity decimal Ordered quantity. Must be greater than zero.
unit string · nullable Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.
unitPrice decimal · nullable Overrides the supplier's price for the item. Omit to use the supplier price list.

Svar

201 PublicPurchaseOrderLineResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
confirmedDeliveryDate string(date) · nullable Delivery date confirmed by the supplier. Null until confirmed.
confirmedQuantity decimal · nullable Quantity confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
confirmedUnitPrice decimal · nullable Unit price confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
expectedDate string(date) · nullable Expected delivery date for this line (ISO 8601 date). Null if not set.
itemName string · nullable Display name of the ordered item.
itemNumber string · nullable Item number of the ordered item.
lineNumber integer 1-based sequential line number within the order — the business key used in line URLs.
lineTotal decimal Line total excluding tax (UnitPrice × Quantity). Serialised as a decimal string.
notes string · nullable Free-text line notes. Null if not set.
outstandingQuantity decimal Remaining quantity not yet received (Quantity − ReceivedQuantity). Serialised as a decimal string.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier for this line. Null until confirmed.
quantity decimal Ordered quantity. Serialised as a decimal string.
receivedQuantity decimal Quantity already received into stock. Serialised as a decimal string.
status enum Purchase order line status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderLineStatus` — see PublicApi.Preview.Purchasing.Queries.PublicPurchaseOrderStatus. Ordered Confirmed ConfirmedWithDeviations PartiallyReceived Received Cancelled
unit string · nullable Unit of measure code, e.g. `st`, `kg`.
unitPrice decimal Purchase price per unit in the order currency. Serialised as a decimal string.
400 ProblemDetails A field failed validation, no item has that item number, or unit was omitted for an item that has no base unit.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is cancelled or closed, or otherwise in a state that no longer accepts new lines.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/lines" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Add purchase order line
{
  "itemNumber": "WIDGET-B",
  "quantity": "25",
  "unit": "st",
  "unitPrice": "17.90"
}
Svar 201
{
  "confirmedDeliveryDate": "2026-06-11",
  "confirmedQuantity": "10",
  "confirmedUnitPrice": "299.00",
  "expectedDate": "2026-06-11",
  "itemName": "Widget A",
  "itemNumber": "WIDGET-A",
  "lineNumber": 1,
  "lineTotal": "299.00",
  "notes": "string",
  "outstandingQuantity": "10",
  "promisedDeliveryDate": "2026-06-11",
  "quantity": "10",
  "receivedQuantity": "10",
  "status": "Ordered",
  "unit": "st",
  "unitPrice": "299.00"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

PATCH /purchase-orders/{orderNumber}/lines/{lineNumber}

Update a purchase order line

Partially updates a purchase order line identified by its line number. Only provided fields are updated (JSON Merge Patch semantics); omitted fields are left unchanged. quantity, unitPrice and unit cannot be null; pass null for expectedDate, promisedDeliveryDate or notes to clear them.

Visa hela beskrivningen

Line and order totals are recalculated automatically. The item on a line cannot be changed — delete the line and add a new one instead. Unlike the resource-level PATCH endpoints, fields this endpoint does not recognise are ignored rather than rejected, and field names are matched case-sensitively — send them exactly as documented.

purchase-orders:write

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order the line belongs to.
lineNumber Krävs integer Line number of the line, as reported in lineNumber on the order.

Body krävs

Fält Typ Beskrivning
expectedDate string(date) · nullable Expected delivery date for this line. Pass `null` to clear.
notes string · nullable Free-text line notes. Pass `null` to clear.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier. Pass `null` to clear.
quantity decimal · nullable Ordered quantity. Must be greater than zero. Cannot be null.
unit string · nullable Unit of measure code, e.g. `st`, `kg`. Cannot be null.
unitPrice decimal · nullable Purchase price per unit in the order currency. Cannot be null.

Svar

204 Tom body.
400 ProblemDetails The body is not a JSON object, quantity, unitPrice or unit was sent as null, or a value falls outside its allowed range.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number, or no line with that line number on it.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is closed or cancelled and no longer accepts changes to its lines.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X PATCH "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/lines/{lineNumber}" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

DELETE /purchase-orders/{orderNumber}/lines/{lineNumber}

Delete a purchase order line

Removes a line from a purchase order and recalculates the order totals.

purchase-orders:write

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order the line belongs to.
lineNumber Krävs integer Line number of the line, as reported in lineNumber on the order.

Svar

204 Tom body.
404 ProblemDetails No purchase order with that order number, or no line with that line number on it.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is closed or cancelled and no longer accepts changes to its lines.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 400 401 403 Felhantering

Exempel

curl
curl -X DELETE "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/lines/{lineNumber}" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 404
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/lines/{lineNumber}/receive

Receive goods on a purchase order line

Books received goods into stock against a purchase order line.

Visa hela beskrivningen

This increases the on-hand quantity, creates an inventory transaction and advances the line and order status (PartiallyReceived, then Received once the full quantity has arrived). locationCode must be a location in the order's receiving warehouse; omit it to use that warehouse's default receiving location. unitCost records what the goods actually cost if it differs from the ordered price — it feeds the inventory valuation and must not be negative. serialNumber and batchNumber are stored on the receipt as supplied; they are not currently validated against the item's tracking type, so send the right one for the item. Receiving is not reversible through this API; a retry with the same Idempotency-Key replays the original response instead of booking the goods twice. The response contains the created receipt id and the line as it stands after the receipt.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the purchase order the goods arrived on.
lineNumber Krävs integer Line number of the line being received, as reported in lineNumber on the order.

Body krävs

Fält Typ Beskrivning
batchNumber string · nullable Batch / lot number, for batch-tracked items.
locationCode string · nullable Warehouse location to receive into. Defaults to the warehouse's default receiving location.
notes string · nullable Free-text notes stored on the receipt.
quantity decimal Quantity received. Must be greater than zero.
serialNumber string · nullable Serial number, for serial-tracked items.
unitCost decimal · nullable Actual unit cost for this receipt. Must not be negative. Defaults to the line's unit price.

Svar

200 ReceivePurchaseOrderLineResponse
Fält Typ Beskrivning
line PurchaseOrderLine A single purchase order line.
receiptId string(uuid) Internal unique identifier of the created receipt (UUID v7).
400 ProblemDetails The quantity is zero or less, it exceeds what is still outstanding on the line, unitCost is negative, or locationCode is not a location in the order's receiving warehouse.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number, or no line with that line number on it.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is in a status that cannot receive goods, such as Draft or Cancelled.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/lines/{lineNumber}/receive" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Partial receipt into a specific location with a batch number
{
  "batchNumber": "B-2026-08-14",
  "locationCode": "A-01-02",
  "notes": "Short delivery, remainder promised week 34",
  "quantity": "40",
  "unitCost": "42.75"
}
Receive the full outstanding quantity
{
  "quantity": "100"
}
Svar 200
{
  "line": {
    "confirmedDeliveryDate": "2026-06-11",
    "confirmedQuantity": "10",
    "confirmedUnitPrice": "299.00",
    "expectedDate": "2026-06-11",
    "itemName": "Widget A",
    "itemNumber": "WIDGET-A",
    "lineNumber": 1,
    "lineTotal": "299.00",
    "notes": "string",
    "outstandingQuantity": "10",
    "promisedDeliveryDate": "2026-06-11",
    "quantity": "10",
    "receivedQuantity": "10",
    "status": "Ordered",
    "unit": "st",
    "unitPrice": "299.00"
  },
  "receiptId": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /purchase-orders/{orderNumber}/send

Send a purchase order

Moves a purchase order from Draft to Sent. By default this only records that the order has gone out — nothing is emailed. That is the right behaviour when the order reaches the supplier over EDI or another channel you control.

Visa hela beskrivningen

Set sendEmail=true to have Fluit email the purchase order PDF to the supplier; the address defaults to the supplier's purchaseOrderEmail and 400 is returned if neither that nor toEmail is set. Sending an email is not reversible, so retries with the same Idempotency-Key replay the original response instead of sending again. The request body is optional; POSTing with no body sends without email.

purchase-orders:write Kräver Idempotency-Key

Sökvägsparametrar

Fält Typ Beskrivning
orderNumber Krävs string Order number of the draft purchase order to send.

Body

Fält Typ Beskrivning
message string · nullable Custom email body. Only used when sendEmail is true.
sendEmail boolean Set to `true` to email the purchase order PDF to the supplier. Defaults to `false`, which only moves the order to Sent — use it when the order has already been transmitted by EDI or another channel.
subject string · nullable Custom email subject. Only used when sendEmail is true.
toEmail string(email) · nullable Recipient address. Defaults to the supplier's purchase order email. Only used when sendEmail is true.

Svar

204 Tom body.
400 ProblemDetails sendEmail is true but neither toEmail nor the supplier's purchaseOrderEmail is set, or the order has no lines to send.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No purchase order with that order number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The order is not in a status it can be sent from — it is cancelled, closed, or already sent.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/purchase-orders/{orderNumber}/send" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Email the purchase order to the supplier
{
  "sendEmail": true,
  "subject": "Purchase order PO-2026-00042"
}
Mark as sent without emailing (default)
{}
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

Scheman

Objekten som gruppens anrop refererar till. Fälttabellerna ovan går ett steg djupt och länkar hit i stället för att upprepa samma schema på varje endpoint.

CreatePurchaseOrderLine

CreatePurchaseOrderLineInput
Fält Typ Beskrivning
expectedDate string(date) · nullable Expected delivery date for this line (overrides the order-level date).
itemNumber Krävs string Item number of an existing item.
notes string · nullable Free-text line notes.
quantity decimal Ordered quantity. Must be greater than zero.
unit string · nullable Unit of measure code, e.g. `st`, `kg`. Defaults to the item's base unit.
unitPrice decimal · nullable Overrides the supplier's price for the item. Omit to use the supplier price list.

PurchaseDeliveryAddress

PublicPurchaseDeliveryAddressResponse

Delivery address attached to a purchase order.

Fält Typ Beskrivning
city string · nullable City name.
contactPerson string · nullable Contact person at the delivery address. Null if not set.
countryCode string · nullable ISO 3166-1 alpha-2 country code, e.g. `SE`.
email string · nullable Email address at the delivery address. Null if not set.
name string · nullable Recipient company or person name.
phone string · nullable Phone number at the delivery address. Null if not set.
postalCode string · nullable Postal / ZIP code.
street1 string · nullable Street address line 1.
street2 string · nullable Street address line 2 (c/o, suite, etc.). Null if not set.

PurchaseOrderLine

PublicPurchaseOrderLineResponse

A single purchase order line.

Fält Typ Beskrivning
confirmedDeliveryDate string(date) · nullable Delivery date confirmed by the supplier. Null until confirmed.
confirmedQuantity decimal · nullable Quantity confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
confirmedUnitPrice decimal · nullable Unit price confirmed by the supplier. Null until confirmed. Serialised as a decimal string.
expectedDate string(date) · nullable Expected delivery date for this line (ISO 8601 date). Null if not set.
itemName string · nullable Display name of the ordered item.
itemNumber string · nullable Item number of the ordered item.
lineNumber integer 1-based sequential line number within the order — the business key used in line URLs.
lineTotal decimal Line total excluding tax (UnitPrice × Quantity). Serialised as a decimal string.
notes string · nullable Free-text line notes. Null if not set.
outstandingQuantity decimal Remaining quantity not yet received (Quantity − ReceivedQuantity). Serialised as a decimal string.
promisedDeliveryDate string(date) · nullable Delivery date promised by the supplier for this line. Null until confirmed.
quantity decimal Ordered quantity. Serialised as a decimal string.
receivedQuantity decimal Quantity already received into stock. Serialised as a decimal string.
status enum Purchase order line status values exposed via the Public API. Mirrors `Domain.Common.Enums.PurchaseOrderLineStatus` — see PublicApi.Preview.Purchasing.Queries.PublicPurchaseOrderStatus. Ordered Confirmed ConfirmedWithDeviations PartiallyReceived Received Cancelled
unit string · nullable Unit of measure code, e.g. `st`, `kg`.
unitPrice decimal Purchase price per unit in the order currency. Serialised as a decimal string.