LogoLogo
  • General
    • Welcome to 0xpay
    • Transaction Fees
    • Networks & Assets
  • Integration Cookbook
    • Getting Started
      • Merchant Setup
    • Receive assets
    • Send assets
    • Invoices
    • Exchanges
  • Public API
    • Authorization
      • Signature Examples
    • Endpoints
      • Merchant
      • Basic crypto operations
      • Crypto Invoices
      • Basic Fiat Operations
      • Fiat Invoices
      • Exchange
      • Exchange + Withdrawal
    • Notifications
      • Crypto Callbacks
      • Fiat Callbacks
      • Exchange Callbacks
    • JS/TS SDK
      • Getting started
      • Processing WebHook Notifications
      • Reference
  • Legal Info
    • Terms of Service
      • ANNEX 1: RISK DISCLOSURE
      • ANNEX 2: PROHIBITED BUSINESSES
      • ANNEX 3: HIGH-RISK STATES, TERRITORIES AND JURISDICTIONS
    • Privacy Policy
Powered by GitBook
On this page
  • Getting started
  • Prerequisites
  • Installation
  • Create instance
  • Get available crypto assets
  • Create receiving crypto address
  1. Public API
  2. JS/TS SDK

Getting started

Node.js 0xPay integration package

PreviousJS/TS SDKNextProcessing WebHook Notifications

Last updated 2 years ago

To authorize your requests and use SDK you have to obtain .

0xPay SDK allows to integrate and start work with in several moves.

Getting started

Prerequisites

To start using 0xPay SDK you need merchant id and . So you must register an account and to obtain API credentials.

Note: If you want to receive and , you will need to .

Installation

// NPM
npm i @0xpay/sdk
// Yarn
yarn add @0xpay/sdk

Create instance

import { XPay } from '@0xpay/sdk'

const MERCHANT_ID = 'your-merchant-id'
const MERCHANT_PRIVATE_KEY = 'your-merchant-private-key'

// Create XPay instance
const xpay = new XPay(MERCHANT_ID, MERCHANT_PRIVATE_KEY)

Get available crypto assets

import { XPay } from '@0xpay/sdk'

// Create XPay instance
const xpay = new XPay(...)

// Use 0xPay API 
xpay.getAvailableCryptoAssets().then((assets) => console.log(assets))

Create receiving crypto address

import { XPay } from '@0xpay/sdk'

// Create XPay instance
const xpay = new XPay(...)

// Use 0xPay API
xpay.createReceiveAddress({ blockchain: 'BITCOIN', meta: 'user 1' })
    .then((address) => console.log(address))

Merchant Public API
process webhook notifications
private key
private key
create a merchant
setup your merchant