Check a Request Status {#thunes-promptpay-status-intro}
=======================================================

You can retrieve the status of a pending sale or refund by sending a check status request.  
The check status service is a follow-on service used to retrieve status updates of a pending sale.  
When a pending status updates, a check status response includes the transaction's new status. Thunes sometimes needs to review a service request, which causes a transaction to initially respond with a pending status. The check status request requires you to include the request ID from the pending transaction response you are checking the status of. The request ID is located in the requestID response field. `Cybersource` recommends that you send a check status request hourly until the status updates from pending.

Endpoints
---------

Set the apCheckStatusService_run field to `true`, and send the request to one of these endpoints:  
**Production:** `https://ics2ws.ic3.com/commerce/1.x/transactionProcessor`  
**Test:** `https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor`

> PromptPay does not support a test endpoint. Send all test transactions to the production endpoint.

Response Statuses
-----------------

`Cybersource` responds to your check status request with one of these statuses in the apCheckStatusReply_status field:

Check Status Responses for a Sale
:
* `ABANDONED`: The customer did not complete the payment using the redirect URL.
* `FAILED`: The service request failed. A failed request can be due to either PromptPay rejecting the transaction or a technical error.
* `FUNDED`: The settled amount is funded to the merchant bank account.
* `PENDING`: The service request is accepted but is not completed. Request the check status service to retrieve status updates.
* `SETTLED`: The sale request is settled for the requested amount.

Check Status Responses for a Refund
:
* `FAILED`: The service request failed. A failed request can be due to either PromptPay rejecting the transaction or a technical error.
* `REFUNDED`: The settled amount is successfully refunded.

The check status service also responds with a reason code in the apCheckStatusReply_reasonCode field.  
For more information about reason codes, see [Reason Codes and Response Codes](/docs/cybs/en-us/thunes/developer/all/so/thunes/thunes-ref-info/thunes-refinfo-codes.md "").

Required Fields for Checking Status {#thunes-promptpay-status-req-fields}
=========================================================================

[apCheckStatusService_checkStatusRequestID](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/so/api-fields/ap-check-status-service-check-status-req-id.md "")
:
Set to the request ID included in the service response.

[apCheckStatusService_run](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/so/api-fields/ap-check-status-service-run.md "")
:
Set to `true`.

[apPaymentType](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/so/api-fields/ap-payment-type.md "")
:
Set to `PPQ`.

[merchantID](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/so/api-fields/merchant-id.md "")
:

[merchantReferenceCode](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/so/api-fields/merchant-reference-code.md "")
:

Example: Checking a Request Status {#thunes-promptpay-status-ex-so}
===================================================================

Request

```
&lt;requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.215"&gt;
	&lt;merchantID&gt;test_merchant&lt;/merchantID&gt;
	&lt;merchantReferenceCode&gt;refnum-1234&lt;/merchantReferenceCode&gt;
	&lt;apPaymentType&gt;PPQ&lt;/apPaymentType&gt;
	&lt;apCheckStatusService run="true"&gt;
		&lt;checkStatusRequestID&gt;6953229557336619903008&lt;/checkStatusRequestID&gt;
	&lt;/apCheckStatusService&gt;
&lt;/requestMessage&gt;
```

Response to a Successful Request

```
&lt;replyMessage xmlns:c="urn:schemas-cybersource-com:transaction-data-1.215"&gt;
	&lt;merchantReferenceCode&gt;refnum-1234&lt;/merchantReferenceCode&gt;
	&lt;requestID&gt;6989529700616633303007&lt;/requestID&gt;
	&lt;decision&gt;ACCEPT&lt;/decision&gt;
	&lt;reasonCode&gt;100&lt;/reasonCode&gt;
	&lt;requestToken&gt;AxjnrwSTeuc1xphoz7/fANgZYiy6laewnTZ9honkFw7xbfpC/oGdUMmkmXoxX6rUJN65zUbdKW/6eQAA/i7C&lt;/requestToken&gt;
	&lt;apCheckStatusReply&gt;
		&lt;reasonCode&gt;100&lt;/reasonCode&gt;
		&lt;reconciliationID&gt;XEKTVO0NMOX4&lt;/reconciliationID&gt;
		&lt;paymentStatus&gt;pending&lt;/paymentStatus&gt;
		&lt;processorResponse&gt;00001&lt;/processorResponse&gt;
		&lt;processorToken&gt;348476012838&lt;/processorToken&gt;
	&lt;/apCheckStatusReply&gt;
&lt;/replyMessage&gt;
```

