Refunds are used to return funds to a customer for a previously completed sale. Depending on the original type of transaction, your reconciliation requirements and where the transaction is in its lifecycle, you may choose to perform one of the following actions:
Note: Always check batch status and reference the correct REST API ID or Reference ID for the refund type you are performing.
| Environment | Method | URL Path |
|---|---|---|
| Sandbox | POST | https://api.pit.paygateway.com/transactions/ |
| Production | POST | https://api.paygateway.com/transactions/ |
Linked Refunds are supported for the following transaction types:
In order to perform a Refund you can use the ID assigned by the REST API which was returned in the transaction response.
Alternatively, you can use the Reference ID you set in the transaction request. Depending on which identifier you are using, the URL path will change based on the original transaction type.
| Transaction Type | URL Path |
|---|---|
| Sale | {base url}/creditsales/{creditsale_id}/creditreturns or {base url}/creditsales/reference_id/{reference_id}/creditreturns |
| ACH/EFT Sale | {base url}/checksales/{checksale_id}/checkrefunds or {base url}/checksales/reference_id/{reference_id}/checkrefunds |
| Loan Sale | {base url}/loansales/{loansale_id}/loanreturns or {base url}/loansales/reference_id/{reference_id}/loanreturns |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Partner-App-Name: {Name of integrating application}
{
"payment": {
"amount": "5.28"
}
}{
"creditreturn_id": "000000061689",
"status": "approved",
"approval_code": "ADB123",
"reference_id": "XAZR863990",
"card": {
"masked_card_number": "XXXXXXXXXXX5538",
"expiry_month": "03",
"expiry_year": "35",
"type": "visa"
},
"payment": {
"amount": "23.09",
"invoice_number": "239087",
"type": "credit"
},
"transaction": {
"batch_amount": "12.09",
"batch_number": "001333"
},,
"links": [
{
"creditreturn_id": [
{
"href": "https://api.paygateway.com/cnp-payments/sales/000000106821",
"relation": "self",
"method": "POST",
"description": "Use this endpoint to retrieve a previous sales transaction using reference id."
}
],
"reference_id": [
{
"href": "https://api.paygateway.com/cnp-payments/sales/000000106821",
"relation": "self",
"method": "POST",
"description": "Use this endpoint to retrieve a previous sales transaction using reference id."
}
]
}
]
}Issue a refund without referencing a previous sale by submitting payment details or a token, this works in the same way that you would process an Authorization or Sale. Use this method when the original sale cannot be identified, for example, walk-in refunds or the customer doesn’t have their receipt.
Unlinked Refunds are supported for the following transaction types
In order to perform a Refund you can use the ID assigned by the REST API which was returned in the transaction response. Alternatively, you can use the Reference ID you set in the transaction request. Depending on which identifier you are using, the URL path will change based on the original transaction type.
| Transaction Type | URL Path |
|---|---|
| Sale | {base url}/creditreturn |
| ACH / EFT Sale | {base url}/checkrefunds |
Content-Type: application/json
Authorization: AuthToken {AuthTokenV2}
X-GP-Request-Id: {request_id}
X-GP-Version: 2021-04-08
X-GP-Api-Key: {API Key}
X-GP-Partner-App-Name: {Name of integrating application}
{
"reference_id": "89f7af3e-48d9-430b-9a29-a6a25bbb0542",
"card": {
"card_number": "4761739001010010",
"expiry_month": "12",
"expiry_year": "35",
"cardholder_name": "test name"
},
"payment": {
"amount": "2.66",
"currency_code": "840"
},
"transaction": {
"country_code": "840"
}
}{
"creditreturn_id": "000000000174",
"status": "approved",
"approval_code": "278446",
"card": {
"masked_card_number": "476173XXXXXX0010",
"cardholder_name": "test name",
"expiry_month": "12",
"expiry_year": "35",
"type": "visa"
},
"payment": {
"amount": "2.66",
"currency_code": "840",
"type": "credit"
},
"transaction": {
"batch_amount": "2.34",
"batch_number": "000007",
"entry_type": "keyed",
"language": "en-US"
},
"links": [
{
"creditreturn_id": [
{
"href": "https://api.pit.paygateway.com/transactions/creditreturns/000000000174",
"relation": "self",
"method": "GET",
"description": "Use this endpoint to retrieve a previously completed returns transaction."
},
{
"href": "https://api.pit.paygateway.com/transactions/creditreturns/000000000174/voids",
"relation": "void",
"method": "PUT",
"description": "Use this endpoint to void a previously completed returns transaction."
}
]
},
{
"reference_id": [
{
"href": "https://api.pit.paygateway.com/transactions/creditreturns/reference_id/MER-80a03350-9817-4e54-acae-73c3fe3610e5",
"relation": "self",
"method": "GET",
"description": "Use this endpoint to retrieve a previously completed returns transaction using reference id."
}
]
}
],
"reference_id": "89f7af3e-48d9-430b-9a29-a6a25bbb0542"
}