Using the Transactions API, you can access current and historical transaction statuses for any payment sent by any of our supported processing providers with a simple GET request - no accounts required.
To track a payment simply send a GET request to https://api.qorcommerce.io/v2/transactions/<processor>/<transactions-number>/ with your payment's processor
and transaction_number
.
You can find a list of all supported processor tokens here.
You will get a response back that includes the latest transaction status via the corresponding transaction_status
field, and the entire history via the transaction_history
field.
Here's a sample Transaction response:
{
"transactions_number":"9400110898680009697924",
"processor": "tsys",
"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",
},
{
"object_created":"2014-11-29T16:31:19.544Z",
"status":"APPROVED",
"status_details":"Your payment has 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"
}
]
}
The possible values for the status
field are:
QorCommerce offers easy-to-use webhooks for transactions updates. Every time the transactions 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 Transactions object (see the sample Transaction above).
Requesting webhook updates for a payment
To let QorCommerce know that you want to receive webhook updates for a payment, you need to POST to the Transactions endpoint at https://api.qorcommerce.io/v2/transactions/. The POST request's body needs to consist of your payments's transaction_number
and processor
:
{
"transaction_number":"9400110898680009697924",
"processor": "tsys"
}
You will get the same response as in the GET request outlined above.
QorCommerce will now automatically track your payment and send webhook notifications to all your registered webhooks whenever the payment's transaction status changes.
Creating and testing webhooks
You can set up your 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.