Shop Order Lines API

List shop order lines

List all shop order lines for an account:

GET /shop_order_lines

Response

status: 200 OK
[
  {
    "completed_at": null,
    "created_at": "2022-11-29T04:20:13-06:00",
    "id": 4,
    "name": "HP Compaq 6730s",
    "ordered_at": "2022-11-29T04:20:32-06:00",
    "quantity": 3,
    "requested_for": {
      "id": 96,
      "name": "Beatrice Baldwin",
      "account": {
        "id": "widget",
        "name": "Widget International"
      },
      "nodeID": "..."
    },
    "shop_article": "HPC6730s",
    "sourceID": null,
    "status": "fulfillment_pending",
    "updated_at": "2022-11-30T03:57:05-06:00",
    "nodeID": "..."
  },
  {
    "completed_at": null,
    "created_at": "2022-11-24T08:11:22-06:00",
    "id": 1,
    "name": "Dell Precision M4400",
    "ordered_at": null,
    "quantity": 1,
    "requested_for": {
      "id": 239,
      "name": "Heinrich Čihař",
      "account": {
        "id": "widget",
        "name": "Widget International"
      },
      "nodeID": "..."
    },
    "shop_article": "DellM4400",
    "sourceID": null,
    "status": "in_cart",
    "updated_at": "2022-11-24T08:11:22-06:00",
    "nodeID": "..."
  },
  "..."
]

The response contains these fields by default. Filtering and pagination are available to reduce/limit the collection of shop order lines.

Predefined Filters

The following predefined filters are available:

Collection Fields

By default the following fields will appear in collections of shop order lines:

id, sourceID, requested_for, shop_article, name, status, quantity, ordered_at, completed_at, created_at, updated_at

Obtain a different set of fields using the ?fields= parameter.

Filtering

Filtering is available for the following fields:

id source sourceID, status, completed_at, created_at updated_at

Sorting

By default a collection of shop order lines is sorted ascending by id.

The following fields are accepted by the ?sort= parameter:

id sourceID, status, completed_at, created_at updated_at

Get a single shop order line

GET /shop_order_lines/:id

Response

status: 200 OK
{
  "completed_at": null,
  "created_at": "2022-11-29T04:20:13-06:00",
  "custom_fields": [
    {
      "id": "color",
      "value": "green"
    }
  ],
  "delivery_address": "1919 Briar Oaks Lane",
  "delivery_city": "Houston",
  "delivery_country": "US",
  "delivery_state": "TX",
  "delivery_zip": "77027",
  "fulfillment_request": {
    "id": 90659,
    "subject": "HP Compaq 6730s",
    "nodeID": "..."
  },
  "fulfillment_task": {
    "id": 32070,
    "subject": "HP Compaq 6730s",
    "nodeID": "..."
  },
  "fulfillment_template": {
    "id": 1401,
    "subject": "Deliver Shop Article",
    "localized_subject": "Deliver Shop Article",
    "nodeID": "..."
  },
  "id": 4,
  "name": "HP Compaq 6730s",
  "order": {
    "id": 90658,
    "subject": "Order for 'HP Compaq 6730s'",
    "nodeID": "..."
  },
  "ordered_at": "2022-11-29T04:20:32-06:00",
  "price": "799.0",
  "price_currency": "usd",
  "provider_ordered_at": "2022-11-29T04:20:32-06:00",
  "provider_price": "799.0",
  "provider_price_currency": "usd",
  "provider_recurring_period": null,
  "provider_recurring_price": null,
  "provider_recurring_price_currency": null,
  "provider_total_price": "2397.0",
  "provider_total_recurring_price": null,
  "quantity": 3,
  "recurring_period": null,
  "recurring_price": null,
  "recurring_price_currency": null,
  "requested_for": {
    "id": 96,
    "name": "Beatrice Baldwin",
    "account": {
      "id": "widget",
      "name": "Widget International"
    },
    "nodeID": "..."
  },
  "shop_article": "HPC6730s",
  "source": "4me",
  "sourceID": null,
  "status": "fulfillment_pending",
  "total_price": "2397.0",
  "total_recurring_price": null,
  "updated_at": "2022-11-30T03:57:05-06:00",
  "nodeID": "..."
}

