Use cases

Each use case shows which Oscar API v2 calls handle a common integration task. The examples use the test environment (https://testapi.oscar.fi). Every call needs the headers Authorization: Bearer <token> and x-api-key. They are left out of the examples, see Quickstart.

Get the field names of a resource with its GET …/filter/schema call, for example GET /sales/sales-orders/filter/schema.

Sales orders

Sync changed sales orders

Use this to keep an external system up to date with the sales orders in Oscar, for example an online store, a CRM or reporting.

  1. Get the orders changed since the previous run: POST /sales/sales-orders/changes/query
{
  "changedFrom": "2026-11-14T00:00:00Z",
  "changedUntil": "2026-11-15T00:00:00Z",
  "salesDocumentType": "ORDER"
}
  1. Get the changed orders in full, up to 200 codes at a time: POST /sales/sales-orders/query
{
  "codes": ["10045", "10052"]
}
  • When the response has nextContinueAfterId, more rows follow. Repeat the call with the same window and add continueAfterId with that value to the body.
  • changeType: DELETED means that the order was deleted. Delete it from your system too.
  • Use the changedUntil value of the previous run as the changedFrom value of the next run. This way no change is missed.
Get open order rows for delivery planning

Use this when a logistics or planning system needs the confirmed rows that are not yet delivered.

Call: POST /sales/sales-orders/filter

{
  "sf": ["code", "deliveryCustomerName", "estimatedDeliveryDate",
         "rows.rowNumber", "rows.itemCode", "rows.openQuantity", "rows.unitCode"],
  "filter": {
    "and": [
      { "rows.status": { "in": ["CONFIRMED", "PARTIALLY_CONFIRMED"] } },
      { "rows.openQuantity": { "gt": 0 } }
    ]
  },
  "sort": [{ "field": "estimatedDeliveryDate", "specifier": "asc" }],
  "pageNumber": 1,
  "pageSize": 100
}
  • Row fields are selected and filtered with the rows. prefix.
  • An order is returned when one of its rows meets the whole filter. The response contains only those rows.
  • sort takes order header fields only. Rows come in rowNumber order.
Get a customer's orders

Use this when a customer portal or a CRM shows a customer's order history.

Call: POST /sales/sales-orders/filter

{
  "sf": ["code", "orderDate", "status", "totalAmountVatExcluded", "currencyCode"],
  "filter": { "customerCode": { "eq": "C1001" } },
  "sort": [{ "field": "orderDate", "specifier": "desc" }],
  "pageNumber": 1,
  "pageSize": 50
}
  • Without rows. fields, the response contains only the order headers.
  • Get the rows of one order with GET /sales/sales-orders/code/{code}.

Customers

Identify a customer by business ID

Use this when a customer coming from an external system must be matched to a customer in Oscar.

Call: POST /sales/customers/filter

{
  "sf": ["code", "name", "businessCode", "inactive", "salesBlocked"],
  "filter": { "businessCode": { "eq": "1234567-8" } }
}
  • The code in the response identifies the customer in other calls, for example when you get orders.
  • Check inactive and salesBlocked before you use the customer.
Get a customer's contact persons and delivery addresses

Use this when a CRM or an online store needs a customer's contact details.

  1. Get the contact persons: POST /sales/customer-contact-persons/filter
{
  "sf": ["name", "email", "phoneNumber", "corporateTitle"],
  "filter": { "customerCode": { "eq": "C1001" } }
}
  1. Get the customers linked to the customer, for example delivery addresses: GET /sales/customer-relations/customer-code/C1001
  • The role of a linked customer is in businessPartnerRole. A delivery address has the role DELIVERY_PARTY.
  • defaultLink: true marks the link used by default.

More use cases

New resources are released continuously, see the Changelog. If the functionality you need is not in the catalog yet, contact us before you design your integration.