ClocknextClocknextHelp
DocumentationAPI ReferenceMCP Tools
Dashboard
What is Clocknext?Getting started

Customers

CustomersCustomer detail

Billing

PurchasesSubscriptionsPackagesInvoicesPaymentsCredit NotesRefunds

Tracking

SignalsRevenue dashboardCustomer Portal

Settings

Profile settingsOrganisation settingsTeam MembersModelsTaxesIntegrationsAPI KeysWebhooks

Documentation

Purchases

Link a Customer to a Plan, then track its billing schedule, Invoices and Payments over time.

A Purchase links a Customer to a Plan and drives its billing. When a Purchase reaches its billing date an Invoice is raised, and each cycle repeats until the Purchase is cancelled. This page lists every Purchase in the workspace and lets owners and admins create and manage them. Purchases — the Purchases table beneath its stat cards, one row per customer-plan subscription with its billing cycle, cost and status. (Authenticated screen — sign in at payments.clocknext.com to view.)

What you can do here

  • Record a Purchase — assign a Plan to a Customer (owners and admins).
  • Change plan — move a Customer to a new Plan. The old Plan ends today and its unused time is credited to the Customer's invoice balance.
  • Pause / enable auto-billing — pausing captures a reason.
  • Delete a Purchase. This removes the record only; any Wallet, Credit or Outcome effects already applied are not reversed.
  • Open a Purchase to see its billing schedule, Invoices and Payments.

On this page

Four stat cards head the page:

CardWhat it shows
Total purchasesCount across the workspace (with active / scheduled / cancelled or a 30-day trend).
ActivePurchases currently billing.
ScheduledPurchases awaiting their first Invoice.
Total valueCombined value of active and scheduled Purchases.

Below the cards, a searchable, paginated table. Search matches Purchase id, Customer or Plan; a Status filter (Scheduled / Active / Cancelled) narrows the rows.

ColumnDescription
PurchaseThe Purchase number (links to the detail view).
CustomerThe subscribed Customer.
PlanThe purchased Plan.
TypeWhat the Plan funds (Wallet, Credit, Outcome, Unit).
CycleBilling cadence (Monthly, Yearly, Free, …).
CostPrice per cycle.
Billing dateThe next (or scheduled) billing date.
CreatedWhen the Purchase was recorded.
StatusScheduled, Active or Cancelled.

Managers also get a per-row ⋯ menu. A Purchase still waiting for its first payment offers View invoice, Change plan and Cancel Purchase. An older Purchase, from before subscriptions ran in periods, that is paid offers Change plan. Once a Purchase is paid and has a subscription, the menu is greyed out: the subscription is what changes plan and is cancelled.

Detail view

