Skip to main content

Transactions Summary Report

Overview#

This 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 values#

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

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
fromDateDateThe result start date. format: YYYY-MM-DD
toDateDateThe result end date. format: YYYY-MM-DD
recordsSummaryReport[]Array of SummaryReport aggregate per location

SummaryReport#

AttributeTypeDescription
locationtext
totalAmountOfPurchasesnumberThe total amount purchased
numberOfPurchasesnumberThe number of purchases
numberOfApprovalsnumberThe number of approvals
numberOfDeclinesnumberThe number of declines
approvalRatenumberApplications Approval Rate (approvals/applications)
conversionRatenumberConversion 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        }    ]}

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