Let recipients choose a payout method
Let recipients pick a saved payout method or add a new one with Universal checkout or Headless checkout, then pay out from your server.
When the recipient chooses how to get paid, they select a saved payout method or add a new one on your website. Your server creates a payout setup session, your frontend presents the choice with Pay.com.js, and your server sends the payout to the method they selected. If you already have the recipient's payout details, create a payout directly instead.
Set up payout method selection
Your server creates the setup session and submits the payout, while your frontend displays the payout method options.
- 1
Check enabled payout methods
Your account manager enables payout methods in the sandbox and live environments. Call
GET /v1/merchants/current/payment_method_optionsto list enabled payout methods inpayout_method_options.types, which is separate from thetypesenabled for incoming payments. - 2
Create a payout setup session
From your server, create a setup session with
POST /v1/sessions/setup, passing the recipient'scustomer_reference_idand"payout": true. The session offers only enabled payout methods, either all enabled types or the subset you specify inpayment_method_types. Requesting a method that isn't enabled for payouts returns an error.curl https://api.sandbox.pay.com/v1/sessions/setup \ -u ':sk-pay-com-sandbox-…' \ -H "Content-Type: application/json" \ -H "idempotency-key: $(uuidgen)" \ -d '{ "customer_reference_id": "user_10", "payout": true }'{ "id": "ss_747110684277344256", "resource": "setup_session", "client_secret": "eyJhbGciOiJIUzUxMiJ9...", "customer": "cust_747110680854791169", "customer_reference_id": "user_10", "payment_method": null, "payment_method_types": ["card", "skrill"], "status": "open", "created": "2026-11-20T15:11:07.804Z", "test_mode": true }Associate the session's
idwith the recipient on your server and passclient_secretto your frontend. Only this response returnsclient_secret, and it stays valid for the lifetime of the session (60 minutes by default unless you setduration). For US bank account payouts, also include the recipient'sbilling_details. See US bank account. - 3
Display payout method options
On your frontend, initialize a checkout with
pay.checkout(), passingclientSecretand youronSuccessandonFailurecallbacks. Then render the choice using Universal checkout or Headless checkout.Call
checkout.universal()with a container element to render Pay.com's hosted form. The form displays the recipient's saved payout methods and lets them add any payout method enabled for the session.import Pay from '@pay-com/js'; const pay = await Pay.com({ identifier: '<YOUR_MERCHANT_ID>' }); const checkout = pay.checkout({ clientSecret, onSuccess: async (result) => { // Notify your server with result.transaction (setup session ID) await fetch('/api/payout-setup-complete', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ setupSessionId: result.transaction }), }); }, onFailure: (error) => { console.error('Payout setup failed:', error.message); }, }); checkout.universal({ container: '#payout-container' });When the recipient saves a method,
onSuccessreceives the setup session ID intransactionand the saved method inpaymentMethod. Notify your server to confirm the session.In your app
Let recipients choose how they’re paid, in the drop-in.
- 4
Confirm the choice and pay out
Verify the recipient's choice on your server rather than trusting an ID sent from the browser. Only pay out to a saved payment method whose
flow_directions.payoutistrue.- Retrieve the setup session with
GET /v1/sessions/setup/{id}when your frontend notifies your server, or when thesetup_session.completedwebhook arrives. - Confirm that
statusiscompletedandcustomer_reference_idmatches your recipient. Readpayment_methodfor the selected method ID. - Call
POST /v1/payoutswith that ID asdestinationand a uniqueidempotency-key. Amounts are in minor units (for example,10000is $100.00 USD).
{ "id": "ss_747110684277344256", "resource": "setup_session", "customer": "cust_747110680854791169", "customer_reference_id": "user_10", "payment_method": "pm_card_747113042071782400", "status": "completed", "test_mode": true }curl https://api.sandbox.pay.com/v1/payouts \ -u ':sk-pay-com-sandbox-…' \ -H "Content-Type: application/json" \ -H "idempotency-key: $(uuidgen)" \ -d '{ "amount": 10000, "currency": "usd", "customer_reference_id": "user_10", "destination": "pm_card_747113042071782400" }'Handle the response as documented in Create a payout, then track the payout to its final status.
- Retrieve the setup session with
Next steps
- Create a payout: Handle payout responses, errors, and method options.
- Track and manage payouts: Subscribe to webhooks, cancel pending payouts, and handle returns.
- Test and go live: Test payout outcomes in the sandbox before switching to live keys.