Getting Customer's Balance Update History

Method Description

Invoked with a POST request. Operation name is set up via Maestra framework. Details of method invocation can be found here.

POST https://api.maestra.io/v3/operations/sync?endpointId={unique ID of site/mobile app/etc.}&operation={operation name}

Accept: application/xml
Content-Type: application/xml
Authorization: SecretKey {Secret Key, check with the manager if it’s mandatory}

<operation>
  <customer>
    <ids>
      <webSiteUserId>{customer ID}</webSiteUserId>
    </ids>
  </customer>
  <page>
    <sinceDateTimeUtc>{optional node, start date of balance update display}</sinceDateTimeUtc>
    <tillDateTimeUtc>{optional node, end date of balance update display}</tillDateTimeUtc>
    <pageNumber>{page number}</pageNumber>
    <itemsPerPage>{items per page}</itemsPerPage>
  </page>
</operation>
  • sinceDateTimeUtc and tillDateTimeUtc are optional fields to filter update display by date.
  • Page numbers start at 1.
  • Maximum actions per page is 1000.

Sample Operation

POST https://api.maestra.io/v3/operations/sync?endpointId=Maestra&operation=GetBalanceAction

Accept: application/xml
Content-Type: application/xml

<operation>
  <customer>
    <ids>
      <webSiteUserId>5384275</webSiteUserId>
    </ids>
  </customer>
  <page>
    <sinceDateTimeUtc>2017-08-22 10:00:00.000</sinceDateTimeUtc>
    <tillDateTimeUtc>2017-08-22 11:00:00.000</tillDateTimeUtc>
    <pageNumber>1</pageNumber>
    <itemsPerPage>50</itemsPerPage>
  </page>
</operation>

The request returns top 50 actions.

Response

<result>
  <status>Success</status>
  <customerActions>
    <customerAction>
      <ids>
        <customerActionId>{Maestra id}</customerActionId>
        <externalId>{external action ID}</externalId>
      </ids>
      <actionTemplate>
        <systemName>{internal action template name at Maestra}</systemName>
        <name>{action template name at Maestra}</name>
      </actionTemplate>
      <dateTimeUtc>{date of customer action}</dateTimeUtc>
      <pointOfContact>
        <ids>
          <externalId>{external point of contact ID}</externalId>
        </ids>
      </pointOfContact>
      <customer>
        <ids>
          <customerId>{Maestra id}</customerId>
          <webSiteId>{customer ID}</webSiteId>
        </ids>
      </customer>
      <customerBalanceChanges>
        <customerBalanceChange>
          <changeAmount>{balance update amount}</changeAmount>
          <expirationDateTimeUtc>{bonus points expiry date}</expirationDateTimeUtc>
          <balanceChangeKind>
            <systemName>{balance update type}</systemName>
          </balanceChangeKind>
        </customerBalanceChange>
      </customerBalanceChanges>
    </customerAction>
  </customerActions>
</result>

Balance Update Types

Business meaningUpdate type
Bonus for retail orderRetailOrderBonus
Paying for retail order with bonus pointsRetailOrderPayment
OtherCustom