Skip to main content
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:
  1. Your server creates a payment method session (POST /payment-method-sessions, secret key) and hands its client_secret to your page.
  2. 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 succeeded with the card’s brand and last four, or the account’s last four.
  3. Your server turns the session into a payment method (POST /payment-methods) and charges it (POST /payments, with an Idempotency-Key). A card answers succeeded at once; a bank debit answers processing and settles later. A refusal answers 402 and leaves the failed payment readable.
  4. A webhook endpoint you registered receives payment.succeeded, payment.failed or payment.returned, signed; GET /events/{id} shows every delivery.
  5. Money goes back through a refund (POST /refunds), once the payment has settled.
Do this once against your sandbox workspace with a test card; then read Environments for what changes when you go live.

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.