Retrieving Transaction Lines

Retrieving Lines of a Transaction (lines in the Transaction's Cart)

Get single line by unique key

Line UUID is currently the only key supported

pepperi.api.transactionLines.get(

{ key: {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8"} ,
 fields: [ "UnitsQuantity" , "Item.ExternalID"] } ) 

Returns:

{success: true, 
   object: 
   {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" ,
     UnitsQuantity: 34 , Item.ExternalID: "ABCD123"
 }}

Search list of Transaction Lines by filter

Example:

pepperi.api.transactionLines.search({
  fields: ["Transaction.UUID", "ExternalID", "MyTSA"],
  filter: {
    Operation: "AND", LeftNode: {
      ApiName: "APIName1", Operation: ">",
      Values: ["7"]
    }, RightNode: {
      ApiName: "ApiName2",
      Operation: "InTheLast", Values: ["4", "Weeks"]
    }
  },
  sorting: [{ Field: "MyTSA", Ascending: true }, { Field: "MyTSA2", Ascending: true }],
  pageSize: 1000, page: 1
})

Returns:

{success: true, objects: 
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , ExternalID: "abc123", MyTSA: 12.8},
  {UUID: "aefb5346-74ac-4041-8bb1-a76a3b5e734h" , ExternalID: "abc456", MyTSA: 34.5}
] }

Search list of Transaction Lines by Transaction filter and Transaction Lines filter

The purpose of this function is to enable fetching transaction lines of transactions not loaded yet to memory.

pepperi.api.transactionLines.search ({
fields: [ "UUID", "ExternalID" , "MyTSA"] ,
transactionFilter : { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
          Values : ["7"]},RightNode:{ApiName: "ApiName2",
          Operation: "InTheLast", Values: ["4","Weeks"]} }
filter: { Operation : "AND", LeftNode: {ApiName: "APIName1", Operation : ">",
          Values : ["7"]},RightNode:{ApiName: "ApiName2",
          Operation: "InTheLast", Values: ["4","Weeks"]} } ,
sorting : [{Field: "MyTSA",Ascending: true},{Field: "MyTSA2",Ascending: true }] } , 
pageSize : 1000 , page: 1})

Returns:

{success: true, objects: 
[ {UUID: "aefb523e-74ac-4041-8bb1-a76a3b5e78d8" , ExternalID: "abc123", MyTSA: 12.8},
  {UUID: "aefb5346-74ac-4041-8bb1-a76a3b5e734h" , ExternalID: "abc456", MyTSA: 34.5}
] }

Last updated