Member transaction history

Transactions performed by signed-in Loyalty members are recorded in the Loyalty database. Connect offers the following end-points to retrieve the transaction history of a signed-in Loyalty member.

V2 end-point

The V2 Get Member Transaction History end-point provides the best performance and allows for pagination of transaction results.

GET: /loyalty/member/transactions

Compatibility

The V2 Get Member Transaction History end-point requires Loyalty version 5.0.1.1 or above to be installed. The version of Loyalty is retrieved by the Connect Loyalty Data Loader Task.

If you're using an older version of Loyalty, you'll need to either:

Note: the V1 end-point does not support pagination.

Configuration

The Loyalty Service URL must be correctly configured in the tblLoyaltyModuleConfig table of your VISTAIT database.

When using the Get Member Transaction History end-point, Connect directly communicates with Loyalty, even if you've configured Connect to use Loyalty via Sales Server.

Using the V2 end-point

Loyalty session token

A Loyalty member must be signed-in and their unique Loyalty Session token must be included in the header of the Get Member Transaction History request.

Pagination

By default, the Get Member Transaction History end-point will return the 20 most recent transactions for the signed-in member. You may change the amount of transactions returned by setting the top query parameter of the request.

To paginate a member's transactions, set the skip query parameter of the request to skip over a number of transactions. By default, no transactions are skipped.

Pagination example

If you want to display 40 transactions per page, your requests would look like the following:

  • Page 1: .../transactions?top=40&skip=0
  • Page 2: .../transactions?top=40&skip=40
  • Page 3: .../transactions?top=40&skip=80
  • Page X: .../transactions?top=40&skip=[(X - 1) * 40]

Defining a date range filter

Transactions can be filtered by a given date range. You can define a date range by setting the dateFrom and dateTo query parameters of the request.

Note: Dates must be provided in ISO 8601 format.

API reference

See the V2 API end-point reference for more information on the V2 Get Member Transaction History end-point.

V1 end-point

The V1 Get Member Transaction History end-point can be used when the newer V2 end-point is not available.

POST: /RESTLoyalty.svc/member/transactions

Compatibility

The performance and reliability of the V1 end-point was improved in recent versions of Loyalty. For maximum compatibility of this end-point with Loyalty, use one of the following Loyalty versions:

  • Version 4.5.7.17 and above
  • Version 4.5.8.8 and above
  • Version 5.0.1.1 and above

Using the V1 end-point

Grouping line items into complete transactions

Transactions are comprised of one or more line items. By default, the V1 Get Member Transaction History end-point returns individual transaction line items. However, if you need the complete transactions instead of the individual line items, you can set "ReturnMemberTransactionDetails": true in the request.

Setting the maximum results returned

Connect will return the 20 most recent transaction line items/complete transactions by default. You can configure the amount returned by specifying a value for the MaxResults parameter.

Note: When using an older version of Loyalty, the number of results returned may be less than the MaxResults set. Update to a more compatible version of Loyalty to fix this issue.

API reference

See the V1 API end-point reference for more information on the V1 Get Member Transaction History end-point.