Logo sunbit

Please enter the password to view.

Void Transactions

Overview

This API is used to void/cancel a purchase and issue a full refund to the patient after the Sunbit transaction has been completed. Calling this API will cancel the entire purchase immediately and notify the patient and practice of the cancellation.

Void / Cancel Transaction

PUT https://api-sandbox.sunbit.com/epay/api/v1/epay/cancel/{purchaseId}

Headers

Attribute Required Type Description
sunbit-key yes text Provided to you by Sunbit
sunbit-secret yes text Provided to you by Sunbit

Query Parameters

Attribute Required Type Description
purchaseId yes text The purchase Id that is generated by Sunbit for successful Sunbit flow. This ID is returned in the webhook

Body

Attribute Required Type Description
transactionId yes text Your internal ID for the current transaction, should be the same as you provided during the initialization call
location yes text Your location ID as provided by Sunbit

Response

Attribute Type Description
purchaseId text Same purchase ID from request
status text Purchase status after cancellation

Response Status Types

status description
VOIDED The transaction has been cancelled

Example

Request

curl -X PUT "https://api-sandbox.sunbit.com/epay/api/v1/epay/cancel/39325178" -H "accept: */*" \-H "sunbit-key: YOUR_KEY" -H "sunbit-secret: YOUR_SECRET" \-H "Content-Type: application/json"\ -d "{ \"transactionId\": \"23259d52f67fb8\", \"location\": \"practice4\"}"

Response

{  "purchaseId": "39325178",  "status": "VOIDED"}