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

For Native Refund type:

Request:

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

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
    }
  ]
}

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 parameters are required.

In order to be processed correctly, the following types of refunds require additional parameters:

  • For Sepa Bank Transfer Refund type:

    Request:

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

    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 MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

    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/4295859/refunds/types
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "RefundTypes": [
      {
        "Name": "ManualSupportWorkDetailsNeeded",
        "ID": 9,
        "AllowPartialRefund": true,
        "Customer": {
        "MerchantCustomerID": null,
        "Email": null,
        "FirstName": "^.{1,50}$",
        "LastName": "^.{1,50}$",
        "Gender": null,
        "SocialSecurityNumber": null,
        "SocialSecurityNumber2": null,
        "Phone": null,
        "Company": null,
        "DateOfBirth": null
      },
      "BillingAddress": null,
      "BankAddress": {
        "City": null,
        "ZipCode": null,
        "State": null,
        "Street": "^[0-9a-zA-Z]{1,512}$",
        "StreetNumber": "^[0-9a-zA-Z]{1,512}$",
        "HouseNumber": null,
        "HouseExtension": null,
        "Country": null
       },
       "Details": {
         "BankName": "^.{1,50}$"
          }
        }
      ]
    }
  • For Local Bank Transfer 2 API Refund type:

    Request:

    GET https://paytest.smart2pay.com/v1/payments/171510128/refunds/types
    Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=

    Response:

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    
    {
      "RefundTypes": [
        {
        "Name": "LocalBankTransfer2API",
        "ID": 10,
        "AllowsPartialRefund": true,
        "Customer": {
          "MerchantCustomerID": null,
          "Email": null,
          "FirstName": "^.{1,50}$",
          "LastName": "^.{1,50}$",
          "Gender": null,
          "SocialSecurityNumber": null,
          "SocialSecurityNumber2": null,
          "Phone": null,
          "Company": null,
          "DateOfBirth": null
          },
        "BillingAddress": null,
        "BankAddress": null,
        "Details": {
          "CustomerAccountNumber": "^\\w{1,35}$",
          "BankName": "^.{1,50}$",
          "BankBranch": "^.{1,50}$",
          "BankAccountType": "^(I|S|C)$"
          }
        }
      ]
    }