Create a refund for a paid transaction using refundToken in the DPO Pay API v6.
Refund Token (v6)
Create a refund for a paid transaction in the original transaction currency.
Use the refundToken request to refund a paid transaction. You can identify the transaction by either TransactionToken or TransRef.
Endpoint
POST https://secure.3gdirectpay.com/API/v6/Headers
Content-Type: application/xml; charset=utf-8
Accept: application/xmlRequest parameters
| Parameter | Data type | Description | Required |
|---|---|---|---|
Request | Text | Must be refundToken. | Mandatory |
CompanyToken | Token | Token you received from 3G to operate this API. | Mandatory |
TransactionToken | Token | Transaction token received from createToken. Used in place of TransRef. | Mandatory when TransRef is not sent. |
TransRef | Text | DPO reference generated in the createToken response. Used in place of TransactionToken. | Mandatory when TransactionToken is not sent. |
refundAmount | Numeric | Requested refund amount. | Mandatory |
refundDetails | Text | Requested refund description. | Mandatory |
refundRef | Text | Refund reference. | Optional |
refundApproval | 1/0 | If sent, the refund is checked by a checker. | Optional |
Send either
TransactionTokenorTransRefto identify the transaction you want to refund.
Request examples
Using TransactionToken
TransactionToken<?xml version="1.0" encoding="utf-8"?>
<API3G>
<Request>refundToken</Request>
<CompanyToken>68B90B5E-25F6-4146-8AB1-CV4GA0C41A7F</CompanyToken>
<TransactionToken>246757AE-4D4F-7763-BFF5-326704703102</TransactionToken>
<refundAmount>1.2</refundAmount>
<refundDetails>Refund description</refundDetails>
</API3G>Using TransRef
TransRef<?xml version="1.0" encoding="utf-8"?>
<API3G>
<Request>refundToken</Request>
<CompanyToken>68B90B5E-25F6-4146-8AB1-CV4GA0C41A7F</CompanyToken>
<TransRef>R4852596P6</TransRef>
<refundAmount>1.2</refundAmount>
<refundDetails>Refund description</refundDetails>
</API3G>Response fields
The server responds to the refundToken request with the result of your request.
| Parameter | Data type | Description |
|---|---|---|
Result | 3-digit code | Code sent with the result of the request. |
ResultExplanation | Text | Free text result explanation. |
Response codes
| Code | Explanation |
|---|---|
000 | Refund successful. |
801 | Request missing company token. |
802 | Wrong CompanyToken. |
803 | No request or error in request type name. |
804 | Error in XML. |
950 | Request missing transaction-level mandatory fields or data mismatch: field name. |
999 | Refund failed: error description. |
Success response example
<?xml version="1.0" encoding="utf-8"?>
<API3G>
<Result>000</Result>
<ResultExplanation>Refund successful</ResultExplanation>
</API3G>