Opening a Purchase (/purchases/{id}) shows its full billing picture.

  • Header — the Purchase number, a subtitle reading "Plan plan for Customer" (both linked), a billing-cycle chip, the created date and the status. Changing the plan and cancelling are done on the Customer's subscription, not here.
  • Stat cards — Customer (with the Purchase's status and a link to the Plan), Total billed (billed to date), Paid invoices (with "out of N invoices") and Current subscription: the number of the period running now, with its status, linking to its subscription page. The price per cycle and the renewal countdown are on that page. A Free Plan is a one-time grant with no subscription, so the card reads —.
  • Tabs — Invoices (with per-row PDF, pay and void actions) and Payments. The Payments tab loads on first open.

Creating a Purchase

New Purchase (or Change plan on a Purchase still waiting for its first payment) opens a dialog with a live order summary:

  1. Customer (required) — locked when changing an existing Customer's Plan.
  2. Plan (required) — only active Plans are selectable.
  3. Billing date (required) — the Invoice is generated now; a future date sets when it falls due.
  4. Subscription start date (required) — when the Plan starts and the day each renewal falls on. It defaults to today. It can be earlier in the current month, but not in an earlier month; a date in the past only sets the renewal day. Free Plans have no subscription, so the field is disabled for them.
  5. Notes — an optional reference or PO number.
  6. Auto-billing — off by default. When on, Invoices from the second billing cycle onward are charged automatically against the Customer's saved card. Free Plans raise no Invoices, so the toggle is disabled for them.

The order summary on the right shows the first cycle's charge:

  • Subtotal — the Plan's price, before tax.
  • Tax — the total tax for the Customer's country. Hover the ⓘ to see each tax and its amount. It reads — until a Customer and Plan are picked, and $0.00 when no tax applies.
  • Amount due — what the Customer is billed, with how often it repeats.

Taxes come from Settings → Taxes, based on the Customer's billing country.

Changing a Customer's plan

Change plan moves the Customer to another Plan. It is in the ⋯ menu of an Active or Scheduled row on the Subscriptions page and on a Customer's Subscriptions tab, and it is an icon on a subscription's page. What happens depends on the Customer's current Plan.

A running subscription opens the Change plan dialog:

  1. Pick the new Plan — only other active Plans are listed. Notes is an optional reference.
  2. If the new Plan bills on the same cycle as the current one, choose the Billing cycle: Prorate in the current billing cycle or Start a new billing cycle from today. There is no default: nothing is shown for the Plan, and Change plan now stays disabled, until you choose. Picking another Plan clears the choice.
  3. Read What will happen on the right. It updates as you pick:
    • Current plan — it Ends today.
    • New plan — its price, and the New period when a new one starts.
    • Subtotal and Tax of the new Plan's first Invoice.
    • Credit for unused time and Invoice balance applied — minus lines, shown when the Customer's invoice balance pays that Invoice: the credit for the unused time first, then any balance the Customer already had.
    • Amount due — what is left to pay after the balance has paid its part. A note under it names the whole credit and the part that pays this Invoice, for example "$48.33 credit for unused time: $19.33 is used for this invoice, and $29.00 stays in the customer's invoice balance."
    • First period gets — how many entitlements the new Plan grants. Hover over View to see them. When the first period is prorated the list shows how much of the full amount that is; otherwise the block is called Gets. Credits, units and outcomes show as whole numbers; the exact prorated amount is what is granted.
  4. Press Change plan now.

Billing date and Subscription Start Date are greyed out; they show what the change does. With Prorate in the current billing cycle, both show the day the subscription started, and a note under Notes says so (for a renewed subscription it also says when its current cycle began). With Start a new billing cycle from today, or when the cycle differs, both show the day of the change.

The old Plan ends today, and the money the Customer paid for the rest of its period goes to their invoice balance as a credit note. If both Plans bill on the same cycle, you choose. Prorate in the current billing cycle keeps the renewal date: the new Plan's price and what it grants are for the rest of the period. Start a new billing cycle from today starts a full period today, at the full price and with the full allowance, as a different cycle always does. The credit for the unused time is the same either way. If the cycle differs, a new period starts today at the full price, and a free Plan starts at once; neither has a choice. The new Plan starts when its first Invoice is paid. While the change runs, the Customer shows a banner, and it says so if the change could not be made.

The credit goes to the invoice balance first. When the workspace uses the balance for new Invoices (Settings → Organisation → Payments), the balance pays the new Invoice up to its total (a plan change made through the API only with autoPayment: true). A balance that covers all of it pays it, so Amount due is $0, and what is left stays in the balance. A smaller balance pays its part, and Amount due is the rest. For example, a new Invoice of $499.00 and a credit of $40.77: the balance pays $40.77 and Amount due is $458.23. The Invoice stays open until the rest is paid. When the workspace doesn't use the balance for new Invoices, Amount due is the whole Invoice and the credit stays in the balance.

Packages on a plan change. A One-time Package moves to the new Plan with what is left of it, when the new Plan has each of its entitlements as advance. It starts with the new Plan. Every other Package ends with the old Plan: a Recurring Package, one whose Invoice is not paid, one already marked for cancellation, one whose entitlement the new Plan doesn't have (or meters), and one that was used up. Settings → Billing can end One-time Packages on every plan change instead. The Change plan dialog shows which Packages move and which end, and why.

Change plan on a Scheduled subscription, or on a Purchase that is still waiting for its first payment, opens the Purchase dialog and records another Purchase. Both stay open, and when either is paid the other is cancelled and its unpaid Invoice is voided.

Any other Customer — a FREE Plan, or an older Purchase — gets the usual Purchase dialog: it cancels the current Plan and creates the replacement in one step, with no credit for the old Plan's unused time.

Over the API, use Change a customer's plan to credit the unused time, and Preview a plan change to see what it would do. For a plan on the same billing cycle, send startNewCycle: true to start a new period today; left out, the renewal date stays. Both answers list each Package in packages: CARRIED_OVER, or REMOVED with a reason (RECURRING_PACKAGE, INVOICE_NOT_PAID, MARKED_FOR_CANCELLATION, ORG_SETTING_REMOVES_ONE_TIME_PACKAGES, ENTITLEMENT_NOT_ON_NEW_PLAN with the entitlements in problems, NOTHING_LEFT, or PACKAGE_REMOVED). Get a plan change gives the same list later.

Using your own customer id

When you create a Purchase over the API, you can name its Customer by your own externalId instead of customerId (if both are sent, customerId wins). Listing Purchases still filters by customerId only. See Your own customer ids.

curl -X POST https://payments.clocknext.com/api/v1/purchases \
  -H "Authorization: Bearer $CLOCKNEXT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "externalId": "acme-42", "planId": "plan_growth" }'

Let a Customer buy a Plan (checkout)

To let a Customer pick a Plan in your own app and pay for it themselves, create a checkout and send them to its link. They pay on a secure page with your Stripe or Paddle form, the Plan starts, and they are sent back to your returnUrl.

Nothing changes until they pay. No Purchase is made, and their current Plan keeps renewing if they never do. (Creating a Purchase directly stops the current Plan renewing at once, even before it is paid.)

curl -X POST https://payments.clocknext.com/api/v1/checkout \
  -H "Authorization: Bearer $CLOCKNEXT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "externalId": "acme-42", "planId": "plan_growth", "returnUrl": "https://app.example.com/billing" }'

What the Customer sees depends on the Plan:

PlanWhat happens
Has a priceA payment page. Paying starts the Plan and saves the card for renewals.
$0, bills usageA card-only page (nothing charged). Usage is charged to the card. With Auto close invoices on recurring on, the Plan is switched at once instead.
$0, no usage, or a FREE PlanNo page: the Plan is switched at once (status: SWITCHED).

The link works for 24 hours. A newer link for the same Customer, or any change to their Plan (a new Purchase, cancelling the subscription, archiving the Customer or the Plan), turns it off. To know the Plan was bought, listen for the subscription.activated webhook — not the redirect, which anyone can open. See Create a checkout.

Related

  • Subscriptions — each billing period of a Purchase, with its own page.
  • Invoices — raised as a Purchase is billed.
  • Payments — the resulting settlements.
  • Customers · Customer detail — who the Purchase belongs to.
  • Purchases API — subscribe a Customer to a Plan over the API.
  • Checkout API — a link for a Customer to buy a Plan themselves.

Customer detail

Everything about one Customer in one place — Plan, balances, usage, Invoices, Payments, Members and settings.

Subscriptions

See every billing period of your Customers' Plans, open one to see its Invoices and Payments, change its plan, or cancel it with or without a refund.

On this page

What you can do hereOn this pageDetail viewCreating a PurchaseChanging a Customer's planUsing your own customer idLet a Customer buy a Plan (checkout)Related