Trustly Account Payout (TrustlyInstantBankWithdrawal)

Provider Trustly offers bank transfer withdrawal for various countries in Europe.

The following method IDs are covered in this section:

IDNameCredit/Debit State
363TrustlyInstantBankWithdrawalWithdrawnByProvider

Payment method interaction type: Sychronous execution (see Interaction Types).

Redirect Integration

Currently not supported.

Backend2BackendIntegration

The merchant needs to pass the payment account ID received in the TrustlyInstantBankDeposit with active account notification.

Example initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<merchantID>Merchant</merchantID>
	<shopID>Shop</shopID>
	<merchantTransactionID>2d3700ac-8381-4f97-9bb5-5e2107f8cb49</merchantTransactionID>
	<paymentMethodID>363</paymentMethodID>
	<amount currencyCode="EUR">1.99</amount>
	<userID>18109be0-b3c8-4482-bfc0-447d1b</userID>
	<userData>
		<username>18109be0-b3c8-4482-bfc0-447d1b</username>
		<address>
			<countryCode2>AT</countryCode2>
		</address>
		<dateOfBirth>1965-06-09T00:00:00</dateOfBirth>
	</userData>
	<userIP>127.0.0.1</userIP>
	<userSessionID>83392ab4-e15b-44ac-b59d-784145d2a188</userSessionID>
	<creationTypeID>1</creationTypeID>
	<paymentAccountID>60713af6-6a9a-40fc-ba3a-bbf7d31fab88</paymentAccountID>
</initiatePaymentRequest>

Example initiatePaymentRequest with userdata (required if the preceding payment was a Trustly Pay N Play registration):

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<merchantID>Merchant</merchantID>
	<shopID>Shop</shopID>
	<merchantTransactionID>2d3700ac-8381-4f97-9bb5-5e2107f8cb49</merchantTransactionID>
	<paymentMethodID>363</paymentMethodID>
	<amount currencyCode="EUR">1.99</amount>
	<userID>18109be0-b3c8-4482-bfc0-447d1b</userID>
	<userData>
                <username>Ninjauser123</username>
                <firstname>ninja</firstname>
                <lastname>user </lastname>
                <address>
                        <street>Eggelstad 91</street>
                        <houseName>Eggelstad 91</houseName>
                        <postalCode>275 36</postalCode>
                        <city>Sjöbo</city>
                        <countryCode2>SE</countryCode2>
                        <telephoneNumber>1111111111</telephoneNumber>
                </address>
                <dateOfBirth>1962-05-12T00:00:00</dateOfBirth>                                
</userData>
	<userIP>127.0.0.1</userIP>
	<userSessionID>83392ab4-e15b-44ac-b59d-784145d2a188</userSessionID>
	<creationTypeID>1</creationTypeID>
	<paymentAccountID>60713af6-6a9a-40fc-ba3a-bbf7d31fab88</paymentAccountID>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID></merchantID>
		<shopID></shopID>
		<paymentMethod>
			<key>363</key>
			<value>TrustlyInstantBankWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>a326c8cf-363b-4f8d-88f3-3f6317f6af1a</merchantTransactionID>
		<paymentID>045dec62-1f74-4e01-a044-3815722a4fc6</paymentID>
		<userID>94a2561b-5103-48ee-9274-0f322e</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">4.96</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>db47e586-708d-4594-9d4b-866c0eddad88</id>
			<definition>
				<key>240</key>
				<value>ToBeWithdrawnByProvider</value>
			</definition>
			<createdOn>2020-08-10T12:02:47.9063643Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">4.96</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderTransactionID</key>
				<value>48504808</value>
			</detail>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>217341</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>60713af6-6a9a-40fc-ba3a-bbf7d31fab88</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>

The payment can reach one of the following states in the initiatePaymentResponse:

