Get refund types for a certain payment

You can get more information on what parameters you need to send for a certain payment by using a few actions based on GET HTTP request.

Definition: GET /v1/payments/{id}/refunds/types

Where:
  • {id} – GlobalPay Payment ID

The parameters you need to send for a certain refund are the ones returned followed by regex characters. If there aren’t any, it means no additional parameteres are required.

For Native Refund type:

Request:

GET https://paytest.smart2pay.com/v1/payments/2427069/refunds/types
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "RefundTypes": [
    {
      "Name": "Native",
      "ID": 1,
      "AllowsPartialRefund": true,
      "Customer": null,
      "BillingAddress": null,
      "BankAddress": null,
      "Details": null
    }
  ]
}

Below there are the refund types that require additional parameters.

For Sepa Bank Transfer Refund type:

Request:

GET https://paytest.smart2pay.com/v1/payments/2427083/refunds/types
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "RefundTypes": [
    {
      "Name": "SEPABankTransfer",
      "ID": 2,
      "AllowsPartialRefund": true,
      "Customer": {
        "MerchantCustomerID": null,
        "Email": null,
        "FirstName": "^.{1,50}$",
        "LastName": "^.{1,50}$",
        "Gender": null,
        "SocialSecurityNumber": null,
        "Phone": null,
        "Company": null
      },
      "BillingAddress": null,
      "BankAddress": null,
      "Details": {
        "BankCode": "^[a-zA-Z]{4}[a-zA-Z]{2}[a-zA-Z0-9]{2}[XXX0-9]{0,3}",
        "CustomerIBAN": "^[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}$"
      }
    }
  ]
}

For SWIFT Bank Transfer Refund type:

Request:

GET https://paytest.smart2pay.com/v1/payments/2427087/refunds/types
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "RefundTypes": [
    {
      "Name": "SWIFTBankTransfer",
      "ID": 3,
      "AllowsPartialRefund": true,
      "Customer": {
        "MerchantCustomerID": null,
        "Email": null,
        "FirstName": "^.{1,50}$",
        "LastName": "^.{1,50}$",
        "Gender": null,
        "SocialSecurityNumber": null,
        "Phone": null,
        "Company": null
      },
      "BillingAddress": null,
      "BankAddress": null,
      "Details": {
        "CustomerAccountNumber": "^\\w{1,35}$",
        "BankCode": "^[a-zA-Z]{4}[a-zA-Z]{2}[a-zA-Z0-9]{2}[XXX0-9]{0,3}"
      }
    }
  ]
}

For Manual Support Work Details Needed Refund type:

Request:

GET https://paytest.smart2pay.com/v1/payments/2547887/refunds/types
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "RefundTypes": [
    {
      "Name": "ManualSupportWorkDetailsNeeded",
      "ID": 9,
      "AllowsPartialRefund": true,
      "Customer": null,
      "BillingAddress": null,
      "BankAddress": null,
      "Details": {
        "BankName": "^.{1,50}$"
      }
    }
  ]
}