Card payments
Collect card payments through SenjaroPay’s hosted checkout. Configure where the customer lands after checkout in the merchant portal, then drive the payment from your backend: create the session, open checkout_url, and poll status until the result is final.
All calls are POST to https://api.senjaropay.com. Send Content-Type: application/json, x-api-key, and x-api-secret.
Send x-idempotency-key only on POST /senjaropay/merchant/card/pay. Status does not use it.
Configure redirect URLs
Success, fail, and cancel destinations are set in the merchant portal, not in the pay request body.
- Open the merchant portal.
- Go to Developers.
- Open Redirect URLs.
- Save three public HTTPS URLs on your domain:
After checkout, SenjaroPay redirects the browser to the matching page. Your server should not treat that redirect as the source of truth for fulfillment — confirm with status or a webhook.
How it works
Create the payment
Call POST /senjaropay/merchant/card/pay. Store data.reference and data.checkout_url.
Polling tells your backend how the payment ended. The redirect is SenjaroPay returning the customer to your site.
Authentication
Reuse a key only when retrying the same card payment (same amount, customer, and webhook). A repeated key returns the original result and does not open a second checkout.
Create a card payment
Creates a pending payment and returns checkout_url. Redirect the customer there. Persist data.reference for status checks and webhooks.
The session stops accepting payment at data.expires_at.
Request
Response
data.status is pending until checkout finishes. Do not fulfill on this response.
Request fields
Redirect URLs are not fields on this request. Configure them in the merchant portal.
Check status
Use status as your primary reconciliation path while the customer is on checkout, and whenever a webhook is late, dropped, or fails verification. This call reads the payment. It does not create a charge.
Pass the reference returned by card pay. Authenticate with x-api-key and x-api-secret only.
Request
Response
Poll on a short interval (for example every 3 seconds) until data.status is final or expires_at from the create response has passed. Make fulfillment idempotent on reference so a late webhook and a status check cannot both fulfill the same order.
Errors
Examples on this page are mock values. Keep API keys in server-side secrets.
