PIX - Withdrawal (via PinBank)

Pix is an instant payment method developed by the Central Bank of Brazil that allows credit and debit transactions to occur in less than 10 seconds, 24/7 – including weekends and holidays.

The following method IDs are covered in this section:

IDNameCredit/Debit State
421Pix WithdrawalWithdrawnByProvider

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

Flow diagram

  1. Customer selects PIX Withdrawal payment option to do his withdrawal
  2. Merchant sends initiatePaymentRequest to PXP
  3. PXP validates the request and if ok sends initiatePaymentResponse with state to "PendingOnProvider"
  4. PXP sends the withdraw request to Pinbank (timeout 2 minutes)
  5. Pinbank performs the withdrawal and responds to PXP
  6. PXP handles the response from the provider and moves the payment to the correct state, like WithdrawnByProvider in case it was successful, RefusedByProvider, WithdrawErrorReportedByProvider in case it was not successful. Additionally PXP sends handlePaymentStateChangeNotification to merchant for the resulting state
  7. Merchant can then handle the payment

Note: If no response is received from the provider (within 2 minutes), this is handled as a time out and PXP sets state WithdrawCommunicationErrorOccurred and sends handlePaymentStateChangedNotification to merchant.

Redirect Integration

Currently not supported.

Backend2BackendIntegration

The following parameters have to passed in initiatePaymentRequest.UserData:

key (value type, account type, required)description
identificationNumber (string, required)Identification Number (CPF) of the recipient

The following parameters may be passed in specificPaymentData if PIX withdrawal with PIX key is used.

key (value type, account type, required)description
PaymentDescription (string, optional)Description
PixKey (string, required)Pix key
PixKeyType (string, required)1 = eMail
2 = telephone
3 = CPF
4 = random key

Additionally a payment account with bank details or a payment account ID may be passed (see samples below).

If a payment account with bank details is present on the payment, a PIX withdrawal with bank details is executed.
If a payment account is not present on the payment but PIX details are passed, a PIX withdrawal with PIX keys is done.

The following payment account bank details may be passed in specificPaymentAccountData:

KeyDescription
currencyCodedefaults to BRL
countryCodedefaults to BR
bankCodebank code value
holderNamebank account holder
accountNumberbank account number
branchCodebank branch code ("agencia")
accountTypebank account type
CACC: Conta corrente / Checking account
SLRY: Conta salário / Salary account
SVGS: Conta poupança / Savings account

For the integration supporting various Pix key types deployed in July 2024, see middle tab with PIX details below. For the PIX withdrawal with bank details see left tab with bank details respectively the tab with existing paymentaccountID for a followup payment.


For the legacy supporting only the CPF PIX key see "Legacy request/response" below.

Requests/Responses

Example initiatePaymentRequest:

<initiatePaymentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<merchantID>{{merchant}}</merchantID>
	<shopID>{{shop}}</shopID>
	<merchantTransactionID>{{merchantTransactionID}}</merchantTransactionID>
	<paymentMethodID>421</paymentMethodID>
	<amount currencyCode="BRL">10</amount>
	<userID>{{newUserID}}</userID>
	<userData>
		<username>{{newUserName}}</username>
		<firstname>John</firstname>
		<lastname>Doe</lastname>
		<currencyCode>USD</currencyCode>
		<languageCode>EN</languageCode>
		<email>[email protected]</email>
		<address xsi:nil="true"/>
		<identificationNumber>1234567890</identificationNumber>
		<identificationNumberType xsi:nil="true"/>
		<drivingLicenseNumber xsi:nil="true"/>
		<drivingLicenseIssuingState xsi:nil="true"/>
		<globalUserID xsi:nil="true"/>
		<nationality xsi:nil="true"/>
		<identificationIssuingCountry xsi:nil="true"/>
		<identificationNumberState xsi:nil="true"/>
	</userData>
	<userIP>127.0.0.1</userIP>
	<userSessionID>10a29467-7772-46a4-9efe-cf39d4aeb6e4</userSessionID>
	<creationTypeID>1</creationTypeID>
	<specificPaymentData>
		<data xsi:type="keyIntValuePair">
			<key>PaymentProviderID</key>
			<value>186</value>
		</data>
	</specificPaymentData>
	<paymentAccount>
		<specificPaymentAccountData>
			<data xsi:type="keyStringValuePair">
				<key>BankCode</key>
				<value>529</value>
			</data>
			<data xsi:type="keyStringValuePair">
				<key>BranchCode</key>
				<value>0001</value>
			</data>
			<data xsi:type="keyStringValuePair">
				<key>AccountNumber</key>
				<value>10529</value>
			</data>
			<data xsi:type="keyStringValuePair">
				<key>AccountOwner</key>
				<value>JOAO DA SILVA</value>
			</data>
			<data xsi:type="keyStringValuePair">
				<key>BankCountryCode2</key>
				<value>BR</value>
			</data>
			<data xsi:type="keyStringValuePair">
				<key>AccountType</key>
				<value>SVGS</value>
			</data>
		</specificPaymentAccountData>
	</paymentAccount>
