Create Payment examples
Â
Skip to contents in this page
Request examples (S2S HTTP POST)
Â
Example 1:
Billing and Delivery address mismatch
Buyer will choose payment method in Svea Payments payment method selection page
$fields = [
'pmt_action' => 'NEW_PAYMENT_EXTENDED',
'pmt_version' => '0004',
'pmt_charsethttp' => 'UTF-8',
'pmt_sellerid' => 'ABC123DE',
'pmt_keygeneration' => '001',
'pmt_id' => '1998524_1',
'pmt_orderid' => '1998524',
'pmt_reference' => '19985242',
'pmt_amount' => '568,10',
'pmt_sellercosts' => '5,00',
'pmt_currency' => 'EUR',
'pmt_okreturn' => 'https://www.mytestshop.fi/pay/return/Success.do',
'pmt_errorreturn' => 'https://www.mytestshop.fi/pay/return/Error.do',
'pmt_cancelreturn' => 'https://www.mytestshop.fi/pay/return/Cancel.do',
'pmt_delayedpayreturn' => 'https://www.mytestshop.fi/pay/return/Cancel.do',
'pmt_escrow' => 'Y',
'pmt_escrowchangeallowed' => 'N',
'pmt_userlocale' => 'fi_FI',
'pmt_buyeremail' => 'teemu.testaaja@svea.fi',
'pmt_buyerphone' => '0401234567',
'pmt_buyername' => 'Teemu Testaaja',
'pmt_buyeraddress' => 'Mechelinkatu 1A',
'pmt_buyerpostalcode' => '00180',
'pmt_buyercity' => 'Helsinki',
'pmt_buyercountry' => 'FI',
'pmt_deliveryname' => 'Teemu Testaaja',
'pmt_deliveryaddress' => 'Kotikatu 1',
'pmt_deliverypostalcode' => '00330',
'pmt_deliverycity' => 'Helsinki',
'pmt_deliverycountry' => 'FI',
'pmt_rows' => '4',
'pmt_row_name1' => 'Tuote A',
'pmt_row_desc1' => 'Tuotteen A kuvaus',
'pmt_row_quantity1' => '2',
'pmt_row_deliverydate1' => '21.10.2025',
'pmt_row_price_gross1' => '123,00',
'pmt_row_vat1' => '24,00',
'pmt_row_discountpercentage1' => '0,00',
'pmt_row_type1' => '1',
'pmt_row_name2' => 'Räätälöity alennustuote B',
'pmt_row_desc2' => 'Räätälöidyn alennustuotteen kuvaus',
'pmt_row_quantity2' => '1',
'pmt_row_deliverydate2' => '21.10.2025',
'pmt_row_price_gross2' => '369,00',
'pmt_row_vat2' => '24,00',
'pmt_row_discountpercentage2' => '10,00',
'pmt_row_type2' => '4',
'pmt_row_name3' => 'Toimituskulut',
'pmt_row_desc3' => 'Toimitustapa yms.',
'pmt_row_quantity3' => '1',
'pmt_row_deliverydate3' => '21.10.2025',
'pmt_row_price_gross3' => '5,00',
'pmt_row_vat3' => '0,00',
'pmt_row_discountpercentage3' => '0,00',
'pmt_row_type3' => '2',
'pmt_row_name4' => 'Alennus',
'pmt_row_desc4' => 'Alennuskupongin koodi tms.',
'pmt_row_quantity4' => '1',
'pmt_row_deliverydate4' => '21.10.2025',
'pmt_row_price_gross4' => '-10,00',
'pmt_row_vat4' => '0,00',
'pmt_row_discountpercentage4' => '0,00',
'pmt_row_type4' => '6'
];
$request = curl_init('https://test1.maksuturva.fi/NewPaymentExtended.pmt');
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $fields);
...
$response = curl_exec($request);
Â
Example 2:
Direct payment service
Billing and Delivery address identical
Buyer has chosen Invoice (
FI70
) as the payment method in the webstore
$fields = [
'pmt_action' => 'NEW_PAYMENT_EXTENDED',
'pmt_version' => '0004',
'pmt_charsethttp' => 'UTF-8',
'pmt_sellerid' => 'ABC123DE',
'pmt_keygeneration' => '001',
'pmt_id' => '1998524_1',
'pmt_orderid' => '1998524',
'pmt_reference' => '19985242',
'pmt_amount' => '568,10',
'pmt_sellercosts' => '5,00',
'pmt_currency' => 'EUR',
'pmt_okreturn' => 'http://www.mytestshop.fi/pay/return/Success.do?paid=1',
'pmt_errorreturn' => 'http://www.mytestshop.fi/pay/return/Error.do?paid=0',
'pmt_cancelreturn' => 'http://www.mytestshop.fi/pay/return/Cancel.do?paid=0',
'pmt_delayedpayreturn' => 'http://www.mytestshop.fi/pay/return/Cancel.do?paid=0',
'pmt_escrow' => 'N',
'pmt_escrowchangeallowed' => 'N',
'pmt_userlocale' => 'en_FI',
'pmt_paymentmethod' => 'FI70',
'pmt_buyeremail' => 'teemu.testaaja@svea.fi',
'pmt_buyerphone' => '0401234567',
'pmt_buyername' => 'Teemu Testaaja',
'pmt_buyeraddress' => 'Mechelininkatu 1A',
'pmt_buyerpostalcode' => '00180',
'pmt_buyercity' => 'Helsinki',
'pmt_buyercountry' => 'FI',
'pmt_deliveryname' => 'Teemu Testaaja',
'pmt_deliveryaddress' => 'Mechelininkatu 1A',
'pmt_deliverypostalcode' => '00180',
'pmt_deliverycity' => 'Helsinki',
'pmt_deliverycountry' => 'FI',
'pmt_rows' => '4',
'pmt_row_name1' => 'Tuote A',
'pmt_row_desc1' => 'Tuotteen A kuvaus',
'pmt_row_quantity1' => '2',
'pmt_row_deliverydate1' => '21.10.2025',
'pmt_row_price_gross1' => '123,00',
'pmt_row_vat1' => '24,00',
'pmt_row_discountpercentage1' => '0,00',
'pmt_row_type1' => '1',
'pmt_row_name2' => 'Räätälöity alennustuote B',
'pmt_row_desc2' => 'Räätälöidyn alennustuotteen kuvaus',
'pmt_row_quantity2' => '1',
'pmt_row_deliverydate2' => '21.10.2025',
'pmt_row_price_gross2' => '369,00',
'pmt_row_vat2' => '24,00',
'pmt_row_discountpercentage2' => '10,00',
'pmt_row_type2' => '4',
'pmt_row_name3' => 'Toimituskulut',
'pmt_row_desc3' => 'Toimitustapa yms.',
'pmt_row_quantity3' => '1',
'pmt_row_deliverydate3' => '21.10.2025',
'pmt_row_price_gross3' => '5,00',
'pmt_row_vat3' => '0,00',
'pmt_row_discountpercentage3' => '0,00',
'pmt_row_type3' => '2',
'pmt_row_name4' => 'Alennus',
'pmt_row_desc4' => 'Alennuskupongin koodi tms.',
'pmt_row_quantity4' => '1',
'pmt_row_deliverydate4' => '21.10.2025',
'pmt_row_price_gross4' => '-10,00',
'pmt_row_vat4' => '0,00',
'pmt_row_discountpercentage4' => '0,00',
'pmt_row_type4' => '6'
];
$request = curl_init('https://test1.maksuturva.fi/NewPaymentExtended.pmt');
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $fields);
...
$response = curl_exec($request);
Â
Response examples (XML)
Â
OK Response examples
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<pmt>
<pmt_action>NEW_PAYMENT_EXTENDED</pmt_action>
<pmt_version>0004</pmt_version>
<pmt_id>1998524_1</pmt_id>
<pmt_reference>00000000000019985242</pmt_reference>
<pmt_amount>568,10</pmt_amount>
<pmt_currency>EUR</pmt_currency>
<pmt_sellercosts>5,00</pmt_sellercosts>
<pmt_paymenturl>https://test1.maksuturva.fi/Pay.pmt?ST=BS0b56829e71c9db6a35f8ac9c8bf7b547b1136aa700000000000000247108622!</pmt_paymenturl>
</pmt>
This one contains also payment method:
ERROR Response examples
→ The host part of email addresses must be valid. Svea validates them by performing a DNS query.
Â
→ Please check pmt_id
documentation.
Â
→ Please check calculation rules for pmt_amount
and pmt_sellercosts
.
Â
→ Please check calculation rules for pmt_amount
and pmt_sellercosts
.
Â
→ Please check specifications for pmt_row_nameN
. Usually It has too many characters in these cases.
Â
→ Check pmt_sellerid
and target URL. Test and production environments nor credentials can be mixed.
Return examples (HTTP GET 302)
Â
OK Return examples
Please notice that these are both single URLs that have been split into multiple lines per querystring parameter.
Â
CANCEL Return example
ERROR Return example
Â
If Svea Payments payment method selection page has been skipped, in some cases the names of erroneous input parameters are appended to the return URLs:
Invalid buyer email
Invalid delivery address postal code
Invalid buyer email, billing address postal code and delivery address postal code
Svea Payments Oy
info.payments@svea.fi
+358 9 4241 7050 (weekdays 8:00 - 16:00)
Saavutettavuusseloste