Shell Python Node PHP C# Ruby

Using Processing Accounts


Select all active processing accounts

curl "https://api.payload.com/processing_accounts/?status=active" \
    -u secret_key_3bW9JMZtPVDOfFNzwRdfE:
processing_account = pl.ProcessingAccount.filter_by(
    status='active'
).all()
processing_account = Payload::ProcessingAccount.
    filter_by(
        status: 'active'
    ).
    all()
<?php
$processing_account = new Payload\ProcessingAccount::filter_by(array(
    'status' => 'active'
));
?>
const processing_accounts = await pl.select(pl.ProcessingAccount).filterBy({ status: 'active' })
var processing_accounts = await pl.ProcessingAccount
    .FilterBy(new { status = "active" })
    .AllAsync();

Paying a processing account

curl "https://api.payload.com/transactions" \
    -u secret_key_3bW9JMZtPVDOfFNzwRdfE: \
    -d "amount=100" \
    -d "type=payment" \
    -d "processing_id=acct_3brhxEXpz2qEJ8vnIXbvW" \
    -d "payment_method[type]=card" \
    -d "payment_method[card][card_number]=4242 4242 4242 4242" \
    -d "payment_method[card][expiry]=12/25" \
    -d "payment_method[card][card_code]=123"
payment = pl.Payment.create(
    amount=100.0,
    processing_id='acct_3brhxEXpz2qEJ8vnIXbvW',
    payment_method=pl.Card(
        card_number='4242 4242 4242 4242',
        expiry='12/25',
        card_code='123'
    )
)
<?php
$payment = Payload\Transaction::create([
    'amount'=> 100.0,
    'type'=> 'payment',
    'processing_id'=>'acct_3brhxEXpz2qEJ8vnIXbvW',
    'payment_method' =>new Payload\PaymentMethod([
        'type'=> 'card',
        'card'=> ['card_number'=>'4242 4242 4242 4242', 'expiry'=>'12/25', 'card_code' => '123']
    ]),
]);
?>
const payment = await pl.Payment.create({
    amount: 100.0,
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    payment_method: pl.Card({
        card_number: '4242 4242 4242 4242',
        expiry: '12/25',
        card_code: '123'
    })
})
var payment = await pl.Payment.CreateAsync(new {
    amount = 100.0,
    processing_id = "acct_3brhxEXpz2qEJ8vnIXbvW",
    payment_method = new pl.Card(new {
        card_number = "4242 4242 4242 4242",
        expiry = "12/25",
        card_code = "123"
    })
});
payment = Payload::Payment.create(
    amount: 100.0,
    processing_id: 'acct_3brhxEXpz2qEJ8vnIXbvW',
    payment_method: Payload::Card.new(
        card_number: '4242 4242 4242 4242',
        expiry: '12/25',
        card_code: '123'
    )
)

Accepting payments and making transfers with a Processing Account is simple. Once your account is activated, use the resulting account id with transactions, invoices, customers, and more. Many of the Payload APIs accept a processing_id field to specify the intended processing account association. See below for some of the common use cases:

Making a Payment

To make a payment to a specific processing account, set the processing_id parameter to the id of the desired processing account.

Segmenting Customers

If you are using Customers to manage your customer accounts, you can specify a primary processing account for each customer by setting the primary_processing_id.

Any payment made for this customer without a processing_id specified will default to the primary_processing_id.

Associating Invoices & Billing Schedules

If you are using invoicing or billing schedules to invoice and bill your customers, use the processing_id field to associate the intended processing account with your invoices and schedules.

Sending Payment Requests

If you're using payment links to send payment requests to your clients, use the processing_id field to associate the intended processing account for the resulting payment.

Building Your Own Checkout

If you're using secure inputs or checkout to integrate a custom checkout flow, both ui elements accept a processing_id option to specify the intended processing account for the resulting payments.