Skip to main content
POST
Create a payment

Authorizations

Authorization
string
header
required

A secret key, sk_test_... or sk_live_...; a publishable key (pk_...) on the browser routes only

Body

application/json
payment_method
string
required

A payment method of yours that is active. A one-time method is spent by this charge.

Required string length: 1 - 64
Example:

"pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf"

amount
integer
required

In the smallest unit of the currency.

Example:

12550

currency
enum<string>
required
Available options:
USD,
CAD
Example:

"USD"

description
string
Required string length: 1 - 500
Example:

"Invoice INV-1042"

reference
string

Your own reference for this charge, such as an order or invoice number; shown on the payment.

Required string length: 1 - 100
Example:

"INV-1042"

customer
string<uuid>

Optional. When given, must be the customer the payment method is saved on.

Response

The payment

object
enum<string>
required
Available options:
payment
id
string
required
Example:

"pay_test_7Hs2kQ9mL1pXv4cR8tWzAbCdEf"

status
enum<string>
required

processing until the processor answers, and, on a bank debit, until it settles, that is until the processor sends it to the bank in its next batch; authorized when it approved but has not captured; succeeded once a card is captured or a bank debit has settled, which does not make a bank debit final (see returned); failed when it refused (the create then answers 402 and this object stays readable); canceled after a void; returned when the money came back after success (a bank return or a chargeback, see failure); requires_action if the processor asked for a step this server-side charge cannot take.

Available options:
processing,
requires_action,
authorized,
succeeded,
failed,
canceled,
returned
Example:

"succeeded"

amount
integer
required

In the smallest unit of the currency (cents).

Example:

12550

currency
enum<string>
required
Available options:
USD,
CAD
Example:

"USD"

payment_method
string
required
Example:

"pm_test_9kQ2mL7Hs1pXv4cR8tWzAbCdEf"

customer
string<uuid> | null
required
Example:

null

description
string | null
required
Example:

"Invoice INV-1042"

reference
string | null
required

Your reference, as you sent it.

Example:

"INV-1042"

card
object | null
required

Set when payment_method_type is card.

failure
object | null
required

Set when status is failed or returned: why, in a fixed vocabulary. card_declined, insufficient_funds, authentication_failed, invalid_payment_method and duplicate_transaction are the processor refusing the card; ach_returned and chargeback are money coming back after success; processing_error is a fault on the way to the processor or in the request, safe to retry later; a refusal in words Payra cannot classify reads card_declined. The processor's own text is never relayed.

next_action
object | null
required

A server-side charge sends no 3-D Secure return address, so this is normally null; if a processor asks for a redirect anyway, it is here.

Example:

null

livemode
boolean
required
Example:

false

created_at
string<date-time>
required
Example:

"2026-09-18T20:00:00.000Z"

succeeded_at
string<date-time> | null
required

When the card was captured, or the bank debit settled.

Example:

"2026-09-18T20:00:01.312Z"

amount_refunded
integer
default:0

How much of amount has been refunded so far, counting refunds that succeeded, wherever they were made. status stays succeeded; GET /v1/refunds?payment= lists them.

Example:

0

payment_method_type
enum<string>
default:card
Available options:
card,
us_bank_account
Example:

"card"

us_bank_account
object | null

Set when payment_method_type is us_bank_account.

Example:

null