Skip to Content
Docs

Create a payout

Send a payout from your server when you already have the recipient's card, bank account, or wallet details.

When you already have the recipient's details, send a payout with POST /v1/payouts. You can pay out to a saved payment method, to raw details provided in the request, or to the customer's default payment method. To let the recipient choose a payout method on your site, see Let recipients choose a payout method.

Send a payout

Your server checks the destination, sends the payout, and acts on the response.

  1. 1

    Check the destination

    When the destination is a saved payment method, pay out only to one of the customer's saved payment methods whose flow_directions.payout is true. It can be a payment method saved when the customer paid, such as the PayPal or Venmo account they paid with, or one saved in a setup session. GET /v1/customers/{reference_id}/payment_methods lists them. Pay.com sends the payout to any saved method you name, so one that can't receive payouts is declined.

  2. 2

    Create the payout

    Send the amount in the smallest currency unit (10000 is $100.00), the currency, and one destination. Send a unique idempotency-key with each payout, and send the same key when you retry.

    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",
        "destination": "pm_card_685217824846643200",
        "customer_reference_id": "cust-john-smith-001",
        "reference": "withdrawal-001",
        "description": "Withdrawal for order 12345"
      }'
  3. 3

    Handle the response

    The status code and the payout's status tell you what happened and what to do next.

    ResponseWhat happenedWhat to do
    201, status: succeededThe payout was sent.Record it. A bank payout can still be returned.
    201, status: pendingPay.com accepted the payout, and it's waiting to be sent or confirmed, or for funds.Wait for its webhook event.
    400, payment_method_errorThe payout was declined, or blocked by a risk rule. The payout still exists, with its ID in error.payout and the reason in error.decline_code.Retrieve the payout to see whether it's failed or blocked.
    400, any other errorThe request isn't valid. For example, destination is an unknown payment method ID or a payment method saved for a customer other than customer_reference_id, settlement_account conflicts with the payment method's settlement account, or reference already exists while duplicate reference checking is enabled.Fix the request and send it with a new idempotency key.
    409A request with the same idempotency key is still being processed.Wait, then retry with the same key.
    422Payouts aren't allowed for this payout method or account (Payouts are not allowed), or no payment method you imported has the reference sent in destination.Ask your account manager to turn the payout method on, or fix destination.

    Then follow the payout to its final status. See Track and manage payouts.

Destinations

Send exactly one destination. payout_method and payout_method_data are aliases of destination and destination_data.

SendPays out to
destinationA saved payment method: its ID (for example pm_card_… or pm_us_bank_account_…), a card token ID (tok_card_…), or the reference of a payment method you imported.
destination_dataDetails you send with the payout. type names the payout method, and an object of the same name holds its details, with the recipient's billing_details alongside. Pay.com pays out to them once and doesn't save them.
Neither, with customer_reference_idThe customer's default payment method.

Payout method details

The object named after the type needs these fields:

typeRequired in the object of the same name
cardnumber, expiry_month, expiry_year
applepay, googlepayThe wallet's encrypted token (see Wallets)
network_tokentoken, token_type, expiry_month, expiry_year
us_bank_accountaccount_number, routing_number
eu_bank_accountiban
uk_bank_accountsort_code, account_number
au_bank_accountbsb_code, account_number
nz_bank_accountbank_code, branch_code, account_number (plus suffix if applicable)
in_bank_accountaccount_number, and the branch's IFSC as routing_number
skrill, interacemail
paypalAt least one of email, payer_id, and phone
venmoAt least one of email, user_handle, and phone
netellerNone. Pay.com pays out to the Neteller account in billing_details.email
paysafecardNone. Send the recipient's billing_details.dob
bizumphone
ecopayzaccount_number
t365_p2p, t365_qr, t365_momo, t365_bt, t365_p2caccount_number, bank, branch, and billing_details.phone

Card, wallet, network token, and bank account details need a PCI compliant key. Pay.com tokenizes them before it processes the payout, and never stores or returns the full card or account number.

Wallets

To pay out to a card in Apple Pay or Google Pay, send the wallet's encrypted token as the wallet returns it, and Pay.com decrypts it. For Apple Pay, that's the paymentData of the PKPaymentToken. For Google Pay, it's paymentMethodData.tokenizationData.token, parsed from its JSON string. Field names keep the wallet's camelCase, and authentication_context isn't supported on payouts. See Wallets for how you get the token.

{
  "destination_data": {
    "type": "applepay",
    "applepay": {
      "version": "EC_v1",
      "data": "4OZho15e9Yp5K0EtKergKzeRpPAjnKHw…",
      "signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID…",
      "header": {
        "publicKeyHash": "LbsUwAT6w1JV9tFXocU813TCHks+LSuFF0R/eBkrWnQ=",
        "ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE…",
        "transactionId": "2686f5297f123ec7fd9d31074d43d201953ca75f098890375f13aed2737d92f2"
      }
    }
  }
}

If you decrypt the token yourself, send type: network_token instead, with the DPAN as network_token.token, token_type set to applepay or googlepay, the token's expiration date, and its cryptogram at the top level of network_token. A payout takes no eci and no 3D Secure result.

Options

A payout request also takes these optional fields:

FieldWhat it does
referenceYour own reference for the payout, up to 255 characters. You can retrieve the payout by it. When duplicate reference checking is on for your account, a repeat returns 400 Reference already exists.
descriptionA note about the payout, up to 255 characters.
metadataKey-value pairs, with string values.
statement_descriptor_suffixAdded to your account's statement descriptor on the recipient's statement. The whole descriptor is limited to 22 characters.
payout_method_optionsOptions by payout method. For us_bank_account: rail (ach, rtp, or fednow), ach_payment_type (next_day or same_day), and fallback_to_ach, which sends an RTP payout by same-day ACH when RTP isn't available (a FedNow payout always falls back to ACH). Cards and Interac accept name_verification, and Skrill accepts verification, email_subject, and email_message. To refresh an expired saved card before a payout, see Account billing updater.
balance_failure_on_createFor a bank payout, true checks your balance when you create the payout. If your balance can't fund it, Pay.com declines it immediately with insufficient_funds instead of leaving it pending until funds arrive. Defaults to false.
settlement_accountThe settlement account to pay out from (sa_…), if you have several. A payment method that's bound to another settlement account returns 400. See Settlement accounts.

Next steps

Was this page helpful?