Skip to content

A Node.js library for interacting with the Bold API, providing seamless integration to manage payments, customers, and transactions efficiently.

License

Notifications You must be signed in to change notification settings

boterop/bold-api-sdk

Repository files navigation

Coverage Status NPM Type Definitions

bold-api-sdk

A Node.js library for interacting with the Bold API, providing seamless integration to manage payments, customers, and transactions efficiently.

Installation

npm install bold-api-sdk

Usage

Create api key

Payment Link

Get

import { paymentLink } from 'bold-api-sdk';

const response = await paymentLink.get('bold-identity-key', 'LNK_EX95SG8SZT');

console.log(response);

Response

{
  "id": "LNK_EX95SG8SZT",
  "total": 0,
  "status": "ACTIVE",
  "expiration_date": 1736984191779000000,
  "description": null,
  "api_version": 1,
  "subtotal": 0,
  "tip_amount": 0,
  "taxes": [],
  "creation_date": 1736982392918743600,
  "payment_method": null,
  "transaction_id": null,
  "amount_type": "OPEN",
  "is_sandbox": true,
  "callback_url": null
}

Create

import { paymentLink } from 'bold-api-sdk';

const response = await paymentLink.create('bold-identity-key', {
  amountType: 'CLOSE',
  description: 'Payment for order order-id',
  payerEmail: '[email protected]',
  amount: 300,
  tipAmount: 0,
  currency: 'USD',
  callbackUrl: 'https://example.org/return',
  expirationMinutes: 30,
  iva: 19,
});

console.log(response);

or

import { paymentLink } from 'bold-api-sdk';

const response = await paymentLink.create('bold-identity-key', {
  amountType: 'OPEN',
  description: 'Payment for order order-id',
  payerEmail: '[email protected]',
  callbackUrl: 'https://example.org/return',
  expirationMinutes: 30,
});

console.log(response);

Response

{
  "payload": {
    "payment_link": "LNK_EX95SG8SZT",
    "url": "https://checkout.bold.co/payment/LNK_EX95SG8SZT"
  },
  "errors": []
}

Payment Methods

import { paymentMethods } from 'bold-api-sdk';

const response = await paymentMethods.list('bold-identity-key');

console.log(response);

Response

{
  "payload": {
    "payment_methods": {
      "CREDIT_CARD": {
        "max": 10000000,
        "min": 1000
      },
      "PSE": {
        "max": 10000000,
        "min": 1000
      },
      "BOTON_BANCOLOMBIA": {
        "max": 10000000,
        "min": 1000
      },
      "NEQUI": {
        "max": 10000000,
        "min": 1000
      }
    }
  },
  "errors": []
}

About

A Node.js library for interacting with the Bold API, providing seamless integration to manage payments, customers, and transactions efficiently.

Resources

License

Stars

Watchers

Forks