Request

This interface must be used to initiate a refund to payer after the money for the order has already been settled from Svea Payments to the merchant.

The process has several steps:

  • Initiate a "refund after settlement" by using this interface.
  • Do an actual money transfer from merchant's bank account to Svea Payments bank account by using the information given in the response of this interface. Merchant must use their own tools to do this money transfer. The amount and reference number of the money transfer must match the ones acquired by using this interface first.
  • Svea Payments will refund the payer after receiving money from the merchant

Webstore delivers the request parameters in a <form> using POST method as hidden input fields (<input type=hidden>) to address https://www.maksuturva.fi/PaymentCancel.pmt
(or https://test1.maksuturva.fi/PaymentCancel.pmt in test environment)

Fieldinput namevalueFormatC/ODescription
Action codepmtc_actionREFUND_AFTER_SETTLEMENTAN23CAction being called (REFUND_AFTER_SETTLEMENT).
Message versionpmtc_version0005AN4CVersion of the interface content.
Seller IDpmtc_selleridAN15CSeller ID given to the webstore by Svea Payments. Technical interface user id.
Payment IDpmtc_idAN20CUnique identifying number given to the payment transaction by webstore.
Payment amountpmtc_amountN17CThe original amount of the order. Same value as in send in Payment API (pmt_amount). The amount must be presented with two decimals. The decimal delimiter is comma, e.g. 94,80
Payment currencypmtc_currencyAN3CThe payment currency. Same value as in send in Payment API (pmt_currency).
Cancellation typepmtc_canceltypeREFUND_AFTER_SETTLEMENTAN40CREFUND_AFTER_SETTLEMENT
Amount to be refundedpmtc_cancelamounte.g. 15,00N17CAmount to be refunded. Decimal number with comma and two decimal digits, for example: 15,00
Buyer's refund bank accountpmtc_payeribanrefundIBAN number of the payerAN36CThe IBAN is only required in case on bank payments. That is, card payments, invoice payments and part payments do not require it. If can be given though even if not required.
Cancel descriptionpmtc_canceldescriptionAN500COptional description for the refund that could be should to the buyer.
Cancel reason codepmtc_cancelreasonAN5OOptional reason for the refund that could be should to the buyer. Possible values are:

Code / Description
NOTDE / Order has not been delivered
WSIZE / Item has wrong size
INCOR / Item does not correspond to order
DEFEC / Item is broken or defective
OUTOF / Item is out of stock
OTHER / Other reason
Response typepmtc_resptypeXMLAN4CAlways XML
Hash algorithmpmtc_hashversionAN10CName of the algorithm used to calculate the hash. For more details, see section Hash Calculation.
Hashpmtc_hashAN128CHash calculated from predefined message fields and the webstore's secret key. The following fields are used to calculate the hash:
pmtc_action
pmtc_version
pmtc_sellerid
pmtc_id
pmtc_amount
pmtc_currency
pmtc_canceltype
pmtc_cancelamount
* pmtc_payeribanrefund


For more details, see section Hash Calculation.
Secret key generationpmtc_keygenerationDefault: 001N3CGeneration number of the secret key given to the seller by Svea Payments.
Default is 001
Unique id for refundpmtc_cancel_idAN20OIt's recommended to use this field to give a unique idenfier for a refund. When given for one refund under the given order, there cannot be another refund for the same order with the same ID. This helps to prevent accidentally sending duplicate refunds.

📘

info

Not that ANxx means that the field contains a maximum of xx alphanumeric characters. N means numeric. C means that the field is compulsory and O means it is optional. An optional field may be missing altogether, have an empty value or have a value of at least the minimum length. That is, minimum length does not make a field mandatory but when it is present in the request it must have at least the minimum length.

Response

The response contains the following fields:

Fieldinput namevalueFormatC/ODescription
Action codepmtc_actionREFUND_AFTER_SETTLEMENTAN6CAction called (REFUND_AFTER_SETTLEMENT).
Message versionpmtc_version0005AN4CVersion of the interface content.
Seller IDpmtc_selleridAN15CSeller ID given to the webstore by Svea Payments. Technical interface user id.
Payment IDpmtc_idAN20CUnique identifying number given to the payment transaction by webstore.
Response codepmtc_returncodeAN2CIndicates success or failure. See below for the values and explanations of all the codes.
Response textpmtc_returntextAN100CBrief description of the failure reason. Empty in case of success.
Hashpmtc_hashAN128CHash calculated from predefined message fields and the webstore's secret key. Uses the same version, key generation etc values that were in the request. The following fields are used to calculate the hash:
pmtc_action
pmtc_version
pmtc_sellerid
pmtc_id
pmtc_returntext
pmtc_returncode

For more details, see section Hash Calculation.
Referencepmtc_pay_with_referencea Finnish reference numberN20Ca Finnish reference number that should be used when paying money to Svea Payments after initiating this refund
Recipient namepmtc_pay_with_recipientnameSvea Payments OyAN50CSvea Payments Oy - The name to be used on the money transfer as the recipient.
Amount to refundpmtc_pay_with_amounti.e. 2,00N17CThe amount the merchant is willing to refund to payer, i.e. 2,00
Maksuturva's IBANpmtc_pay_with_ibanThe IBAN of the bank account to pay the money to.AN36CThe IBAN of the bank account that the merchant should use to pay the money to.
Details of all the errorserrorsN/AOXML structure listing details of all the errors in the input message.

Response code values

Response codeShort descriptionDescription
00OKCancel received successfully
20Not foundPayment not found
90Errors in input dataErrors in input data, specified in element <errors>
91Duplicate detectedPayment cancellation failed, as this request was a duplicate based on the given unique identifier (pmtc_cancel_id)
99FailedPayment cancellation failed, reason specified in <pmtc_returntext>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pmtc>
  <pmtc_action>REFUND_AFTER_SETTLEMENT</pmtc_action>
  <pmtc_version>0005</pmtc_version>
  <pmtc_sellerid>6234567890ABCDE</pmtc_sellerid>
  <pmtc_id>VXZ8KB43XDH617LAZYBU</pmtc_id>
  <pmtc_returncode>00</pmtc_returncode>
  <pmtc_returntext>Cancel received succesfully</pmtc_returntext>
  <pmtc_hash>***</pmtc_hash>
  <pmtc_pay_with_reference>00000666660000010007</pmtc_pay_with_reference>
  <pmtc_pay_with_recipientname>Maksuturva Group Oy</pmtc_pay_with_recipientname>
  <pmtc_pay_with_amount>2,00</pmtc_pay_with_amount>
  <pmtc_pay_with_iban>FI7740123477777777</pmtc_pay_with_iban>
</pmtc>