Shell Python Node PHP C# Ruby

Initiating Payments


Simple Card Payments

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

Processing card payments at a minimum requires a card number and expiration date but typically it's recommended to also provide the CVV, billing zipcode, and the cardholder's name for validation.


Simple Bank Payments

curl "https://api.payload.co/transactions" \
    -u secret_key_3bW9JMZtPVDOfFNzwRdfE: \
    -d "amount=100" \
    -d "type=payment" \
    -d "payment_method[type]=bank_account" \
    -d "payment_method[bank_account][account_number]=1234567890" \
    -d "payment_method[bank_account][routing_number]=021000121" \
    -d "payment_method[bank_account][account_type]=checking"
payment = pl.Payment.create(
    amount=100.0,
    payment_method=pl.BankAccount(
        account_number='1234567890',
        routing_number='021000121',
        account_type='checking'
    )
)
<?php
    $payment = Payload\Transaction::create(array(
        'amount'=>100.0,
        'type' => 'payment',
        'payment_method'=>new Payload\PaymentMethod(array(
            'type'=> 'bank_account',
            'bank_account'=>array(
                'account_number'=>'1234567890',
                'routing_number'=> '021000121',
                'account_type' => 'checking'
                )
        ))
    ));
?>
pl.Payment.create({
    amount: 100.0,
    payment_method: new pl.BankAccount({
        account_number: '1234567890',
        routing_number: '021000121',
        account_type: 'checking'
    })
}).then(function(payment) {
})
var payment = pl.Payment.create(new {
    amount=100.0,
    payment_method=new pl.BankAccount(new{
        account_number="1234567890",
        routing_number="021000121",
        account_type="checking"
    })
});
payment = Payload::Payment.create(
    amount: 100.0,
    payment_method: Payload::BankAccount(
        account_number: '1234567890',
        routing_number: '021000121',
        account_type: 'checking'
    )
)

Processing bank account payments requires the customer's account number, routing number, and account type. This will attempt to process the payment with the customer's bank through either ACH, PAD, or RTP networks depending on the account settings and currency.


Test Payments

To test card transactions using a test API key you can submit any dummy card number as long as it conforms to a valid card number format. A few test card number examples can be found in the Test Cards Section.

To test bank account transactions in your test environment you can use any dummy numerical value for the account number but the routing number must be a valid bank routing number.