Check Transaction Reference
This method is used to verify whether a transaction was successfully created on the Tola platform.
The intended usage is to call this if a timeout or network error occurs after making a Create transaction request and you don't know whether that creation happened or not.
It's important to note that this is not a "transaction status" API.
How it works
Checking whether a transaction was created
Use this method when you call POST /transaction and then encounter a timeout, network error, or any other issue that leaves you unsure whether Tola received the request and created the transaction.
To check:
- Submit the transaction using
POST /transactionwith asourcereference. - If you do not receive a reliable response and are unsure whether the transaction was created, call
POST /transactionRefCheckusing the samesourcereference. - Inspect the
referencefield in the response:- If
referencecontains a Tola transaction reference such as1.2.3.4, the transaction was successfully created within the last 48 hours. - If
referenceisnull, no matching transaction was found within the last 48 hours.
- If
Important behavior
- This check only works for transactions created through
POST /transaction. - It does not apply to transactions created through
/checkout. - If
transactionRefCheckreturnsreference: null, the providedsourcereferencecannot be reused to create a new transaction until 48 hours have passed.
- Type: stringPrefer
Selects a named response example when using the mock server. The request must also use
Content-Type: application/json, which Scalar adds automatically for the JSON request body.
- Type: stringsourcereferencemax length:32required
A unique identifier previously supplied from your application. We will check if this sourcereference has been associated with a Transaction on Tola in the past 48 hours.
- application/json
- 400
Returned when we are unable to parse the parameters in the request, or when the relay URL is incorrect or inactive
- 401
Returned when your account with Tola Wallet is inactive
- 403
Returned when the relay URL is called with invalid or missing credentials or from an IP address that isnt in the relay URL's IP whitelist
- 429
Too Many Request. Returned when the application receives too many requests over a given time period. The request can be retried after 60 seconds.
- 503
Returned when the Tola Wallet is temporarily unavailable
curl https://wallet-mock.tolamobile.com/transactionRefCheck \
--request POST \
--header 'Prefer: example=transaction-found' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
--data '{
"sourcereference": "merchant-idempotent-key-1"
}'
{
"success": true,
"reference": "1.123.1435455096.1"
}