Transactions Summary Report
#
OverviewThis API can be used to retrieve an aggregated summary of Sunbit transactions. The report will include total revenue generated, approval rates, declines and conversion rates.
caution
The API does not support current date requests. If from / to date includes Current date the result data will be according to Today(-1)
#
Summary with aggregated valueshttps://api-sandbox.sunbit.com/reports/api/v1/summary#
GET#
Request HeadersProperty | Required | Type | Description |
---|---|---|---|
sunbit-key | yes | text | Provided to you by Sunbit |
sunbit-secret | yes | text | Provided to you by Sunbit |
#
BodyAttribute | Required | Type | Description |
---|---|---|---|
location | no | text | If not provided, the response will include all locations of the partner |
fromDate | yes | date | Format: YYYY-MM-DD |
toDate | yes | date | Format: YYYY-MM-DD |
#
ResponseAttribute | Type | Description |
---|---|---|
fromDate | Date | The result start date. format: YYYY-MM-DD |
toDate | Date | The result end date. format: YYYY-MM-DD |
records | SummaryReport[] | Array of SummaryReport aggregate per location |
#
SummaryReportAttribute | Type | Description |
---|---|---|
location | text | |
totalAmountOfPurchases | number | The total amount purchased |
numberOfPurchases | number | The number of purchases |
numberOfApprovals | number | The number of approvals |
numberOfDeclines | number | The number of declines |
approvalRate | number | Applications Approval Rate (approvals/applications) |
conversionRate | number | Conversion Rate (purchases/purchases + approvals) |
#
Example#
Request 'https://api-sandbox.sunbit.com/reports/api/v1/summary'' \ -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{ "fromDate": "2019-01-07", "toDate": "2021-07-01", "records": [ { "location": "sandbox", "totalAmountOfPurchases": 32573.33, "numberOfPurchases": 104, "numberOfApprovals": 0, "numberOfDeclines": 0, "approvalRate": 0.0, "conversionRate": 100.0 } ]}
#
ErrorsError Code | Message | Description |
---|---|---|
404 | Resource Not Found | Location was not found |
403 | Bad Credentials | sunbit-key and/or sunbit-secret do not match any alliance credentials |
500 | Internal Server Error | Something went wrong on Sunbit's side |