The response contains these fields.

Create a shop order line

POST /shop_order_lines

When creating a new shop order line these fields are available.

Response

status: 201 Created
{
  "created_at": "...",
  "...": "..."
}

The response contains all fields of the created shop order line and is similar to the response in Get a single shop order line

Update a shop order line

PATCH /shop_order_lines/:id

When updating a shop order line these fields are available.

Response

status: 200 OK
{
  "created_at": "...",
  "...": "..."
}

The response contains all fields of the updated shop order line and is similar to the response in Get a single shop order line

Fields

completed_at
Readonly datetime — The date and time at which the shop order line was completed.
created_at
Readonly datetime — The date and time at which the shop order line was created.
custom_fields
Optional custom fields — Custom fields provided in JSON format by the UI Extension that is linked to the ordered shop article.
delivery_address
Readonly string (max 1024) — The delivery address lines.
delivery_city
Readonly string (max 128) — The delivery city name.
delivery_country
Readonly string (max 128) — The delivery country name.
delivery_state
Readonly string (max 30) — The delivery state name.
delivery_zip
Readonly string (max 20) — The delivery zip code.
fulfillment_request
Readonly reference to Request — The request generated for the fulfillment of this shop order line.
fulfillment_task
Readonly reference to Task — The fulfillment task in the order workflow related to this shop order line.
fulfillment_template
Readonly reference to Request Template — The request template linked to the fulfillment task used to generate the fulfillment request.
id
Readonly integer — The unique ID of the shop order line.
name
Readonly string (max 128) — The Name of the shop order line.
order
Readonly reference to Request — The order request related to this shop order line.
ordered_at
Readonly datetime — The date and time at which the shop article was ordered. This corresponds to the time the order request was registered by the user.
price
Readonly decimal — The price to be charged per unit at the time the shop article was ordered.
price_currency
Readonly reference — The currency of the price.
recurring_period
Readonly enum — The Recurring period field is used to select the interval for the recurring price. Valid values are:
  • monthly: Monthly
  • yearly: Yearly
recurring_price
Readonly decimal — The recurring price to be charged recurrently per unit for the shop article that was ordered.
recurring_price_currency
Readonly reference — The currency of the recurrent price.
provider_ordered_at
Readonly datetime — The date and time at which the shop article was ordered at the provider. This corresponds to the time at which the fulfillment request was generated.
provider_price
Readonly decimal — The price to be charged by the provider per unit at the time the shop article was ordered.
provider_price_currency
Readonly reference — The currency of the provider price.
provider_recurring_period
Readonly enum — The Recurring period field is used to select the interval for the provider recurring price. Valid values are:
  • monthly: Monthly
  • yearly: Yearly
provider_recurring_price
Readonly decimal — The recurring price to be charged recurrently per unit by the provider for the shop article that was ordered.
provider_recurring_price_currency
Readonly reference — The currency of the provider recurrent price.
quantity
Required decimal, default: 1 — The Quantity field is used to enter the number of units of the shop article that is being ordered.
provider_total_price
Readonly decimal — The total (non-recurrent) price to be charged by the provider for all units combined.
provider_total_recurring_price
Readonly decimal — The total yearly recurrent price to be charged by the provider for all units combined.
requested_by
Readonly reference to Person — The person who submitted the order.
requested_for
Optional reference to Person — The person for whom the shop articles are ordered. Defaults to the requested_by.
shop_article
Readonly string containing reference field of Shop Article — The shop article that was ordered.
shop_article_id
Required on create integer — The unique ID of the shop article that is being ordered.
source
Readonly string (max 30) - See source
sourceID
Readonly string (max 128) - See source
status
Readonly enum — The status of the shop order line. Valid values are:
  • in_cart: In Cart
  • workflow_pending: Workflow Pending
  • fulfillment_pending: Fulfillment Pending
  • completed: Completed
  • canceled: Canceled
total_price
Readonly decimal — The total (non-recurrent) price to be charged for all units combined.
total_recurring_price
Readonly decimal — The total yearly recurrent price to be charged for all units combined.
updated_at
Readonly datetime — The date and time of the last update of the shop order line. If the shop order line has no updates it contains the created_at value.