Log in to the YuvexPay dashboard and navigate to Settings > API Keys. Create a new key, choose Sandbox for testing, and copy the full secret — the secret is shown only once.
Treat API keys like database credentials. Store them in a secrets manager or
environment variable, never in source control or client-side code. If a key
leaks, revoke it from the dashboard and rotate.
Test keys are prefixed with ypk_test_ and only access sandbox data.
Production keys are prefixed with ypk_live_. A key looks like
ypk_<env>_<kid>_<secret>; the <kid> part is a 10-character public key id
(safe to log) and the <secret> part is the 32-character private material
(never log it).
Each key is scoped to a single company and carries one or more permissions
(payments:write, payments:read, payments:refund, withdrawals:write,
withdrawals:read, customers:write, customers:read, products:write,
products:read, documents:read, webhooks:read). Choose the smallest set of
scopes the integration needs.
Authenticate each request with your API key as a Bearer token. All write
endpoints require an X-Idempotency-Key header so retries never double-charge
a customer.
Render pixCopyPaste as a copy-paste string and qrCodeBase64 as a QR code
image. Use id as the path parameter for follow-up calls (GET /v1/payments/{paymentId},
POST /v1/payments/{paymentId}/refund).
For headless direct credit card charges, send a single CARD method together
with the card payload. The payer must have name and document available
through customer or customerId.
card is only accepted for headless single-method CARD payments with
installments: 1. Hosted and multi-installment card flows go through the
hosted checkout.
Set up a webhook endpoint to receive payment notifications. Configure it in
the dashboard under Settings > Webhooks.When the customer pays, you receive a PAYMENT_PAID event: