Accurately tracking transactions is simple with the QorCommerce API! You can receive immediate status updates via QorCommerce's webhook callbacks.
For each payment that you have facilitated, QorCommerce automatically tracks the transaction status through the corresponding processor's system. We save transaction events in the following format:
{
"object_created":"2014-11-29T16:31:19.524Z",
"object_id":"5bf980eba0814a618f3b8212c5884083",
"status":"Settled",
"status_details":"Your payment has been settled.",
"status_date":"2012-03-08T09:58:00Z"
}
}
The possible values for the status
field are:
The latest status is accessible via the corresponding Transaction's tracking_status
field, and the entire history is available via the tracking_history
field. Here's a sample Transaction object:
{
"object_state":"VALID",
"object_status":"SUCCESS",
"object_created":"2014-11-29T16:31:19.512Z",
"object_updated":"2014-11-29T16:31:19.512Z",
"object_id":"5695ae3a5eda41ba9abdbf347fd545f3",
"object_owner":"<USERNAME>",
"was_test":true,
"rate":"fabbb33d03c14b4eb7c4366f2df2a7b3",
"receipt_email_to":false,
"transaction_number":"9102969010383081813033",
"transaction_status":{
"object_created":"2014-11-29T16:31:19.511Z",
"status":"SETTLED",
"status_details":"Your payment has been settled.",
"status_date":"2012-03-08T09:58:00Z"
}
},
"transaction_history":[
{
"object_created":"2014-11-29T16:31:19.573Z",
"status":"UNKNOWN",
"status_details":"The payment data has been received.",
"status_date":"2012-03-06T00:00:00Z",
"location":null
},
{
"object_created":"2014-11-29T16:31:19.544Z",
"status":"APPROVED",
"status_details":"Your payment has been approved.",
"status_date":"2012-03-07T00:00:00Z"
},
{
"object_created":"2014-11-29T16:31:19.524Z",
"status":"SETTLED",
"status_details":"Your payment has been settled.",
"status_date":"2012-03-08T09:58:00Z"
}
],
"metadata":"",
"messages":[]
}
Instead of retrieving the Transaction object manually to retrieve transaction updates, QorCommerce offers easy-to-use webhooks. Every time the transaction status has been updated, QorCommerce can POST to all active webhooks of your QorCommerce account. The POST request's body contains a JSON of the Transaction object (see the sample Transaction above).
Setting up and testing webhooks
You can set up webhooks on the API settings page. This page also allows you to test webhooks with a sample payload.
Expected Webhook behavior
QorCommerce expects your webhook to return a response with a 2XX HTTP status code, indicating that the webhook has been received successfully. If QorCommerce doesn't receive a 2XX response status code, the webhook POST request will be re-tried 5 times with a 10 second delay between each try. Thus each webhook will receive max. 6 messages within 1 minute.