https://github.com/gwop-io/gwop-node
The Node SDK for Gwop Checkout
https://github.com/gwop-io/gwop-node
agentic-ai agentic-commerce-protocol agentic-workflow gwop payments
Last synced: 3 months ago
JSON representation
The Node SDK for Gwop Checkout
- Host: GitHub
- URL: https://github.com/gwop-io/gwop-node
- Owner: gwop-io
- License: mit
- Created: 2026-02-25T13:27:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-02T02:28:50.000Z (3 months ago)
- Last Synced: 2026-03-02T05:38:20.039Z (3 months ago)
- Topics: agentic-ai, agentic-commerce-protocol, agentic-workflow, gwop, payments
- Language: TypeScript
- Homepage: https://gwop.io
- Size: 69.3 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# gwop-checkout
Node SDK for [Gwop Checkout](https://gwop.io) — accept USDC payments from AI agents.
Docs: [docs.gwop.io](https://docs.gwop.io)
## Install
```bash
npm install gwop-checkout
```
```bash
yarn add gwop-checkout
```
```bash
pnpm add gwop-checkout
```
TypeScript types included. Zero runtime dependencies. Node 18+.
## Quick example
```ts
import { GwopCheckout } from 'gwop-checkout';
const gwop = new GwopCheckout({
merchantApiKey: process.env.GWOP_CHECKOUT_API_KEY, // sk_m_...
});
// Create an invoice
const invoice = await gwop.invoices.create(
{
amount_usdc: 5_000_000, // $5.00 USDC
description: 'Pro plan — 1 month',
},
{ idempotencyKey: 'order_abc_v1' },
);
console.log(invoice.id); // 'inv_...'
console.log(invoice.status); // 'OPEN'
```
## Webhooks
Verify signatures and dispatch events when invoices are paid:
```ts
const event = gwop.webhooks.constructEvent(
rawBody, // raw request body
req.header('x-gwop-signature'), // signature header
process.env.GWOP_WEBHOOK_SECRET!, // whsec_...
);
await gwop.webhooks.dispatch(event, {
invoicePaid: async (evt) => {
console.log(`Paid: ${evt.data.invoice_id} on ${evt.data.payment_chain}`);
// Fulfill the order.
},
});
```
## API
| Method | Description |
|--------|-------------|
| `gwop.invoices.create(body, options?)` | Create a USDC invoice |
| `gwop.invoices.retrieve(id)` | Get invoice status (public, no auth) |
| `gwop.invoices.list(params?)` | List your invoices |
| `gwop.invoices.cancel(id)` | Cancel an open invoice |
| `gwop.invoices.waitForStatus(id, status, options?)` | Poll until status reached |
| `gwop.webhooks.constructEvent(payload, sig, secret)` | Verify webhook signature |
| `gwop.webhooks.dispatch(event, handlers)` | Route event to typed handlers |
## Links
- [Documentation](https://docs.gwop.io)
- [Merchant Dashboard](https://merchant.gwop.io)
- [Example server](./examples/merchant-basic)
- [npm](https://www.npmjs.com/package/gwop-checkout)
## License
[MIT](./LICENSE)