Quickstart Guide

Get your first payment running in under 10 minutes. This guide walks you through creating an account, getting your API keys, and making your first API call.

All new accounts start in sandbox mode. No real money is moved until you explicitly go live. Use test card 4242 4242 4242 4242 with any future expiry and CVC.

Authentication

Zupay uses API keys to authenticate requests. Your keys carry many privileges, so keep them secure and never expose them in client-side code or public repositories.

All API requests must be made over HTTPS. Requests without authentication will fail with a 401 Unauthorized error.

# Pass your key in the Authorization header
curl https://api.zupay.io/v1/payments \
  -H "Authorization: Bearer zp_live_sk_..." \
  -H "Content-Type: application/json"

Create a Payment

The Payments API is the core of Zupay. A Payment object represents money moving from a customer to your account.

POST/v1/paymentsCreate a new payment
GET/v1/payments/:idRetrieve a payment
GET/v1/paymentsList all payments
POST/v1/payments/:id/captureCapture an authorised payment
DELETE/v1/payments/:idCancel a payment
// Node.js — create a payment
const zupay = require('@zupay/node')('zp_live_sk_...');
 
const payment = await zupay.payments.create({
  amount: 4200,             // in cents
  currency: 'usd',
  payment_method: 'pm_...',
  confirm: true,
  description: 'Order #1042',
  metadata: { order_id: '1042' }
});
 
console.log(payment.id); // py_live_...

SDKs

Official SDKs are available for all major languages and frameworks. All SDKs are open-source on GitHub.

🟨
Node.js
v3.4.1
🐍
Python
v2.8.0
♦️
Ruby
v1.9.2
Java
v2.2.0
🐘
PHP
v2.0.4
🦀
Go
v1.4.0
🔷
Swift
v1.2.1
🤖
Kotlin
v1.1.0

Webhooks

Zupay sends webhook events to notify your application when events happen in your account. Register your endpoint in the Dashboard → Developers → Webhooks.

⚠️Always verify webhook signatures before processing events. Replay attacks can occur if you process unverified payloads.

Key events

  • payment.succeeded — Payment has been captured successfully
  • payment.failed — Payment attempt failed
  • payment.refunded — A refund has been processed
  • subscription.created — A new subscription was started
  • subscription.cancelled — A subscription was cancelled
  • payout.paid — A payout has settled
  • dispute.created — A chargeback has been opened

Need help?

Our developer support team is available 24/7. Join 3,000+ developers in the Zupay Discord community.