Skip to main content

Transaction Lookup

Overview#

You can retrieve transaction details using this API (for example after the Sunbit window has closed)

Transaction lookup

Transaction lookup#

The Pre-Qualification URL API can be used to retrieve and send a pre-qualification URL to a customer.

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

Headers#

AttributeRequiredTypeDescription
sunbit-keyyestextProvided to you by Sunbit
sunbit-secretnotextProvided to you by Sunbit

Query Parameters#

AttributeRequiredTypeDescription
purchaseIdno (if transactionId is populated)textThe purchase Id that is generated by Sunbit for successful Sunbit flow. This ID is returned in the webhook
transactionIdno (if purchaseId is populated)textYour internal id for the current transaction, should be the same as you provided during the initialization call

Response#

AttributeTypeDescription
purchaseIdtextThe purchase Id that is generated by Sunbit and returned in the e-Pay SDK after a successful Sunbit flow has been completed. Might be null in the case of INCOMPLETE status (when sunbit flow didn't start, for any reason)
purchaseAmounttextThe transaction total amount. Might be null in the case of INCOMPLETE status (when sunbit flow didn't start, for any reason)
statustext
  • COMPLETED - The transaction is successful.
  • INCOMPLETE - The transaction is still in progress.
  • VOIDED - The transaction has been canceled.
purchaseDatedateFormat: YYYY-MM-DD'T'hh:mm:ss
The date and time when sunbit flow started. Might be null in the case of INCOMPLETE status (when sunbit flow didn't start, for any reason)

Validation Call Example

Example#

Request#

curl 'https://api-sandbox.sunbit.com/epay/api/v1/epay?transactionId=completed-gthftredxserrr&purchaseId=39325178' \  -H 'sunbit-key: YOUR_KEY' \  -H 'sunbit-secret: YOUR_SECRET'

Response#

{  "purchaseId": "mockId",  "purchaseAmount": 100,  "status": "COMPLETED",  "purchaseDate": "2020-06-16T01:02:42"}