Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 1.64 KB

README.md

File metadata and controls

67 lines (45 loc) · 1.64 KB

Line Items

Any methods return promise object.

Static methods

Retrieve order's line items

client.lineItems.find(orderId[, params][, callback(err, items)]);
  • orderId is unique identifier (number) of the order
  • params is object with a list of filters, not required
  • callback is a function, not required

Create a line item

client.lineItems.create(orderId, data[, callback(err, item)]);
  • orderId is unique identifier (number) of the order
  • data is a line item object
  • data.product is a model of the product
  • callback is a function, not required

Retrieve a single line item

client.lineItems.find(orderId, id[, callback(err, item)]);
  • orderId is unique identifier (number) of the order
  • id is unique identifier (number) of the line item
  • callback is a function, not required

Remove a line item

client.lineItems.remove(orderId, id[, callback(err, state)]);
  • orderId is unique identifier (number) of the order
  • id is unique identifier (number) of the line item
  • callback is a function, not required

Model methods

Remove a line item

item.remove(orderId, [callback(err, state)]);
  • orderId is unique identifier (number) of the order
  • callback is a function, not required

Detailed documentation in the official API

License

MIT

Bug Reports

Report here.