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

Get refund types (filtered)

You can specify various filters as parameters such as method ID, country code and currency in the query string in order to get the refund types available.

Definition: GET /v1/refunds/types/{idMethod}/{countryCode}/{currency}

Where:
  • {idMethod} – GlobalPay Payment Method ID

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

Request:

GET https://paytest.smart2pay.com/v1/refunds/types/3/BE/EUR
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "RefundTypes": [
    {
      "Name": "SEPABankTransfer",
      "ID": 2,
      "AllowPartialRefund": 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}$"
      }
    }
  ]
}

Get information on a specific refund

You can get information about a refund by using actions based on Get HTTP request.

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

Where:
  • payments/{id} – GlobalPay Payment ID
  • and
  • refunds/{id} – GlobalPay Refund ID

Request:

GET https://paytest.smart2pay.com/v1/payments/2429753/refunds/7094
Authorization: Basic MzAyMDE6aEo1Um9iWXg5cjdGZk53Q3ZIWTlMWEhxcXIrRkV6cmM3YUp2UVFrNEdhejFtZzdSeXk=

Response:

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

{
  "Refund": {
    "ID": 7094,
    "Created": "20160316095912",
    "MerchantTransactionID": "s2ptest_55",
    "InitialPaymentID": 2429753,
    "Amount": 100,
    "Currency": "EUR",
    "Description": null,
    "TypeID": 1,
    "SiteID": 30201,
    "Details": null,
    "Customer": null,
    "BillingAddress": null,
    "BankAddress": null,
    "Articles": null,
    "Status": {
      "ID": 2,
      "Info": "Success",
      "Reasons": null
    }
  }
}

Get a list of refunds of a specific payment

You can get a list of refunds for a specific payment by using an action based on GET HTTP request. Please be aware that only a limited amount of details for each refund will be provided.

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

Where:
  • {id} – GlobalPay Payment ID

Request:

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

Response:

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

{
  "Refunds": [
    {
      "ID": 7091,
      "Created": "20160314144502",
      "MerchantTransactionID": "s2ptest_44",
      "InitialPaymentID": 2427079,
      "Amount": 20,
      "Currency": "EUR",
      "Description": null,
      "TypeID": 5,
      "SiteID": 30201,
      "Details": null,
      "Customer": null,
      "BillingAddress": null,
      "BankAddress": null,
      "Articles": null,
      "Status": {
        "ID": 4,
        "Info": "Failed",
        "Reasons": null
      }
    },
    {
      "ID": 7083,
      "Created": "20160314100006",
      "MerchantTransactionID": "s2ptest_9",
      "InitialPaymentID": 2427079,
      "Amount": 20,
      "Currency": "EUR",
      "Description": null,
      "TypeID": 5,
      "SiteID": 30201,
      "Details": null,
      "Customer": null,
      "BillingAddress": null,
      "BankAddress": null,
      "Articles": null,
      "Status": {
        "ID": 1,
        "Info": "Open",
        "Reasons": null
      }
    }
  ]
}