Payment StatesDescription
ToBeWithdrawnByProviderPayment to be withdrawn, payment should be updated to WithdrawnByProvider state within 2 minutes
WithdrawErrorReportedByProviderError state; errors are logged in the PaymentStateAdditionalDetails fields ProviderErrorCode and ProviderErrorMessage
WithdrawCommunicationErrorOccurredError state (in the event of a time out)
InitiateErrorReportedByProviderError state; errors are logged in the PaymentStateAdditionalDetails fields ProviderErrorCode and ProviderErrorMessage
InitiateRequestProviderCommunicationErrorOccurredError state (in the event of a time out)

Example initiatePaymentResponse WithdrawErrorReportedByProvider:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>B2BTestMerchant</merchantID>
		<shopID>TrustlyInstantBankWithdrawalShop</shopID>
		<paymentMethod>
			<key>363</key>
			<value>TrustlyInstantBankWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>d0a26339-48b1-4395-abfd-a5a6a845ce24</merchantTransactionID>
		<paymentID>48cefe71-13a0-426a-83c1-22a6e1a6ca90</paymentID>
		<userID>1ad71be4-8f36-4368-8187-35bd45</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">6.0200</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>33e48c70-d40b-4641-8375-3ded54007945</id>
			<definition>
				<key>21</key>
				<value>WithdrawErrorReportedByProvider</value>
			</definition>
			<createdOn>2021-09-27T07:35:35.977</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>ProviderErrorMessage</key>
					<value>Refused (602)</value>
				</detail>
				<detail xsi:type="keyStringValuePair">
					<key>ProviderErrorCode</key>
					<value>602</value>
				</detail>
				<detail xsi:type="keyIntValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">6.0200</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>271596</value>
			</detail>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderTransactionID</key>
				<value>41278730</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>d9ee74d4-cc03-4e77-928c-453dcb5af69c</paymentAccountID>
		</paymentAccount>
	</payment>
</handlePaymentStateChangedNotificationRequest>

Example initiatePaymentResponse WithdrawCommunicationErrorOccurred:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>XXXXXXXX</merchantID>
		<shopID>XXXXXXXX</shopID>
		<paymentMethod>
			<key>363</key>
			<value>TrustlyInstantBankWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>dbb6f61d-0161-47ba-b4fc-63ec21a81d84</merchantTransactionID>
		<paymentID>d72bd96f-cb60-4544-b518-219c0d638478</paymentID>
		<userID>b4701958-feeb-4b29-934a-434287</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">5.95</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>e4947bc0-7405-4199-95c1-11f941d2e937</id>
			<definition>
				<key>576</key>
				<value>WithdrawCommunicationErrorOccurred</value>
			</definition>
			<createdOn>2021-09-14T07:39:57.4514676Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">5.95</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderTransactionID</key>
				<value>78628772</value>
			</detail>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>269644</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>1039b115-4320-46ec-ac3b-0da1230fd867</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>

Example initiatePaymentResponse InitiateErrorReportedByProvider:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>XXXXXXXX</merchantID>
		<shopID>XXXXXXXX</shopID>
		<paymentMethod>
			<key>363</key>
			<value>TrustlyInstantBankWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>261e38df-0d73-4aff-a855-a6c157f2a033</merchantTransactionID>
		<paymentID>2d9f4ce7-3880-4d16-bc2b-c2e31afe2461</paymentID>
		<userID>627f9eea-cca7-486c-893e-803833</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">99</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>1f30e6a5-02cd-40d3-b118-ea7205ddcae7</id>
			<definition>
				<key>4</key>
				<value>InitiateErrorReportedByProvider</value>
			</definition>
			<createdOn>2021-09-14T07:39:50.4826655Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>ProviderErrorMessage</key>
					<value>Refused (602)</value>
				</detail>
				<detail xsi:type="keyStringValuePair">
					<key>ProviderErrorCode</key>
					<value>602</value>
				</detail>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">99</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>269642</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>4cdc4f38-8e69-47ab-b7d3-43e544b1b7c3</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>

