Goal
Enable a returning user to withdraw funds to the debit card they previously used to deposit via Apple Pay.This flow builds on the Apple Pay Integration guide. Users must have completed an initial deposit through the Apple Pay flow before they can withdraw to their Apple Pay debit card. Complete that integration first.
Steps
Step 1: Display stored credentials and enable selection
What you need to do
Display the debit cards a user previously used with Apple Pay and allow them to select one to withdraw to.How to do it
- Call the list-user-credentials endpoint with the user’s ID.
- Filter the returned credentials for those with type
apple_pay_debit. Only these credentials can be used for withdrawals to a debit card stored via Apple Pay. - Render the filtered credentials in your UI so they are easily identifiable, and allow the user to select which card they would like to withdraw to.
For
apple_pay_debit credentials, the card_last4 field contains the last four digits of the user’s FPAN (the funding primary account number — i.e. the physical card number), not the last four of the device-specific card token (DPAN) generated by Apple. Display card_last4 so the user can recognize their physical card.Step 2: Submit the withdrawal for authorization
What you need to do
Submit the withdrawal using the credential selected by the user.How to do it
- Call the authorize-payment endpoint with the selected
credential_id,directionset tocash_out, and theamount. - On a
200response, the withdrawal was approved. Display the result to the user. - Handle the
401response. In a small number of edge cases the user’s debit card does not support OCT (Original Credit Transactions), which are required to push funds to the card. When this occurs, prompt the user to withdraw to a different card.
A
401 indicates the selected card cannot receive funds via OCT. This is determined by the card issuer and is not something the user can resolve for that card — guide them to select or add another debit card to complete the withdrawal.Integration checklist
- Create a stored
apple_pay_debit-type credential by performing a deposit with a debit card from your Apple Pay wallet- Verify that the credential is displayed with
card_last4 - Test submitting a withdrawal transaction using the stored credential
- Verify that the credential is displayed with
- Create a stored
apple_pay-type credential by performing a deposit with a credit card from your Apple Pay wallet, verify the credential is not presented for withdrawals. - Test an OCT-decline by submitting a transaction with an
apple_pay_debit-type credential for the amount of $22.00