Get Line Items for an Order

Hi,

Using the API is it possible to extract the line items for an order? Ultimately we would lilke to be able to re create our own invoice. is this possible?

Cheers,

Ben

Parents
  • Yeah, definitely. You can use the GetProductsView method on the TXN/Orders resource to return an OrderProductView; the Products collection of which you can then dig in to to get line item details. Exploring the data model in the API Help Pages is usually the easiest way to go about this.

    Do note however that you could leverage the HTML templates feature as one approach to generating a custom invoice. From within an order template, you have access to an OrderProductView (passed in to the template context as a property of Model) for the order the template is being generated against, and Model also provides a RestClient which can be used to dynamically query the rest of the API if you need data that is not provided within the model.

Reply
  • Yeah, definitely. You can use the GetProductsView method on the TXN/Orders resource to return an OrderProductView; the Products collection of which you can then dig in to to get line item details. Exploring the data model in the API Help Pages is usually the easiest way to go about this.

    Do note however that you could leverage the HTML templates feature as one approach to generating a custom invoice. From within an order template, you have access to an OrderProductView (passed in to the template context as a property of Model) for the order the template is being generated against, and Model also provides a RestClient which can be used to dynamically query the rest of the API if you need data that is not provided within the model.

Children
No Data