# How to call the Donation Transaction Status API source: https://developer.mastercard.com/donations/tutorial/donation-api-details/transactionstatusapi/index.md ### Retrieve Donation Transaction Status {#retrieve-donation-transaction-status} The ~~`/donations/transactions`~~ `/donations/transactions/{transaction_Id}/status` endpoint allows clients to retrieve the donation transaction status by passing either the `transactionId`. ~~, `correlationId`, or both as query parameters.~~ ## GET donations/transactions (deprecated) {#get-donationstransactions-deprecated} ## GET donations/transactions/{transaction_Id}/status {#get-donationstransactionstransaction_idstatus} Note: Fetching donation transaction status by passing **correlationId** is deprecated. Result for transaction status can be opted by passing transactionId to pathparm in request. ## Prerequisites {#prerequisites} Before executing the test cases, acquaint yourself with the endpoint use case and parameters: * [Retrieve Donation Transaction Status](https://developer.mastercard.com/donations/documentation/use-cases/manage-donation-trns/transaction-status-api/index.md) * [Parameters to Retrieve Donation Transaction Status](https://developer.mastercard.com/donations/documentation/parameters/track-donations-param/transactionstatus/index.md) ## Test Case {#test-case} 1. To retrieve the status of a donation transaction, send a GET request. 2. To create a GET request, provide either the `transactionId` ~~or `correlationId` or both~~ as parameter. ```py ~~Old request (deprecated)~~ GET https://sandbox.api.mastercard.com/donations/transactions?transactionId=OTCN2GR4T5a7BSjqWi_SHg ~~New Request~~ GET https://sandbox.api.mastercard.com/donations/transactions/OTCN2GR4T5a7BSjqWi_SHg/status ``` 3. A successful request returns the `HTTP 200 Success` status code and a JSON response body with the transaction status. ### Response Body of a successful transaction {#response-body-of-a-successful-transaction} ```JSON { "transactionId": "OTCN2GR4T5a7BSjqWi_SHg", "transactionStatus": "SUCCESS", "transactionMessage": "Transaction APPROVED" } ``` ### Response Body of a failed transaction {#response-body-of-a-failed-transaction} ```JSON { "transactionId": "OTCN2GR4T5a7BSjqWi_SHg", "transactionStatus": "FAILURE", "transactionMessage": "Transaction declined", "reasonCode": "DECLINE", "reasonMessage": "Your payment was declined. Please use a different card or contact your bank for more information." } ``` This section discusses a failed scenario and the error message expected. 1. Send a GET request with an invalid transaction ~~or correlation ID~~. 2. This request fails with the error code `400 Bad Request` as the response. ```json { "Errors": { "Error": [ { "Source": "DONATE_SERVICE", "ReasonCode": "INVALID_TXN_ID", "Description": "No record found in DB. Please verify client-id/transactionId passed in the request and re-try.", "Recoverable": false, "Details": null } ] } } ```