</initiatePaymentRequest>
<initiatePaymentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<merchantID>{{merchant}}</merchantID>
	<shopID>{{shop}}</shopID>
	<merchantTransactionID>{{merchantTransactionID}}</merchantTransactionID>
	<paymentMethodID>421</paymentMethodID>
	<amount currencyCode="BRL">10</amount>
	<userID>hc20240919161919</userID>
	<userIP>127.0.0.1</userIP>
	<userSessionID>10a29467-7772-46a4-9efe-cf39d4aeb6e4</userSessionID>
	<creationTypeID>1</creationTypeID>
	<specificPaymentData>
		<data xsi:type="keyIntValuePair">
			<key>PaymentProviderID</key>
			<value>186</value>
		</data>
	</specificPaymentData>
	<paymentAccountID>611f542d-68ea-46bc-884f-ee578bdbff4f</paymentAccountID>
</initiatePaymentRequest>
<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>PinBankPIXDepositShop</shopID>
    <merchantTransactionID>MP_PIX_Provider_001</merchantTransactionID>
    <paymentMethodID>421</paymentMethodID>
    <amount currencyCode="BRL">10.1</amount>
    <userID>y2462fg5-3bb4-8888-df44-ccbd7200db54</userID>
    <userData>
        <username>JoeDoe</username>
        <firstname>Joe</firstname>
        <lastname>Doe</lastname>
        <identificationNumber>660123530</identificationNumber>
    </userData>
    <userIP>127.0.0.1</userIP>
    <userSessionID>349b2b2f-881c-4a39-bd2d-d8466ce933c8</userSessionID>
    <creationTypeID>1</creationTypeID>
    <specificPaymentData>        
        <data xsi:type="keyStringValuePair">
            <key>PaymentDescription</key>
            <value>test description</value>
        </data>
        <data xsi:type="keyStringValuePair">
            <key>PixKey</key>
            <value>134578</value>
        </data>
        <data xsi:type="keyStringValuePair">
            <key>PIXKeyType</key>
            <value>1</value>
        </data>
    </specificPaymentData>
</initiatePaymentRequest>

<initiatePaymentRequest xmlns="http://www.cqrpayments.com/PaymentProcessing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <merchantID>YourMerchantID</merchantID>
        <shopID>YourShopID</shopID>
        <merchantTransactionID>f20fdb1c-b4f4-4e58-924f-96346d4a6433</merchantTransactionID>
        <paymentMethodID>421</paymentMethodID>
        <amount currencyCode="BRL">15.00</amount>
        <userID>55517534</userID>
        <userData>
          <identificationNumber>76939737537</identificationNumber>
        </userData>
        <userIP>17.0.0.1</userIP>
        <userSessionID>53603066</userSessionID>
        <creationTypeID>1</creationTypeID>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>B2BTestMerchant</merchantID>
		<shopID>ProviderTesting</shopID>
		<paymentMethod>
			<key>421</key>
			<value>PIX Withdrawal</value>
		</paymentMethod>
		<merchantTransactionID>hc-20240920-112639</merchantTransactionID>
		<paymentID>dc231bbf-6120-4d8d-9a6b-e8611d5e4318</paymentID>
		<userID>hc20240920112639</userID>
		<paymentProvider>
			<key>186</key>
			<value>PINbank</value>
		</paymentProvider>
		<amount currencyCode="BRL">10</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>5192a5d9-31a8-4e81-b35e-80cd3c9278fc</id>
			<definition>
				<key>120</key>
				<value>PendingOnProvider</value>
			</definition>
			<createdOn>2024-09-20T09:26:39.9333764Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">2.65</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>54763632</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>b7a4f0e1-db4b-488a-ab89-1fc76fded133</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>
nitiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>B2BTestMerchant</merchantID>
		<shopID>ProviderTesting</shopID>
		<paymentMethod>
			<key>421</key>
			<value>PIX Withdrawal</value>
		</paymentMethod>
		<merchantTransactionID>hc-20240920-112033</merchantTransactionID>
		<paymentID>d4541595-c0a5-4c52-9bd5-1b8bcb7f8b95</paymentID>
		<userID>hc20240920112033</userID>
		<paymentProvider>
			<key>186</key>
			<value>PINbank</value>
		</paymentProvider>
		<amount currencyCode="BRL">10</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>5f48f1c3-c5bb-4ce6-81f0-29727c10abf2</id>
			<definition>
				<key>120</key>
				<value>PendingOnProvider</value>
			</definition>
			<createdOn>2024-09-20T09:20:34.0614609Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">2.65</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>54763629</value>
			</detail>
		</paymentDetails>
	</payment>
</initiatePaymentResponse>
<initiatePaymentResponse xmlns="http://www.cqrpayments.com/PaymentProcessing"
                         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>B2BTestMerchant</merchantID>
		<shopID>ProviderTesting</shopID>
		<paymentMethod>
			<key>421</key>
			<value>PIX Withdrawal</value>
		</paymentMethod>
		<merchantTransactionID>hc-20240920-113412</merchantTransactionID>
		<paymentID>1a7725f9-aa1c-4c5a-b91c-fc4ebfb88b49</paymentID>
		<userID>hc20240919161919</userID>
		<paymentProvider>
			<key>186</key>
			<value>PINbank</value>
		</paymentProvider>
		<amount currencyCode="BRL">10</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>1aa55c53-efa7-4616-bc71-370e56a803ed</id>
			<definition>
				<key>120</key>
				<value>PendingOnProvider</value>
			</definition>
			<createdOn>2024-09-20T09:34:12.6166158Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">2.65</baseAmount>
		<paymentDetails>
			<detail xsi:type="keyStringValuePair">
				<key>ProviderExternalID</key>
				<value>54763635</value>
			</detail>
		</paymentDetails>
		<paymentAccount>
			<paymentAccountID>611f542d-68ea-46bc-884f-ee578bdbff4f</paymentAccountID>
		</paymentAccount>
	</payment>
</initiatePaymentResponse>

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

Payment StateDescription
PendingOnProviderThe request was received and validated by PXP and will be sent to Provider asynchronously for processing.
Merchant has to listen for state change notification to receive the final result.
DuplicatePaymentValidationFailedDuplicate payment error state.

Notification

After the withdrawal was initiated with the provider, PXP will send a state notifiation to the merchant with the final result.

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-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BoletoDepositViaAstropayShop</shopID>
    <paymentMethod>
      <key>421</key>
      <value>PIX Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>d4ec11cc-d69f-4e4a-92c5-b99dceae0e87</merchantTransactionID>
    <paymentID>576939f6-e630-4663-8888-a6893692f5d7</paymentID>
    <userID>d82626ab-7517-454d-8b72-d9d09a</userID>
    <paymentProvider>
      <key>186</key>
      <value>PINbank</value>
    </paymentProvider>
    <amount currencyCode="BRL">12.0100</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>e08d1523-90f3-435b-813e-ca9845f9a3ff</id>
      <definition>
        <key>20</key>
        <value>WithdrawnByProvider</value>
      </definition>
      <createdOn>2022-03-24T10:47:11.08</createdOn>
      <paymentStateDetails>
          <key>ProviderResponseCode</key>
          <value>0</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Sucesso.</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>true</isExecuted>
    <baseAmount currencyCode="EUR">3.1900</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40824140</value>
      </detail>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderTransactionID</key>
        <value>natyxgwd615pk079vzjo</value>
      </detail>
    </paymentDetails>
  </payment><?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BoletoDepositViaAstropayShop</shopID>
    <paymentMethod>
      <key>421</key>
      <value>PIX Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>b187f72a-aa36-4f86-9da4-11d1cadbe63c</merchantTransactionID>
    <userID>d82626ab-7517-454d-8b72-d9d09a</userID>
    <paymentProvider>
      <key>186</key>
      <value>PINbank</value>
    </paymentProvider>
    <amount currencyCode="BRL">114.0700</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>121fda66-4d4e-47e5-a47d-8d718065bdb8</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-03-24T14:24:56.753</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseCode</key>
          <value>15</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Autorização negada.C05</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.2600</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40827221</value>
      </detail>
    </paymentDetails>
  </payment>
