ProtectedaccountProtected OptionalappProtectedcurrentProtectedenvironmentProtectedenvironmentProtectedheliconeProtectednvmProtectedreturnProtectedschemeProtected OptionalversionBackend API version (MAJOR.MINOR) pinned by this instance, set from
options.version. When unset, every request defaults to
LOCKED_API_VERSION.
Creates an Order and its PaymentIntent, returning the clientSecret a
browser confirms against (POST /api/v1/orders).
The new Order id, its status and — while payable — the clientSecret.
This method is oriented to merchants. The NVM API Key must be scoped to an active organization whose Stripe Connect account can receive card payments.
CreateOrderOptions. currency defaults to 'usd'.
PaymentsError carrying the backend catalogue code: BCK.ORDER.0001
(invalid request), BCK.ORDER.0003 (not an active organization / over the
per-order cap), BCK.ORDER.0007 (idempotency-key conflict),
BCK.ORDER.0010 (velocity cap — retryable), BCK.ORDER.0004/0005
(Connect account / PaymentIntent failure, no money moved). A refusal
without a catalogue code (e.g. a gateway or throttle response) carries
http_<status> instead.
It returns the account address associated with the NVM API Key used to initialize the Payments Library instance.
The account address extracted from the NVM API Key
ProtectedgetInternalReturns the HTTP options required to query the backend.
HTTP method.
Optionalbody: anyOptional request body.
OptionalextraHeaders: Record<string, string>Optional per-call header overrides. Use
{ 'X-Current-Org-Id': orgId } to target a specific workspace for
one call without mutating the instance-level pin.
HTTP options object.
Returns the environment name used to initialize the Payments instance.
The environment name (e.g. 'sandbox', 'live')
Reads the buyer-safe view of an Order by id (GET /api/v1/orders/:id).
The unguessable Order id returned by createOrder.
The endpoint is anonymous — the unguessable id is the sole access control —
so this call sends no API key (the Payments instance still needs one to
be constructed). The response never includes the merchant identity or the
fee, and carries clientSecret only while the Order is payable.
PaymentsError with code BCK.ORDER.0002 when no Order has this id.
The read endpoint is rate-limited — all anonymous callers behind one IP
share a bucket of 60 requests per minute — and a throttled call carries
no catalogue code, so it surfaces as code http_429. That is distinct
from the create-side velocity cap BCK.ORDER.0010; poll sparingly and
back off on http_429.
Returns the current organization context applied to every authenticated
backend request via the X-Current-Org-Id header.
null means "no pinned workspace" — the backend falls back to the
caller's API-key tag or most-recent active membership.
ProtectedgetInternalGet HTTP options for public backend requests (no authorization header). Converts body keys from snake_case to camelCase for consistency.
HTTP method
Optionalbody: anyOptional request body (keys will be converted to camelCase)
HTTP options object
ProtectedparseSets the organization context applied to every subsequent authenticated
backend request via the X-Current-Org-Id header.
Pass null to clear the pin and fall back to the backend default.
Org ID (e.g. org-…) or null to clear.
Staticget
The OrdersAPI class wraps the browser-fiat Orders endpoints. An Order is a merchant-initiated, off-plan charge for an arbitrary amount (the Stripe PaymentIntent analog) that the buyer's browser confirms client-side — no plan, no buyer Nevermined account, no delegation.
Remarks
createOrderrequires an organization-scoped NVM API key: the API reads the merchant organization from the key's own org tag, so a personal key is refused withBCK.ORDER.0003.Payments.setOrganizationId(theX-Current-Org-Idheader) does not substitute for an org-scoped key.This client is the merchant's: a
Paymentsinstance is always constructed with an NVM API key. The buyer never needs one — the buyer's browser confirms theclientSecretwith Stripe.js and can pollGET /api/v1/orders/:iddirectly, which is why OrdersAPI.getOrder sends no key on that call.See
nvm-monorepo
apps/api/src/orders/README.md(epic #3238)