Statement Settlement Data

Use our API to browse a list of statement settlement data.

This guide shows you how to use the Reporting API resource to request data from the settlement sections of all of your Maast statements. The settlement section gives an overview of all the batches that correlate to deposits posted to your depository account. You can request data on all settlements, or you can filter to narrow results.

See Statement Settlement Data in API Reference for field definitions.

Prerequisites


Implement

Write a GET request to send to the /platform/reporting/statement-report/settlement endpoint. See the following sample code:

curl --request GET \
     --url https://api-test.maast.com/platform/reporting/statement-report/settlement \
     --header 'accept: application/json' \
     --header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz' 

The above code requests data on all statement settlements for your account, using default sorting and no filtering.

The following sections describe several query parameters that you can add to your request to sort and filter the response. To add these parameters, append them to the request endpoint URL, preceded by ? and separated by &.

Sort

Use the following parameters to sort the data in the response:

  • order_on - Include this to sort results by a certain field. For example, to sort by billing month, write order_on=billing_month. All available fields are listed in the data array in the response model for this request's API Reference.
  • order_by - Include this to sort the specified field by ascending order (asc) or descending order (desc).

Filter

Use the following parameters to filter the response:

  • filter - Include this to narrow results by requiring certain fields to meet specified values. You can combine multiple filters. Each filter contains three properties, packed together with commas:
    • field name - All available fields are listed in the response model of this request's API Reference.
    • filter conditional - Find supported filter conditionals in About Our APIs: Filters.
    • the value on which to filter
  • count - Include this to set the number of records in the result.
  • page - Include this to choose a page to display when there are more results than the count parameter.

🚧

When placing strings in URLs, be sure to use your development language's URL encoding methods (e.g., for hexadecimal, use %2C in lieu of a comma).


Example Request

Once configured, the code for your request will resemble the following sample code:

curl --request GET \
     --url 'https://api-test.maast.com/platform/reporting/statement-report/settlement?count=10&order_on=tran_time&order_by=desc&page=0' \
     --header 'accept: application/json' \
     --header 'authorization: Basic OjllZGVjMjFhMzFjMHh5ejc4OWUzMGEzNDE2YWJjMTIz'

Integrate

Once you have sent your request, you will receive a response like this from the Maast server:

{
  "code": 0,
  "message": "Success",
  "totalPages": 10,
  "totalRecords": 100,
  "data": {
    "rec_id_linked": 0,
    "merchant_id": 212000000001,
    "billing_month": "2022-10-01T00:00:00.000Z",
    "batch_date": "2022-09-19T16:27:46.757Z",
    "reference_number": 0,
    "cnt_purch": 10,
    "amt_purch": 10.1,
    "amt_return": 10.1,
    "discount_paid": 10.1,
    "amt_net": 10.1,
    "source_id": 0
  }
}

Check the code field in the request response: 0 confirms success. If the value is something other than 0, check Platform API Response Codes in Reference.

If you have received at least one monthly statement report from Maast, the data field shows an array of batches that appear in statement settlements. The sample response above shows data for one batch. See Statement Settlement Data in API Reference for response field definitions.


Test and Go Live

See our Test and Go Live guide to test your API integration and to start transacting with an active production account.