SDKs
JavaScript SDK
Integrate Notch Pay into your JavaScript applications
Notch Pay JavaScript SDK
The Notch Pay JavaScript SDK provides a convenient way to integrate Notch Pay into your JavaScript applications, both on the client-side and server-side with Node.js.
Installation
Client-Side Usage
Initialize the SDK
Open Checkout
Inline Checkout
You can also embed the checkout directly in your page:
Payment Button
Create a payment button with minimal code:
Server-Side Usage (Node.js)
Initialize the SDK
Create a Payment
Retrieve a Payment
List Payments
Create a Transfer
Check Balance
Express.js Integration Example
Here’s a complete example of integrating Notch Pay with an Express.js application:
React Integration Example
Here’s how to integrate Notch Pay with a React application:
API Reference
The JavaScript SDK provides access to all Notch Pay API endpoints:
Payments
notchpay.payments.create(data)
- Create a paymentnotchpay.payments.retrieve(reference)
- Retrieve a paymentnotchpay.payments.list(params)
- List paymentsnotchpay.payments.cancel(reference)
- Cancel a payment
Transfers
notchpay.transfers.create(data)
- Create a transfernotchpay.transfers.retrieve(reference)
- Retrieve a transfernotchpay.transfers.list(params)
- List transfersnotchpay.transfers.cancel(reference)
- Cancel a transfernotchpay.transfers.createBulk(data)
- Create a bulk transfer
Customers
notchpay.customers.create(data)
- Create a customernotchpay.customers.retrieve(id)
- Retrieve a customernotchpay.customers.update(id, data)
- Update a customernotchpay.customers.list(params)
- List customersnotchpay.customers.delete(id)
- Delete a customer
Beneficiaries
notchpay.beneficiaries.create(data)
- Create a beneficiarynotchpay.beneficiaries.retrieve(id)
- Retrieve a beneficiarynotchpay.beneficiaries.update(id, data)
- Update a beneficiarynotchpay.beneficiaries.list(params)
- List beneficiariesnotchpay.beneficiaries.delete(id)
- Delete a beneficiary
Balance
notchpay.balance.retrieve()
- Check balancenotchpay.balance.retrieveCurrency(currency)
- Check balance for a specific currencynotchpay.balance.history(params)
- List balance history
Webhooks
notchpay.webhooks.create(data)
- Create a webhooknotchpay.webhooks.retrieve(id)
- Retrieve a webhooknotchpay.webhooks.update(id, data)
- Update a webhooknotchpay.webhooks.list(params)
- List webhooksnotchpay.webhooks.delete(id)
- Delete a webhook
Error Handling
The SDK throws detailed errors that you can catch and handle:
TypeScript Support
The SDK includes TypeScript definitions for all methods and objects: