Developers
Build on the grid.
Everything you need to take your first payment, wire up webhooks and ship rules from code. Most teams process a test payment in under ten minutes.
01 / Quickstart
Your first payment in three moves.
Everything below runs against the sandbox, so nothing real is charged while you build.
- 01
Install the SDK
Add the official library to your project. Every SDK is typed and generated from the same spec as the API.
terminalnpm install @nyoripay/node - 02
Create a payment
Use your sandbox secret key on the server. Pass an idempotency key so retries can never charge twice.
create-payment.jsimport NyoriPay from '@nyoripay/node'const nyori = new NyoriPay(process.env.NYORI_SECRET_KEY)const payment = await nyori.payments.create({ amount: 4200, currency: 'eur', customer: 'cus_8fK2nQ', payment_method: 'pm_card_visa', routing: { strategy: 'adaptive' }}, { idempotencyKey: 'order_1042'})console.log(payment.status) // 'succeeded' - 03
Listen for events
Verify the signature on every webhook, answer with a 200, then fulfill the order in the background.
webhooks.jsapp.post('/webhooks/nyoripay', express.raw({ type: 'application/json' }), (req, res) => { const event = nyori.webhooks.verify( req.body, req.headers['nyori-signature'], process.env.NYORI_WEBHOOK_SECRET ) if (event.type === 'payment.succeeded') { fulfillOrder(event.data.object) } res.sendStatus(200)})
02 / SDKs
Your language. Our types.
Six official libraries, versioned together and generated from the same spec as the API, so a new feature lands everywhere on the same day.
Node.js
v4.2npm install @nyoripay/nodePython
v4.1pip install nyoripayGo
v4.2go get github.com/nyoripay/nyoripay-go/v4Ruby
v4.0gem install nyoripayPHP
v4.1composer require nyoripay/nyoripay-phpJava
v4.2implementation "com.nyoripay:nyoripay-java:4.2.0"
03 / API reference
Predictable by design.
Resource-oriented URLs, JSON everywhere and standard HTTP status codes. Authenticate with your secret key and you are in.
Base URL
https://api.nyoripay.com
Current version
2026-11-01
Payments
Charge a card, wallet or bank account.
- POST
/v1/paymentsCreate a payment - GET
/v1/payments/:idRetrieve a payment - POST
/v1/payments/:id/captureCapture an authorized payment - POST
/v1/payments/:id/cancelCancel before capture
- POST
Checkout sessions
Hosted and embedded checkout flows.
- POST
/v1/checkout/sessionsCreate a session - GET
/v1/checkout/sessions/:idRetrieve a session - POST
/v1/checkout/sessions/:id/expireExpire a session
- POST
Customers
Store buyers and their saved payment methods.
- POST
/v1/customersCreate a customer - PATCH
/v1/customers/:idUpdate a customer - DELETE
/v1/customers/:idDelete a customer
- POST
Refunds
Return money in full or in part.
- POST
/v1/refundsCreate a refund - GET
/v1/refunds/:idRetrieve a refund
- POST
Webhook endpoints
Where and which events get delivered.
- POST
/v1/webhook_endpointsRegister an endpoint - GET
/v1/webhook_endpointsList endpoints - POST
/v1/events/:id/replayReplay an event
- POST
Rules
Program fraud, routing and approval logic.
- POST
/v1/rulesCreate a rule - PATCH
/v1/rules/:idUpdate a rule - POST
/v1/rules/:id/simulateSimulate against past traffic - POST
/v1/rules/:id/publishPublish a rule
- POST
04 / Webhook events
Every state change, on the wire.
Subscribe each endpoint to exactly the events it needs. These are the ones most integrations start with.
| Event | Fires when |
|---|---|
| payment.succeeded | A payment was authorized and captured. |
| payment.failed | A payment attempt was declined or errored. Includes the decline code. |
| payment.requires_action | The buyer has to complete a 3DS challenge or a redirect. |
| checkout.session.completed | A buyer finished a hosted or embedded checkout. |
| refund.created | A full or partial refund was issued. |
| dispute.opened | A cardholder disputed a payment. The evidence due date is included. |
| rule.triggered | A Smart Rule matched a payment and took its action. |
| routing.failover | Smart Payments moved traffic away from a degraded processor. |
| payout.paid | Funds landed in your bank account. |
05 / Sandbox
Break things safely.
The sandbox mirrors production, including declines, disputes and 3DS challenges. Use any future expiry date and any three-digit security code.
Two sets of keys
Test keys start with nyp_test_ and live keys with nyp_live_. Same endpoints, same code.
Free and unlimited
Run as many test payments, refunds and webhook deliveries as you like. Nothing in the sandbox is ever billed.
| Card number | Brand | Result |
|---|---|---|
| 4111 1111 1111 1111 | Visa | Payment succeeds |
| 5555 5555 5555 4444 | Mastercard | Payment succeeds |
| 4000 0000 0000 3220 | Visa | Requires a 3DS challenge |
| 4000 0000 0000 9995 | Visa | Declined for insufficient funds |
| 4000 0000 0000 0002 | Visa | Declined by the issuer |
Jack in
Keys in hand, code in flight.
Request sandbox access and start building against the real API today. Questions about your integration? Our engineers answer those too.