# @bigcommerce/bigpay-client

> JavaScript client for BigPay

Latest version **5.31.0** (published 2026-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bigcommerce/bigpay-client
pnpm add @bigcommerce/bigpay-client
yarn add @bigcommerce/bigpay-client
bun add @bigcommerce/bigpay-client
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 5.31.0 |
| Published | 2026-08-04 |
| First published | 2018-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 308.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | BigCommerce |
| Maintainers | bcnpmuser, chanceaclark, jairobc, jmwiese, jorgemoya, cilo, toma-r, davidchin |

## Links

- npm: https://www.npmjs.com/package/@bigcommerce/bigpay-client
- Repository: https://github.com/bigcommerce/bigpay-client-js
- Homepage: https://github.com/bigcommerce/bigpay-client-js#readme
- Issues: https://github.com/bigcommerce/bigpay-client-js/issues
- npm.io page: https://npm.io/package/@bigcommerce/bigpay-client

## Dependencies (4)

- [babel-jest](https://npm.io/package/babel-jest.md) ^30.0.0
- [deep-assign](https://npm.io/package/deep-assign.md) ^3.0.0
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1
- [@bigcommerce/form-poster](https://npm.io/package/@bigcommerce/form-poster.md) ^1.4.2

## Recent versions

- 5.31.0 (latest) — 2026-08-04
- 5.29.0 — 2026-08-04
- 5.28.1 — 2025-06-19
- 5.28.0 — 2025-05-09
- 5.27.6 — 2025-05-01
- 5.27.5 — 2024-04-19
- 5.27.4 — 2024-02-29
- 5.27.3 — 2024-01-24
- 5.27.2 — 2024-01-23
- 5.27.1 — 2024-01-16
- 5.27.0 — 2024-01-10
- 5.26.2 — 2024-01-02
- 5.26.1 — 2023-12-14
- 5.26.0 — 2023-08-07
- 5.25.1 — 2023-07-20
- … 57 more at https://npm.io/package/@bigcommerce/bigpay-client/versions

## README

# bigpay-client.js

[![Build Status](https://circleci.com/gh/bigcommerce/bigpay-client-js.svg?style=svg)](https://circleci.com/gh/bigcommerce/bigpay-client-js)

bigpay-client.js is a client-side library for posting payment data to BigPay.

## Usage

In `checkout.js`
```js
import { createClient } from 'bigpay-client';
import { getPaymentData } from './payment';

const client = createClient({
    host: 'https://payments.bigcommerce.com',
});

const data = getPaymentData();

client.submitPayment(data, (error, response) => {
    if (error) {
        throw error;
    }

    console.log(response);
});
```

In `payment.js`
```js
export default function getPaymentData() {
    return {
        authToken: 'aaa.bbb.ccc',
        billingAddress: {
            addressLine1: '1-3 Smail St',
            addressLine2: 'Ultimo',
            city: 'Sydney',
            company: 'BigCommerce',
            country: 'Australia',
            countryCode: 'AU',
            firstName: 'Foo',
            lastName: 'Bar',
            phone: '98765432',
            postCode: '2007',
            provinceCode: 'NSW',
            province: 'New South Wales',
        },
        cart: {
            currency: 'AUD',
            grandTotal: {
                integerAmount: 12000,
            },
            handling: {
                integerAmount: 0,
            },
            shipping: {
                integerAmount: 1000,
            },
            subtotal: {
                integerAmount: 10000,
            },
            taxTotal: {
                integerAmount: 1000,
            },
            items: [
                {
                    id: '123',
                    integerAmount: 10000,
                    integerAmountAfterDiscount: 10000,
                    integerDiscount: 0,
                    integerTax: 1000,
                    integerUnitPrice: 10000,
                    integerUnitPriceAfterDiscount: 10000,
                    name: 'Cheese',
                    quantity: 1,
                    sku: '123456789',
                    type: 'ItemPhysicalEntity',
                },
            ],
        },
        customer: {
            customerId: '123',
            email: 'email@bigcommerce.com',
            firstName: 'Foo',
            lastName: 'Bar',
            name: 'Foo Bar',
            phoneNumber: '98765432',
        },
        order: {
            currency: 'AUD',
            grandTotal: {
                integerAmount: 12000,
            },
            handling: {
                integerAmount: 0,
            },
            orderId: '123',
            shipping: {
                integerAmount: 1000,
            },
            subtotal: {
                integerAmount: 10000,
            },
            taxTotal: {
                integerAmount: 1000,
            },
            token: 'abc123',
        },
        payment: {
            ccCvv: '123',
            ccExpiry: {
                month: 1,
                year: 2018,
            },
            ccName: 'Foo Bar',
            ccNumber: '4007000000027',
            ccCustomerCode: 'XYZ',
        },
        paymentMethod: {
            id: 'paypalprous',
            type: 'PAYMENT_TYPE_API',
        },
        quoteMeta: {
            request: {
                deviceSessionId: 'xyz123',
                geoCountryCode: 'AU',
                sessionHash: 'abc123',
            },
        },
        shippingAddress: {
            addressLine1: '685 Market St',
            addressLine2: 'Third Floor',
            city: 'San Francisco',
            company: 'BigCommerce',
            country: 'United States',
            countryCode: 'US',
            firstName: 'Joe',
            lastName: 'Bar',
            phone: '98765432',
            postCode: '94105',
            provinceCode: 'CA',
            province: 'California',
        },
        source: 'bcapp-checkout-uco',
        store: {
            cartLink: '/cart',
            checkoutLink: '/checkout',
            countryCode: 'AU',
            currencyCode: 'AUD',
            orderConfirmationLink: '/order-confirmation',
            shopPath: '/',
            storeHash: 's123456789',
            storeId: '100',
            storeLanguage: 'en-AU',
            storeName: 'Test Store',
        },
    };
}
```

## Development

```sh
npm install
```

Link with other projects:

Inside `bigpay-client-js`

```sh
npm link
npm build -- --watch
```

Other project(s):

```sh
npm link @bigcommerce/bigpay-client
npm run dev
```

To run unit tests:

```sh
npm test
```

To release a new version:

```sh
npm run release
```

---
_Source: https://npm.io/package/@bigcommerce/bigpay-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
