Order Items

Get a list of Order Items for an Order

Given an order ID, get a list of order items.

GET https://www.whiplashmerch.com/api/order_items?order_id={order-id}View Response
HTTP/1.1 200 OK
[
  {
    "id":1111,
    "item_id":2345,
    "order_id":1234,
    "package_id":4321,
    "packaging":false,
    "packed":0,
    "price":"88.0",
    "retail_fee":null,
    "wholesale_cost":null,
    "currency":"USD",
    "quantity":1,
    "sku":"TEST1234",
    "description":"Gray Dress Pant Yoga Pants (Straight-Leg) - X-Small Petite",
    "available":true,
    "returnable":null,
    "originator_id":"order_1234-item_1234",
    "provider":"api",
    "created_at":"2017-05-07T18:10:56-04:00",
    "updated_at":"2017-05-07T18:10:56-04:00",
    "serialnumbers":[]
  }
]

Parameters

NameTypeDescription
limit Integer The number of orders returned. Default is 50
offset/page Integer Page to show (defaults to 1)
order_by String Order (defaults to updated_at DESC
since_id Integer Restrict results to after the specified ID
created_at_min Datetime Show orders created after date (format: 2008-01-01 03:00)
created_at_max Datetime Show orders created before date (format: 2008-01-01 03:00)
updated_at_min Datetime Show orders last updated after date (format: 2008-01-01 03:00)
updated_at_max Datetime Show orders last updated before date (format: 2008-01-01 03:00)

Get a single Order Item

Get an order item by its Whiplash ID.

GET https://www.whiplashmerch.com/api/order_items/{order-item-id}View Response
HTTP/1.1 200 OK
{
  "id":1111,
  "item_id":2345,
  "order_id":1234,
  "package_id":4321,
  "packaging":false,
  "packed":0,
  "price":"88.0",
  "retail_fee":null,
  "wholesale_cost":null,
  "currency":"USD",
  "quantity":1,
  "sku":"TEST1234",
  "description":"Gray Dress Pant Yoga Pants (Straight-Leg) - X-Small Petite",
  "available":true,
  "returnable":null,
  "originator_id":"order_1234-item_1234",
  "provider":"api",
  "created_at":"2017-05-07T18:10:56-04:00",
  "updated_at":"2017-05-07T18:10:56-04:00",
  "serialnumbers":[]
}

Get a single Order Item by Originator ID

Order items received via an e-commerce platform or our API also store the incoming ID as the originator_id. You can find and update using this ID as well.

GET https://www.whiplashmerch.com/api/order_items/originator/{originator-id}View Response
HTTP/1.1 200 OK
{
  "id":1111,
  "item_id":2345,
  "order_id":1234,
  "package_id":4321,
  "packaging":false,
  "packed":0,
  "price":"88.0",
  "retail_fee":null,
  "wholesale_cost":null,
  "currency":"USD",
  "quantity":1,
  "sku":"TEST1234",
  "description":"Gray Dress Pant Yoga Pants (Straight-Leg) - X-Small Petite",
  "available":true,
  "returnable":null,
  "originator_id":"order_1234-item_1234",
  "provider":"api",
  "created_at":"2017-05-07T18:10:56-04:00",
  "updated_at":"2017-05-07T18:10:56-04:00",
  "serialnumbers":[]
}

Create an Order Item

Note: You can only create order items for orders which are "processing" (status <= 100).

POST https://www.whiplashmerch.com/api/order_itemsView Response
HTTP/1.1 200 OK
{
  "id":1111,
  "item_id":2345,
  "order_id":1234,
  "package_id":4321,
  "packaging":false,
  "packed":0,
  "price":"88.0",
  "retail_fee":null,
  "wholesale_cost":null,
  "currency":"USD",
  "quantity":1,
  "sku":"TEST1234",
  "description":"Gray Dress Pant Yoga Pants (Straight-Leg) - X-Small Petite",
  "available":true,
  "returnable":null,
  "originator_id":"order_1234-item_1234",
  "provider":"api",
  "created_at":"2017-05-07T18:10:56-04:00",
  "updated_at":"2017-05-07T18:10:56-04:00",
  "serialnumbers":[]
}

Parameters

NameTypeDescription
order_id Integer The order this order item belongs to (you can only switch to unshipped orders) (required)
item_id Integer The item associated with this Order Item (required)
sku String This is automatically set to the item's SKU
description String This is automatically set to the item's description
quantity Integer Number of this item in the order (required)
price Decimal The cost PER ITEM of the order item
currency String The 3-letter currency code that the order item is priced in (USD
wholesale_cost Decimal What the item costs you--useful for your own analytics
available Boolean Should we process orders for this item? (default is true)
returnable Boolean Is this item eligible for returns? (default is null--this is typically used to override an item-level setting)
packaging Boolean Is this item packaging only? (default is false)
originator_id String The ID you use for this order item in your store

Update an Order Item

Note: You can only update order items for orders which are "processing" (status <= 100).

PUT https://www.whiplashmerch.com/api/order_items/{order-item-id}View Response
HTTP/1.1 204 OK

Parameters

NameTypeDescription
order_id Integer The order this order item belongs to (you can only switch to unshipped orders)
item_id Integer The item associated with this Order Item
sku String This is automatically set to the item's SKU
description String This is automatically set to the item's description
quantity Integer Number of this item in the order
price Decimal The cost PER ITEM of the order item
currency String The 3-letter currency code that the order item is priced in (USD
wholesale_cost Decimal What the item costs you--useful for your own analytics
available Boolean Should we process orders for this item? (default is true)
returnable Boolean Is this item eligible for returns? (default is null--this is typically used to override an item-level setting)
packaging Boolean Is this item packaging only? (default is false)
originator_id String The ID you use for this order item in your store

Delete an Order Item

Note: You can only delete order items for orders which are "processing" (status <= 100).

DELETE https://www.whiplashmerch.com/api/order_items/{order-item-id}View Response
HTTP/1.1 204 OK