PersonalBusinessEnterprise
    In a rush? Schedule an Appointment
    Fetching local time...
    Anytime CapitalforBusiness
    Pricing

    Get started

    • Overview
    • Quickstart
    • Test mode
    • Guides & recipes
    • Switch from Stripe
    • Import from Shopify
    • Import from WooCommerce
    • Import from Square
    • Import a CSV file
    • Stripe API mapping
    • Pricing
    • Support
    • FAQ

    Payments

    • Checkout & website
    • Guide: Next.js checkout
    • In person (QR)
    • Payment methods
    • Stablecoin checkout
    • Guide: take stablecoins
    • Fraud rules & 3D Secure
    • Dispute evidence
    • International customers
    • Guide: safe refunds
    • Bank transfers on invoices

    Billing

    • Subscription discounts
    • Guide: sell subscriptions
    • Usage billing
    • Guide: report usage

    Money movement

    • Payout options
    • Guide: reconcile payouts
    • Accounting sync
    • Revenue analytics

    Developers

    • Authentication
    • Errors & retries
    • Pagination
    • Idempotency
    • Rate limits
    • Webhooks
    • Verify webhooks
    • Node SDK (preview)
    • CLI (preview)
    • Postman collection

    AI

    • AI agents hub
    • Safe AI agents
    • Custom agents
    • Prompt library

    Integrations

    • Website builders
    • Shopify
    • Shopify orders by invoice
    • WooCommerce
    • Zapier
    • Slack, Discord and Teams

    Reference

    • Payments
    • Refunds
    • Disputes
    • Payment links
    • Invoices
    • Customers
    • Products
    • Subscriptions & plans
    • Discount codes
    • Meters & usage events
    • Payouts & balance
    • Webhook endpoints
    • Events
    • Test helpers
    • OpenAPI spec
    • Error codes
    • Changelog
    • Glossary

    For AI tools

    • llms-full.txt
    • MCP server
    • openapi.json
    Docs menu · Node SDK (preview)

    Get started

    • Overview
    • Quickstart
    • Test mode
    • Guides & recipes
    • Switch from Stripe
    • Import from Shopify
    • Import from WooCommerce
    • Import from Square
    • Import a CSV file
    • Stripe API mapping
    • Pricing
    • Support
    • FAQ

    Payments

    • Checkout & website
    • Guide: Next.js checkout
    • In person (QR)
    • Payment methods
    • Stablecoin checkout
    • Guide: take stablecoins
    • Fraud rules & 3D Secure
    • Dispute evidence
    • International customers
    • Guide: safe refunds
    • Bank transfers on invoices

    Billing

    • Subscription discounts
    • Guide: sell subscriptions
    • Usage billing
    • Guide: report usage

    Money movement

    • Payout options
    • Guide: reconcile payouts
    • Accounting sync
    • Revenue analytics

    Developers

    • Authentication
    • Errors & retries
    • Pagination
    • Idempotency
    • Rate limits
    • Webhooks
    • Verify webhooks
    • Node SDK (preview)
    • CLI (preview)
    • Postman collection

    AI

    • AI agents hub
    • Safe AI agents
    • Custom agents
    • Prompt library

    Integrations

    • Website builders
    • Shopify
    • Shopify orders by invoice
    • WooCommerce
    • Zapier
    • Slack, Discord and Teams

    Reference

    • Payments
    • Refunds
    • Disputes
    • Payment links
    • Invoices
    • Customers
    • Products
    • Subscriptions & plans
    • Discount codes
    • Meters & usage events
    • Payouts & balance
    • Webhook endpoints
    • Events
    • Test helpers
    • OpenAPI spec
    • Error codes
    • Changelog
    • Glossary

    For AI tools

    • llms-full.txt
    • MCP server
    • openapi.json
    DocsDevelopersNode SDK (preview)

    Node.js SDK (preview)

    The @anytimecapital/node SDK preview: typed resources, auto-pagination, Idempotency-Key retries, typed errors and webhook verification for Node.js 18+.

    View as MarkdownOpen in Claude

    Not on npm yet

    @anytimecapital/node is a preview: it isn't published, so you can't install it yet. Until it is, call the API with fetch (every reference page shows the Node.js version of each request) or generate a client from the OpenAPI document. This page documents its interface, which the reference's “Node SDK” samples use.

    The SDK wraps the REST API for Node.js 18 and later with no runtime dependencies: a typed client per resource, for await over every page of a list, an Idempotency-Key on every write so its own retries never act twice, typed errors, and webhook signature verification.

    Create a client

    TypeScript
    import { AnytimeCapital } from "@anytimecapital/node";
    
    const client = new AnytimeCapital({
      apiKey: process.env.ANYTIME_API_KEY!, // ak_live_…, on your server only
      maxRetries: 2, // retries after the first attempt, on 429, 5xx and network errors
      timeoutMs: 30_000, // per attempt
      baseUrl: "https://anytime-capital.com/api/v1",
    });
    ResourceMethods
    client.paymentslist, retrieve
    client.refundslist, create, retrieve
    client.paymentLinkslist, create, retrieve, update, deactivate
    client.invoiceslist, create, retrieve, send
    client.customerslist, create, retrieve, update
    client.productslist, create, retrieve, update, archive
    client.subscriptionPlanslist, create, retrieve
    client.subscriptionslist, retrieve, cancel, pause, resume
    client.discountCodeslist, create, retrieve, deactivate
    client.payoutslist, retrieve
    client.balanceretrieve
    client.disputeslist, retrieve
    client.webhookEndpointslist, create, retrieve, update, del
    client.eventslist, retrieve
    client.testHelpers.eventscreate (test keys only: Test helpers)

    Meters and usage events aren't in the SDK yet: send them with fetch as on Meters & usage events.

    Lists and pages

    TypeScript
    // One page…
    const page = await client.payments.list({ status: "paid", limit: 50 });
    
    // …or every payment, each page fetched as you reach it.
    for await (const payment of client.payments.list({ createdFrom: "2026-10-01" })) {
      console.log(payment.id, payment.amountCents, payment.metadata.orderId);
    }
    
    // Or collect them (stops at 10,000 by default).
    const all = await client.refunds.list({ paymentId: "pay_7Hq2LmX9cR4tVb" }).toArray();

    Writes and retries

    Every write sends an Idempotency-Key: yours when you pass one, otherwise one made per call. The SDK retries 429, 5xx and network errors with backoff that honours Retry-After, always with the same key, so a retry never acts twice. Pass your own key, stored with your order, to stay safe across process restarts too.

    TypeScript
    const refund = await client.refunds.create(
      { paymentId: "pay_7Hq2LmX9cR4tVb", amountCents: 2500, reason: "requested_by_customer" },
      { idempotencyKey: `refund-${orderId}` },
    );
    if (refund.status === "pending_approval") {
      // Over your refund approval limit: an owner approves it in the dashboard.
    }

    Errors

    ClassWhen
    InvalidRequestError400 or 422: fix the request; the message names the field.
    AuthenticationError401: missing, unknown or revoked key.
    PermissionError403: PERMISSION_DENIED or NOT_ENROLLED.
    NotFoundError404.
    ConflictError409: the object's state doesn't allow it.
    RateLimitError429, after its retries.
    ApiError5xx, after its retries.
    ConnectionErrorNo answer, after its retries (TIMEOUT or CONNECTION_ERROR).
    SignatureVerificationErrorA webhook that didn't verify.

    All extend AnytimeCapitalError, with code, message, status and retryAfterSeconds. Branch on instanceof or on code; every code is in the error code catalogue.

    Webhooks

    TypeScript
    import express from "express";
    import { AnytimeCapital } from "@anytimecapital/node";
    
    const app = express();
    app.post("/webhooks/anytime", express.raw({ type: "application/json" }), (req, res) => {
      let event;
      try {
        event = AnytimeCapital.webhooks.constructEvent(
          req.body, // the raw Buffer, not parsed JSON
          req.header("Anytime-Signature"),
          process.env.ANYTIME_WEBHOOK_SECRET!,
        );
      } catch {
        return res.sendStatus(400);
      }
      if (event.type === "payment.succeeded") {
        // event.data is the payment: match your order with data.paymentLinkId or data.metadata.
      }
      res.sendStatus(200);
    });

    constructEvent rejects signatures older than 5 minutes ({ toleranceSeconds } changes it), and generateTestHeader(body, secret) signs a body for your own tests. Without the SDK, verify as on Verify webhooks.

    PreviousVerify webhooksNext CLI (preview)

    Anytime Capital is a fintech company, not a bank. Payment processing, banking and payout services are provided by Anytime Capital's licensed partners. Rates shown are for US card payments; international cards, currency conversion and disputes may carry additional fees shown in your dashboard before you accept a payment.

    On this page

    • Create a client
    • Lists and pages
    • Writes and retries
    • Errors
    • Webhooks
    Anytime Capital
    (470) 748-2530
    App Store

    Business

    • Business Checking
    • Business Debit Cards
    • Payments
    • Ecommerce Payments
    • Invoicing
    • Developer Docs

    Solutions

    • CPAs & Accountants
    • Financial Advisors
    • Boat & Auto Dealerships
    • Dental & Medical Practices
    • Creators & Coaches
    • All solutions

    Crypto

    • Crypto Wallet
    • Tether Wallet
    • Buy Digital Assets
    • Explore Markets
    • Security & Licenses
    • Compare Platforms
    • Bitcoin ATM Alternative

    Company

    • Our Story
    • Schedule Appointment
    • Careers
    • Media & Press
    • Investor Relations
    • FAQ

    Branches

    • Atlanta, Georgia
    • Miami, Florida
    • Houston, Texas
    • All branches

    Legal

    • Terms & Conditions
    • Privacy Policy
    • Your Privacy Choices
    • Fraud Notice

    © 2026 Anytime Capital LLC. Anytime Capital is a fintech company, not a bank.

    The Anytime Capital Mastercard® Prepaid Card is issued by Pathward®, N.A., Member FDIC. Mastercard® is a registered trademark of Mastercard International Incorporated. All other trademarks and service marks belong to their respective owners.

    Mastercard