Example initiatePaymentResponse InitiateRequestProviderCommunicationErrorOccurred:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>XXXXXXXX</merchantID>
		<shopID>XXXXXXXX</shopID>
		<paymentMethod>
			<key>363</key>
			<value>TrustlyInstantBankWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>3e524de9-87e2-4edc-b3d0-1fb02225a014</merchantTransactionID>
		<paymentID>f18a7a9e-57c5-44cf-90f9-9abc7946f789</paymentID>
		<userID>53c6e707-b677-4ac5-824e-18b0cb</userID>
		<paymentProvider>
			<key>114</key>
			<value>Trustly</value>
		</paymentProvider>
		<amount currencyCode="EUR">666</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>f5ce2f3e-6359-4073-80a5-dbaa119cb369</id>
			<definition>
				<key>325</key>
				<value>InitiateRequestProviderCommunicationErrorOccurred</value>
			</definition>
			<createdOn>2021-09-14T07:39:47.7638887Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">666</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>269641</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>34da1ec4-73ff-44fa-a3e8-cc6b65631fde</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>

The following states are returned in handlePaymentStateChangedNotification:

Payment StatesDescription
WithdrawnByProviderSuccess state
This state is reached 2 minutes after the state ToBeWithdrawnByProvider
RefusedByProviderError state; errors are logged in the PaymentStateAdditionalDetails field ProviderReturnCode

Notifications

The standard notification mechanism is used for notifying the merchant in the background (asynchronously) about payment state changes. For more information see PaymentStateChangedNotification.

Example handlePaymentStateChangedNotificationRequest:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
       <payment xsi:type="paymentWithPaymentAccount">
              <merchantID>B2BTestMerchant</merchantID>
              <shopID>TrustlyBankTransferWithdrawalShop</shopID>
              <paymentMethod>
                     <key>24</key>
                     <value>BankTransferWithdrawal</value>
              </paymentMethod>
              <merchantTransactionID>e6673f4c-f550-425e-8399-edc46ec1ba77</merchantTransactionID>
              <paymentID>baf68a49-5f20-464d-9f91-8750b0b48e72</paymentID>
              <userID>552b14e0-cd15-4a38-be91-d7e74b</userID>
              <paymentProvider>
                     <key>114</key>
                     <value>Trustly</value>
              </paymentProvider>
              <amount currencyCode="EUR">10.0000</amount>
              <creationType>
                     <key>1</key>
                     <value>User</value>
              </creationType>
              <userIP>127.0.0.1</userIP>
              <state>
                     <id>b5902473-1d55-42d7-bb3e-3e409651d19d</id>
                     <definition>
                           <key>20</key>
                           <value>WithdrawnByProvider</value>
                     </definition>
                     <createdOn>2017-07-14T13:16:03.54</createdOn>
                     <paymentStateDetails>
                           <detail xsi:type="keyStringValuePair">
                                  <key>ProviderReturnCode</key>
                                  <value>1</value>
                           </detail>
                     </paymentStateDetails>
              </state>
              <isExecuted>true</isExecuted>
              <baseAmount currencyCode="EUR">10.0000</baseAmount>
              <paymentDetails>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderExternalID</key>
                           <value>70571</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>UserFirstname</key>
                           <value>Patrick</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>UserLastname</key>
                           <value>Fitzgerald</value>
                     </detail>
                     <detail xsi:type="keyStringValuePair">
                           <key>ProviderTransactionID</key>
                           <value>2422610363BDD</value>
                     </detail>
              </paymentDetails>
              <paymentAccount>
                     <paymentAccountID>7d431c69-101b-41e4-a53c-df67e296aaf7</paymentAccountID>
                     <details>
                           <detail xsi:type="keyStringValuePair">
                                  <key>TrustlyPaymentAccountToken</key>
                                  <value>3bfb7131-2431-438c-8bca-39a73753cd7d</value>
                           </detail>
                     </details>
              </paymentAccount>
       </payment>
</handlePaymentStateChangedNotificationRequest>