1
Create a secret key
In the Payra dashboard, open Settings → Integrations and select Create key. Choose Secret key, give it a
name that says where it will run, and select Create key. If you do not see the Integrations tab, your role
may lack the permission to view API keys and webhooks, or the API is not enabled on your workspace: ask a
workspace admin or Payra. Creating a key needs the permission to manage API keys and webhooks.The full key is shown once. Copy it into your server’s secret manager before you close the dialog.
2
Call the API
Retrieve the account the key belongs to. It is the quickest way to check that a key works:
Response
3
Take a payment end to end
Everything else is the same path, whatever you build on it:
- Your server creates a payment method session (
POST /payment-method-sessions, secret key) and hands itsclient_secretto your page. - Your page mounts Payra Elements with your publishable key and that secret; the customer enters a card or a US bank account and Elements confirms the session. The session reads
succeededwith the card’s brand and last four, or the account’s last four. - Your server turns the session into a payment method (
POST /payment-methods) and charges it (POST /payments, with anIdempotency-Key). A card answerssucceededat once; a bank debit answersprocessingand settles later. A refusal answers402and leaves the failed payment readable. - A webhook endpoint you registered receives
payment.succeeded,payment.failedorpayment.returned, signed;GET /events/{id}shows every delivery. - Money goes back through a refund (
POST /refunds), once the payment has settled.
Next steps
Payra Elements
Secure card or bank account fields for your page, tokenized before they reach Payra.
Payments
Charge a card at once, or debit a bank account and follow it to settlement.
Errors
The error format every endpoint shares.
Rate limits
How many requests a key can make, and how to back off.