Skip to main content

Transactions Detailed report

Overview#

This API can be used to retrieve a detailed transactions report including customer, status, amount and fee details.

Detailed report#

GET https://api-sandbox.sunbit.com/reports/api/v1/detailed#

Request Headers#

PropertyRequiredTypeDescription
sunbit-keyyestextProvided to you by Sunbit
sunbit-secretyestextProvided to you by Sunbit

Body#

AttributeRequiredTypeDescription
locationnotextIf not provided, the response will include all locations of the partner
fromDateyesdateFormat: YYYY-MM-DD
toDateyesdateFormat: YYYY-MM-DD

Response#

AttributeTypeDescription
contentDetailedReport[]Array of DetailedReport aggregate per location

DetailedReport#

AttributeTypeDescription
locationtext
customerIdnumberCustomer id
dateTimeLocalDateTimePurchase date time as format : YYYY-MM-DD'T'hh:mm:ss
statustext
  • DECLINED
  • PURCHASED
  • APPROVED
amountnumberPurchase amount
feenumberFee collected by Sunbit

Example#

Request#

  'https://api-sandbox.sunbit.com/reports/api/v1/detailed'' \  -H 'Content-Type: application/json' \  -H 'sunbit-key: YOUR_KEY' \  -H 'sunbit-secret: YOUR_SECRET' \  -d '{       "fromDate":"2019-01-07",        "toDate":"2021-07-01",        "location": "sandbox"      }    
Response#
{    "content": [        {            "location": "sandbox",            "customerId": 2731,            "dateTime": "2020-10-14T05:45:39",            "status": "PURCHASED",            "amount": 341.46,            "fee": 10.24        }    ]}

Errors#

Error CodeMessageDescription
404Resource Not FoundLocation was not found
403Bad Credentialssunbit-key and/or sunbit-secret do not match any alliance credentials
500Internal Server ErrorSomething went wrong on Sunbit's side