</handlePaymentStateChangedNotificationRequest>
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BoletoDepositViaAstropayShop</shopID>
    <paymentMethod>
      <key>421</key>
      <value>PIX Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>b187f72a-aa36-4f86-9da4-11d1cadbe63c</merchantTransactionID>
    <userID>d82626ab-7517-454d-8b72-d9d09a</userID>
    <paymentProvider>
      <key>186</key>
      <value>PINbank</value>
    </paymentProvider>
    <amount currencyCode="BRL">114.0700</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>121fda66-4d4e-47e5-a47d-8d718065bdb8</id>
      <definition>
        <key>100</key>
        <value>RefusedByProvider</value>
      </definition>
      <createdOn>2022-03-24T14:24:56.753</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseCode</key>
          <value>15</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Autorização negada.C05</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.2600</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40827221</value>
      </detail>
    </paymentDetails>
  </payment>
</handlePaymentStateChangedNotificationRequest>
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BoletoDepositViaAstropayShop</shopID>
    <paymentMethod>
      <key>421</key>
      <value>PIX Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>72d05d89-ee5c-461f-b8b4-2b2ee0df710e</merchantTransactionID>
    <paymentID>8971af02-580c-42e7-a56d-80a848414b37</paymentID>
    <userID>d82626ab-7517-454d-8b72-d9d09a</userID>
    <paymentProvider>
      <key>186</key>
      <value>PINbank</value>
    </paymentProvider>
    <amount currencyCode="BRL">114.0300</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>89d8689e-a1a2-497e-8484-93f443fcf0f9</id>
      <definition>
        <key>21</key>
        <value>WithdrawErrorReportedByProvider</value>
      </definition>
      <createdOn>2022-03-24T15:33:28.683</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseCode</key>
          <value>2</value>
        </detail>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>Erro de validação.</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.2500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40827932</value>
      </detail>
    </paymentDetails>
  </payment>
</handlePaymentStateChangedNotificationRequest>
<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <payment xmlns:q1="http://www.cqrpayments.com/PaymentProcessing" xsi:type="paymentWithPaymentAccount">
    <merchantID>B2BTestMerchant</merchantID>
    <shopID>BoletoDepositViaAstropayShop</shopID>
    <paymentMethod>
      <key>421</key>
      <value>PIX Withdrawal</value>
    </paymentMethod>
    <merchantTransactionID>4c530156-bb50-4476-a0e6-33a44ca10ed8</merchantTransactionID>
    <paymentID>59c4fe68-0cf7-4707-8a11-9575c8003d3d</paymentID>
    <userID>d82626ab-7517-454d-8b72-d9d09a</userID>
    <paymentProvider>
      <key>186</key>
      <value>PINbank</value>
    </paymentProvider>
    <amount currencyCode="BRL">114.0400</amount>
    <creationType>
      <key>1</key>
      <value>User</value>
    </creationType>
    <userIP>127.0.0.1</userIP>
    <state>
      <id>6624b2c7-adb5-40e5-9874-5a1ca1896fde</id>
      <definition>
        <key>576</key>
        <value>WithdrawCommunicationErrorOccurred</value>
      </definition>
      <createdOn>2022-03-24T15:38:33.713</createdOn>
      <paymentStateDetails>
        <detail xsi:type="keyStringValuePair">
          <key>ProviderResponseMessage</key>
          <value>There is no error code</value>
        </detail>
        <detail xsi:type="keyIntValuePair">
          <key>PaymentStateReasonID</key>
          <value>1</value>
        </detail>
      </paymentStateDetails>
    </state>
    <isExecuted>false</isExecuted>
    <baseAmount currencyCode="EUR">30.2500</baseAmount>
    <paymentDetails>
      <detail xsi:type="keyStringValuePair">
        <key>ProviderExternalID</key>
        <value>40827939</value>
      </detail>
    </paymentDetails>
  </payment>
</handlePaymentStateChangedNotificationRequest>

The payment can have one of the following final states:

Payment StatesDescriptionTo simulate the test case (with mock at PXP)
WithdrawnByProviderSuccess stateany amount other than below
RefusedByProviderWithdrawal was refused by providercreate a payment with amount 114.07
WithdrawalErrorReportedByProviderError state due to failed payment submission at provider; errors are logged in the PaymentStateAdditionalDetails fields ProviderResponseCode and ProviderResponseMessagecreate a payment with amount 114.03
WithdrawCommunicationErrorOccurredError state because of failed communication with the provider, unexpected response received, etc. See State.Description for more details.create a payment with amount 114.04
ValidationFailedError state because of missing data.tbd

State diagram

Testing instructions

Identification Numbers for PIX withdrawal via Pinbank

CountryIdentificationNumber (sample values for testing)Notes
Brasil9be80be0-a299-4ded-a499-20383e99f329This is the only identification number supported by PinBank for testing