Skip to content

AbacatePay NodeJS SDK for you to start receiving payments in seconds

License

Notifications You must be signed in to change notification settings

AbacatePay/abacatepay-nodejs-sdk

Repository files navigation

abacatepay-nodejs-sdk

Official NodeJS SDK for AbacatePay - Accept payments in seconds with a simple integration.

Installation

npm install abacatepay-nodejs-sdk

Quick Start

import AbacatePay from 'abacatepay-nodejs-sdk';

// Initialize the SDK with your API key
const abacate = AbacatePay('your_api_key');

Usage

Creating a Payment

// Create a one-time payment
const billing = await abacate.billing.create({
  frequency: "ONE_TIME",
  methods: ["PIX"],
  products: [
    {
      externalId: "PRO-PLAN",
      name: "Pro plan",
      quantity: 1,
      price: 1000 // Amount in cents
    }
  ],
  returnUrl: "https://yoursite.com/app",
  completionUrl: "https://yoursite.com/pagamento/sucesso",
  customer: {
    email: '[email protected]'
  }
});

Response

{
  _id: 'bill_12345667',
  url: 'https://abacatepay.com/pay/bill_12345667', // Payment URL for your customer
  amount: 1000,
  status: 'PENDING',
  devMode: true,
  methods: ['PIX'],
  frequency: 'ONE_TIME',
  nextBilling: null,
  customer: {
    id: 'cust_12345',
    metadata: {
      email: '[email protected]'
    }
  },
  createdAt: '2024-11-04T18:38:28.573',
  updatedAt: '2024-11-04T18:38:28.573',
}

Payment Methods

Currently supported payment methods:

  • PIX (Instant Brazilian payment system)

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

AbacatePay NodeJS SDK for you to start receiving payments in seconds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published