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,
"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}$"
}
}
]
}
{"RefundTypes":{"hint":"","regexp":"","type":"array of objects","Name":{"hint":"The name of the refund type","regexp":"","type":"string"},"ID":{"hint":"GlobalPay refund type ID, a unique number that identifies the refund type in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"AllowsPartialRefund":{"hint":"Refund allows partial refund","regexp":"","type":"bool"},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID","regexp":"^\\d{1,12}$","type":"int"},"MerchantCustomerID":{"hint":"The ID of the customer in your system.","regexp":"^([0-9a-zA-Z_-]{1,50})?$","type":"string"},"Email":{"hint":"Customer\u2019s email","regexp":"^[a-zA-Z0-9\\._%+-]{1,100}@[a-zA-Z0-9\\.-]{1,40}\\.[a-zA-Z]{1,8}$","type":"string"},"FirstName":{"hint":"Customer\u2019s first name","regexp":"","type":"string"},"LastName":{"hint":"Customer\u2019s last name","regexp":"","type":"string"},"Gender":{"hint":"Customer\u2019s gender. It can have the following values: 1 - Male, 2 - Female.","regexp":"","type":"string"},"DateOfBirth":{"hint":"Customer date of birth","regexp":"^(((19|20)\\d\\d)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01]))$","type":"date"},"SocialSecurityNumber":{"hint":"Customer\u2018s social or fiscal identifier","regexp":"","type":"string"},"Phone":{"hint":"Customer\u2019s phone including prefix","regexp":"","type":"string"},"Company":{"hint":"Company name (for legal entities)","regexp":"","type":"string"},"InputDateTime":{"hint":"Customer creation date","regexp":"","type":"datetime"}},"BillingAddress":{"hint":"Billing Address details","regexp":"","type":"object","ID":{"hint":"Address ID, a unique number that identifies an address in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Customer\u2018s country. Recommended to be sent in order to increase the conversion. If MethodID is missing, this field (taken from BillingAddress object) controls which payment methods are shown on the hosted payment pages. Format is according to ISO-3166-1 alpha-2, a two-letter code.","regexp":"^([A-Za-z]{2})?$","type":"string"},"City":{"hint":"City name","regexp":"^(.{1,255})?$","type":"string"},"ZipCode":{"hint":"Postal code","regexp":"^(.{1,255})?$","type":"string"},"State":{"hint":"State name","regexp":"^(.{1,255})?$","type":"string"},"Street":{"hint":"Street name","regexp":"^(.{1,255})?$","type":"string"},"StreetNumber":{"hint":"Street Number","regexp":"^(.{1,255})?$","type":"string"},"HouseNumber":{"hint":"House Number","regexp":"^(.{1,255})?$","type":"string"},"HouseExtension":{"hint":"House Extension","regexp":"^(.{1,255})?$","type":"string"}},"BankAddress":{"hint":"","regexp":"","type":"object","ID":{"hint":"Address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Address country","regexp":"^([A-Za-z]{2})?$","type":"string"},"City":{"hint":"City name","regexp":"^(.{1,255})?$","type":"string"},"ZipCode":{"hint":"Postal code","regexp":"^(.{1,255})?$","type":"string"},"State":{"hint":"State name","regexp":"^(.{1,255})?$","type":"string"},"Street":{"hint":"Street name","regexp":"^(.{1,255})?$","type":"string"},"StreetNumber":{"hint":"Street Number","regexp":"^(.{1,255})?$","type":"string"},"HouseNumber":{"hint":"House Number","regexp":"^(.{1,255})?$","type":"string"},"HouseExtension":{"hint":"House Extension","regexp":"^(.{1,255})?$","type":"string"}},"Details":{"hint":"Details about the additional information you need to provide in order for us to complete the refund.","regexp":"","type":"object","CustomerAccountNumber":{"hint":"Customer\u2018s bank account number","regexp":"","type":"string"},"CPFAccountHolder":{"hint":"The CPF number (Cadastrado de Pessoas F\u00edsicas), the Brazilian tax registration number, of the account holder.","regexp":"","type":"string"},"BankName":{"hint":"The name of the Bank","regexp":"","type":"string"},"BankAccountType":{"hint":"Refund bank account type","regexp":"","type":"string"},"BankBranch":{"hint":"Refund bank branch","regexp":"","type":"string"},"BankCode":{"hint":"Customer\u2019s Bank Code. Also known as BIC or Swift_BIC. Bank Identifier Code (BIC), a unique identification code for a particular bank (consists of 8-11 alphanumeric characters).","regexp":"","type":"string"},"BankAgencyCode":{"hint":"The code of a specific bank agency in Brazil. (up to 4 digits).","regexp":"","type":"string"},"BankAccountNumber":{"hint":"Bank account number","regexp":"","type":"string"},"BankSWIFTID":{"hint":"Swift ID, a unique identification code for a particular bank.","regexp":"","type":"string"},"BankSortCode":{"hint":"Bank sort code identifies both the bank and the branch where the account is held (consists of 6 digits).","regexp":"","type":"string"},"CustomerIBAN":{"hint":"Customer\u2019s IBAN (International Bank Account Number), a code (up to 34 alphanumeric characters) that uniquely identifies an account held at any bank anywhere in the world.","regexp":"","type":"string"}}}}