When you are initiating a refund you need to provide the Refund Amount and the Merchant Transaction ID, that is automatically generated. You can change this ID by introducing your ID value.
Definition: POST /v1/payments/{id}/refunds
- {id} – GlobalPay Payment ID
A 201 HTTP response (Created) is returned if the refund was correctly initialized.
Request:
POST https://paytest.smart2pay.com/v1/payments/4520424/refunds
Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ=
{
"Refund": {
"MerchantTransactionID": "s2ptest_gi10",
"Amount": 100,
"Description": "Refund Test Description"
}
}
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"TokenLifetime":{"hint":"The time in minutes after the token used for redirectURL expires. It defaults to 5 minutes if not sent.","regexp":"^\\d{1,12}$","type":"int"}}}Response:
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
{
"Refund": {
"ID": 36675,
"Created": "20190516075916",
"MerchantTransactionID": "s2ptest_gi10",
"OriginatorTransactionID": null,
"InitialPaymentID": 4520424,
"Amount": "100",
"Currency": "EUR",
"Description": "Refund Test Description",
"TypeID": 5,
"SiteID": 30201,
"Details": null,
"Customer": null,
"BillingAddress": null,
"BankAddress": null,
"Articles": null,
"Status": {
"ID": 1,
"Info": "Open",
"Reasons": null
},
"SplitID": 0
}
}
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"TypeID":{"hint":"GlobalPay refund type ID, a unique number that identifies the refund type in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}For some payment methods to be processed correctly, depending on the type of refund, we require additional parameters, specific details, such as customer IBAN.
Please check Get information for a refund for more information on what parameters you need to send in order to initiate a specific refund.
- A particular case is for Klarna Invoice payment method where in order to initiate a refund you will need to provide Merchant Article ID and Quantity parameters, like in the below example:
Request:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"TokenLifetime":{"hint":"The time in minutes after the token used for redirectURL expires. It defaults to 5 minutes if not sent.","regexp":"^\\d{1,12}$","type":"int"}}}POST https://paytest.smart2pay.com/v1/payments/3006154/refunds Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ= { "Refund": { "MerchantTransactionID": "s2ptest_g30", "Amount": 980, "Articles": [ { "MerchantArticleID": "1231", "Quantity": 1 } ] } }
Response:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"TypeID":{"hint":"GlobalPay refund type ID, a unique number that identifies the refund type in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 { "Refund": { "ID": 0, "Created": null, "MerchantTransactionID": "s2ptest_g30", "OriginatorTransactionID": null, "InitialPaymentID": 0, "Amount": "980", "Currency": null, "Description": null, "TypeID": 0, "SiteID": 30201, "Details": null, "Customer": null, "BillingAddress": null, "BankAddress": null, "Articles": [ { "MerchantArticleID": "1231", "Name": null, "Quantity": 1, "Price": 0, "VAT": 0, "Discount": 0, "Type": null, "DiscountValue": 0 } ], "Status": { "ID": 1, "Info": "Open", "Reasons": null }, "SplitID": 0 } }
- A particular case is for Klarna Pay Now Standalone payment method where in order to initiate a refund you need to provide Amount and Currency parameters.
However, the recommendation is:
– to use a full request, where you can have the Description and the OriginatorTransactionID
– to send the Articles: Merchant Article ID and Quantity parameters, if they have been provided in the initial payment, as shown in the example below:Request:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"TokenLifetime":{"hint":"The time in minutes after the token used for redirectURL expires. It defaults to 5 minutes if not sent.","regexp":"^\\d{1,12}$","type":"int"}}}POST https://paytest.smart2pay.com/v1/payments/6906966/refunds Authorization: Basic MzAxOTk6OG16L0lsZkpaejIyVVhVUlFSeXRvdExQQ3pkWVJQekVmNHpyNDdBUWROWWxiUUxpTWc= { "Refund": { "MerchantTransactionID": "Refund_{{$timestamp}}", "Amount": 100, "Currency": "GBP", "Description": "test", "OriginatorTransactionID": "12345", "Articles": [ { "MerchantArticleID": "5009000", "Quantity": 1 } ] } }
Response:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"TypeID":{"hint":"GlobalPay refund type ID, a unique number that identifies the refund type in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 { "Refund": { "ID": 93602, "Created": "20240520103545", "MerchantTransactionID": "Refund_1716201346", "OriginatorTransactionID": "12345", "InitialPaymentID": 6906966, "Amount": "100", "Currency": "GBP", "Description": "test", "TypeID": 1, "SiteID": 30563, "Details": null, "Customer": null, "BillingAddress": null, "BankAddress": null, "Articles": [ { "MerchantArticleID": "5009000", "Name": null, "Quantity": 1, "Price": "0", "VAT": "0", "Discount": "0", "Type": null, "TaxType": 0, "DiscountValue": "0" } ], "Status": { "ID": 1, "Info": "Open", "Reasons": null }, "MethodTransactionID": null, "SplitID": 0 } }
- Another particular case is for LATAM payment methods (Cash Payment and Online Banking payment methods – see the list below).The refunds for most LATAM payment methods are made by our local provider. In order for the refund to be processed the Customer bank details/ and customer full name are required. There are 2 possibilities:
- The Customer bank details are sent in full in the request, like in the below example. In this case, the refund should be processed within 48 hours.
- The Customer bank details are not sent in request. However, in this case, the local provider will contact the customer in order to obtain the bank details so the refund can be performed.
Request:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"TokenLifetime":{"hint":"The time in minutes after the token used for redirectURL expires. It defaults to 5 minutes if not sent.","regexp":"^\\d{1,12}$","type":"int"}}}POST https://paytest.smart2pay.com/v1/payments/4070604/refunds Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ= { "Refund": { "MerchantTransactionID": "s2ptest_f201", "Amount": 400, "Details": { "CustomerAccountNumber":"A88888888888", "BankAccountType":"I", "BankName":"Banco do Brasil", "BankBranch":"Branch1234" }, "Customer": { "Email":"test@test.com", "FirstName":"John", "LastName":"Smith" } } }
Response:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"TypeID":{"hint":"GlobalPay refund type ID, a unique number that identifies the refund type in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Details":{"hint":"In some cases we send various details about the payment (e.g. Reference Number and Bank Details of the Customer for Bank Transfer payments).","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"}},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 { "Refund": { "ID": 27601, "Created": "20180914091320", "MerchantTransactionID": "s2ptest_f201", "OriginatorTransactionID": null, "InitialPaymentID": 4070604, "Amount": "400", "Currency": "PLN", "Description": null, "TypeID": 10, "SiteID": 30201, "Details": { "CustomerAccountNumber": "A88888888888", "BankName": "Banco do Brasil", "BankAccountType": "I", "BankBranch": "Branch1234" }, "Customer": { "ID": 336, "MerchantCustomerID": null, "Email": "test@test.com", "FirstName": "John", "LastName": "Smith", "Gender": null, "SocialSecurityNumber": null, "Phone": null, "Company": null, "DateOfBirth": null }, "BillingAddress": null, "BankAddress": null, "Articles": null, "Status": { "ID": 1, "Info": "Open", "Reasons": null }, "SplitID": 0 } }
Latam payment methods Method ID Method Name 32 Debito Banco do Brasil 1080 Santander Rio 1081 Cash Payments Argentina 1083 Boleto Brazil 1084 Online Bank Transfer Brazil 1086 Servipag 1087 WebPay 1089 PSE Colombia 1090 Cash payment Colombia 1092 Oxxo 1093 SPEI 1094 Bank Transfer Mexico 1096 Redpagos 1098 Cash payment Peru 1099 Bank Transfer Peru 1103 Rapi Pago 1104 Pago Fácil 1107 Netbanking 1108 UPI - For Direct Card transactions you can initiate refunds only for those with a Captured payment status. When you are initiating a refund you need to provide the Refund Amount and the Merchant Transaction ID, that is automatically generated. You can change this ID by introducing your ID value. When refunding a payment that has multiple partial captures, you also need to send the CaptureID parameter in the request.
Request:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"StatementDescriptor":{"hint":"Refund statement description","regexp":"","type":"string"},"CaptureID":{"hint":"Mandatory only when refunding a payment that has multiple partial captures","regexp":"^\\d{1,12}$","type":"int"},"SplitID":{"hint":"SplitID for which we want to initiate the refund (if we refund a split)","regexp":"^\\d{1,12}$","type":"int"}}}POST https://securetest.smart2pay.com/v1/payments/202246/refunds Authorization: Basic MTAxMDpnYWJp { "Refund": { "MerchantTransactionID": "s2ptest_h19", "OriginatorTransactionID": "108_a", "Amount": 1000, "Description": "refund reason", "StatementDescriptor": "refund ", "CaptureID": 546 } }
Response:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","InvalidRequestID":{"hint":"Refund failure reference ID","regexp":"","type":"string"},"ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"StatementDescriptor":{"hint":"Refund statement description","regexp":"^.{1,255}$","type":"string"},"CaptureID":{"hint":"Refunded capture ID","regexp":"^\\d{1,12}$","type":"int"},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 { "Refund": { "ID": 263, "SiteID": 1010, "Created": "20161205095348", "MerchantTransactionID": "s2ptest_h19", "OriginatorTransactionID": "108_a", "InitialPaymentID": 0, "Amount": 1000, "Currency": "EUR", "Description": "refund reason", "StatementDescriptor": null, "CaptureID": 546, "Customer": null, "BillingAddress": null, "BankAddress": null, "Articles": null, "Status": { "ID": 2, "Info": "Success", "Reasons": [] }, "SplitID": 0 } }
In case of an API error, an HTTP 4xx (you did something wrong) or HTTP 5xx (we did something wrong) response is returned.
For more information about the reasons of a wrong request response see our section GlobalPay Return Codes.
Request:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"StatementDescriptor":{"hint":"Refund statement description","regexp":"","type":"string"},"CaptureID":{"hint":"Mandatory only when refunding a payment that has multiple partial captures","regexp":"^\\d{1,12}$","type":"int"},"SplitID":{"hint":"SplitID for which we want to initiate the refund (if we refund a split)","regexp":"^\\d{1,12}$","type":"int"}}}POST https://paytest.smart2pay.com/v1/payments/4520424/refunds Authorization: Basic MzAyMDE6KzlLZUd6S0Y3VzhTLzc5YTVSMzNZSlVnN0U3V0ZOY1piakdmekxWM2JYU25GQ095RnQ= { "Refund": { "MerchantTransactionID": "s2ptest_gi11", "Amount": 100, "Description": "Refund Test Description" } }
Response:
{"Refund":{"hint":"Refund structure","regexp":"","type":"object","InvalidRequestID":{"hint":"Refund failure reference ID","regexp":"","type":"string"},"ID":{"hint":"GlobalPay refund ID, a unique number that identifies the refund in the GlobalPay system.","regexp":"^\\d{1,12}$","type":"int"},"SiteID":{"hint":"The ID of the site","regexp":"^\\d{1,12}$","type":"int"},"Created":{"hint":"Date and time when the refund was created.","regexp":"","type":"datetime"},"MerchantTransactionID":{"hint":"Merchant Transaction ID, a number that uniquely identifies a refund in your system.","regexp":"","type":"string"},"OriginatorTransactionID":{"hint":"Originator transaction ID, a number that uniquely identifies the transaction in the original requester\u2019s system.","regexp":"^[0-9a-zA-Z_-]{1,50}$","type":"string"},"InitialPaymentID":{"hint":"GlobalPay payment ID of the initial transaction.","regexp":"^\\d{1,12}$","type":"int"},"MethodTransactionID":{"hint":"The Acquirer Reference Number (ARN), a unique number that tags a credit card transaction\/refund when it goes from the merchant bank (the acquiring bank) through the card scheme to the cardholder\\'s bank (the issuer). This number can be used by issuing banks to trace a transaction with an acquirer.","regexp":"","type":"string"},"Amount":{"hint":"The amount you want to refund. It can be the same as the capture amount or less. The last two digits represent the decimal part (11.54 will be sent 1154).","regexp":"^\\d{1,12}$","type":"int"},"Currency":{"hint":"The currency in which you sell the services or products. Format is according to ISO 4217, a three-letter code.","regexp":"^[A-Z]{3}$","type":"string"},"Description":{"hint":"The reason why you are doing the refund.","regexp":"^.{1,255}$","type":"string"},"StatementDescriptor":{"hint":"Refund statement description","regexp":"^.{1,255}$","type":"string"},"CaptureID":{"hint":"Refunded capture ID","regexp":"^\\d{1,12}$","type":"int"},"Customer":{"hint":"Customer details","regexp":"","type":"object","ID":{"hint":"Customer ID, a unique number that identifies the customer in the GlobalPay system.","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":"Bank address ID","regexp":"^\\d{1,12}$","type":"int"},"Country":{"hint":"Bank address country. 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"}},"Articles":{"hint":"The services\/products purchased from the website. Mandatory to be sent for Klarna Invoice and Klarna Payments payment methods.","regexp":"","type":"array of objects","MerchantArticleID":{"hint":"The ID of the article in your system","regexp":"^\\d{1,19}$","type":"string"},"Name":{"hint":"Article\u2019s name","regexp":"^.{1,250}$","type":"string"},"Quantity":{"hint":"The number of products. If is not sent the default value is 1.","regexp":"^\\d{1,3}$","type":"int"},"Price":{"hint":"The price for one item","regexp":"","type":"int"},"VAT":{"hint":"Value-Added Tax ( it is a tax in percent on the purchase price)","regexp":"^\\d{1,4}$","type":"int"},"Discount":{"hint":"The percent on the original price offered by you as discount. The last two digits represent the decimal part (10% will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"DiscountValue":{"hint":"The fixed value on the original price offered by you as discount. The last two digits represent the decimal part (10 GBP will be sent 1000).","regexp":"^\\d{1,4}$","type":"int"},"Type":{"hint":"The type of article. It can have the following values: 4 - Discount, 5 -Physical, 6 - Shipping_fee, 7 - Sales_tax, 8 - Digital, 9 - Gift_card, 10 - Store_credit, 11 - Surcharge.","regexp":"^(1|2|3|4|5|6|7|8|9|10|11)$","type":"int"},"TaxType":{"hint":"The type of tax. It can have the following values: 1 - without VAT, 2 - VAT at the rate of 0%, 3 - VAT of the receipt at the rate of 10%, 4 - VAT of the receipt at the rate of 18%, 5 - VAT of the receipt at the applicable rate of 10\/110, 6 - VAT of the receipt at the applicable rate of 18\/118.","regexp":"^(1|2|3|4|5|6)$","type":"int"}},"Status":{"hint":"Refund status","regexp":"","type":"object","ID":{"hint":"The ID of the refund status. It can have the following values: 1 - Open, 2 - Success, 4 - Failed.","regexp":"","type":"int"},"Info":{"hint":"The description of the status","regexp":"","type":"string"},"Reasons":{"hint":"The reasons why the payment got to this status.","regexp":"","type":"array of objects","Code":{"hint":"The id of the message type transmitted in the response. See our section GlobalPay Return Codes for a complete description.","regexp":"","type":"int"},"Info":{"hint":"The message body","regexp":"","type":"string"}}}}}HTTP/1.1 400 Bad Request Content-Type: application/json; charset=utf-8 { "Refund": { "ID": 36677, "Created": "20190516080948", "MerchantTransactionID": "s2ptest_gi11", "OriginatorTransactionID": null, "InitialPaymentID": 4520424, "Amount": "100", "Currency": "EUR", "Description": "Refund Test Description", "TypeID": 5, "SiteID": 30201, "Details": null, "Customer": null, "BillingAddress": null, "BankAddress": null, "Articles": null, "Status": { "ID": 4, "Info": "Failed", "Reasons": [ { "Code": "134", "Info": "Another refund is already in process" } ] }, "SplitID": 0 } }