1 / 2

Developer Center

Integrate with NineLogix

Start in Test. Approved Live API access creates hosted Checkout for one-time Prices; it does not charge the buyer. Use published subscription Checkout only where your Store is approved. Hosted/manual delivery does not require an API integration.

Developer preparation and environments

  • The developer workspace shows the Store, environment and approved scopes. Configure only the integration your delivery method needs.
  • API keys and signing secrets are shown once; retain them in server-side secret management. Never put them in client code, public logs, screenshots or support messages.
  • Test keys start nlx_test_; approved Live keys start nlx_live_. The credential selects the environment; request fields cannot switch it.
  • Test and Live use separate keys, webhook secrets and records. A shared receiver URL must verify the correct configured secret and environment.
  • Live access remains Store-specific. A key or successful Test transport check does not grant every payment method or prove formal launch approval.

Payment API

  • Base URL: https://www.ninelogix.com/api/v1; Authorization: Bearer nlx_test_... for Test.
  • POST /checkout-sessions accepts order_id and price_id. order_id is YOUR stable merchant reference (1-64 safe ASCII characters); price_id is the approved NineLogix Price. Store scope comes from the credential.
  • Idempotency-Key is a required header (1-128 safe ASCII characters). Reuse the same order_id, price_id and key after a timeout; changing the request under the same key returns 409.
  • Do not send amount_minor, currency, product_name, store_id, environment or payment-method overrides. Amount, currency and available methods are resolved server-side.
  • Test creates a simulated session. Approved Live credentials create a hosted purchase intent for one-time Prices only, with an active Live order.paid receiver. Creating the link does not charge the buyer.
  • GET /checkout-sessions/{session_id} returns this credential's Store/environment-scoped session. Save data.id, data.order_id, data.price_id and request_id. This is not a generic Order or Subscription query API.
  • Creation returns HTTP 201 with {ok, request_id, data}; a same-request replay returns the same session. Never reconstruct checkout_url or switch methods on an unknown payment.
  • Common errors: 400 invalid fields; 401 credential; 403 scope/access; 404 unavailable object; 409 state or idempotency conflict; 429 rate limit. Retain request_id for support.
curl https://www.ninelogix.com/api/v1/checkout-sessions \
  -H "Authorization: Bearer nlx_test_REPLACE" \
  -H "Idempotency-Key: order-demo-001" \
  -H "Content-Type: application/json" \
  -d '{"order_id":"demo-001","price_id":"prc_APPROVED"}'

Webhooks and signature verification

  • Use an HTTPS receiver. Read the exact raw request bytes before any JSON middleware; re-serializing JSON changes the signature.
  • Read X-NineLogix-Timestamp (Unix seconds), X-NineLogix-Signature (v1= followed by lowercase hex), and X-NineLogix-Event-Id. Compute HMAC-SHA256(secret, timestamp + "." + raw body); compare equal-length digest bytes in constant time. Reject timestamps more than 300 seconds in the past OR future.
  • The JSON envelope identifier is id, not event_id. After signature verification, require envelope id to match X-NineLogix-Event-Id; validate environment and livemode against your configured receiver. The header timestamp is the delivery time; created is the event time and can be older on replay.
  • Deduplicate durably by Store, environment and event id. Atomically record acceptance plus queued work before returning 2xx; acknowledge already accepted duplicates without repeating effects. Process each paid order or invoice once. For fixed delivery subscriptions, provision the units on the first payment and extend those units on renewal.
  • HTTP 2xx means transport accepted only. It does not prove signature checks, order matching, business processing or actual delivery. Do not use response-body wording as a success protocol. Return non-2xx when the event cannot be safely accepted.
  • For order.paid, match merchant_reference, Store, Product, Price, amount_minor and currency to your local pending order. In Live API flows, the submitted order_id becomes merchant_reference; the event order_id is the NineLogix Order ID. Save both.
  • The payment event merchant_id identifies the merchant organization; the Developer workspace Integration ID identifies an API integration and may differ. Confirm the organization identity for your Store. Do not substitute an integration ID or copy an illustrative ID into your checks.
  • checkout.session.completed reports session state, not a second entitlement instruction. Completing a new purchase-linked Test Checkout emits the corresponding order.paid; a subscription also emits subscription.active. Verify the matching order.paid and grant only once. Legacy Test sessions without verifiable purchase facts and generic transport probes are not full fulfillment tests.
  • Delivery uses a five-second timeout and at most eight scheduled attempts. Duplicates, delays and out-of-order arrival are possible. Authorized replay retains the event id/body with a fresh delivery timestamp/signature; it never creates or retries a charge.
  • Use the Developer Center for a runnable Node.js signature verifier, envelope example and the event reference.

Node.js raw-body signature verifier

import { createHmac, timingSafeEqual } from "node:crypto";

// headers: Web Headers; rawBody: Buffer read BEFORE JSON parsing.
// secret and expectedEnvironment come from your server configuration.
export function verifyNineLogixWebhook(
  rawBody, headers, secret, expectedEnvironment,
  nowSeconds = Math.floor(Date.now() / 1000)
) {
  const timestamp = headers.get("x-ninelogix-timestamp") ?? "";
  const signature = headers.get("x-ninelogix-signature") ?? "";
  const headerId = headers.get("x-ninelogix-event-id");
  if (!["test", "live"].includes(expectedEnvironment) ||
      !Buffer.isBuffer(rawBody) || !secret ||
      !/^\d{1,12}$/.test(timestamp) ||
      Math.abs(nowSeconds - Number(timestamp)) > 300 ||
      !/^v1=[0-9a-f]{64}$/.test(signature)) {
    throw new Error("Invalid webhook headers");
  }
  const expected = createHmac("sha256", secret)
    .update(timestamp + ".").update(rawBody).digest();
  const received = Buffer.from(signature.slice(3), "hex");
  if (received.length !== expected.length ||
      !timingSafeEqual(received, expected)) {
    throw new Error("Invalid webhook signature");
  }
  const event = JSON.parse(rawBody.toString("utf8"));
  // Some legacy Test transport probes omit environment, not livemode.
  if (!event || typeof event.id !== "string" || !event.id ||
      event.id !== headerId || typeof event.type !== "string" ||
      event.livemode !== (expectedEnvironment === "live") ||
      (event.environment !== expectedEnvironment &&
       !(expectedEnvironment === "test" &&
         event.environment === undefined))) {
    throw new Error("Webhook identity or environment mismatch");
  }
  return event;
}

// Signature verification is not fulfillment.
// Validate the event's business fields against your local pending order.
// Atomically persist (Store, environment, event.id) and enqueue work.
// Only then return 2xx; duplicates already durably accepted return 2xx.
// A durable worker grants once per order_id (or paid invoice_id),
// with a unique business key and transactional/outbox protection.

Illustrative identifiers only: match your own Test purchase and merchant organization. New purchase-linked Test Checkout emits order.paid; legacy sessions and generic transport probes are not complete business tests. Verify actual Test fulfillment separately. The verifier covers transport identity, not business validation or durable processing.

Synthetic order.paid envelope

{
  "id": "evt_test_example",
  "type": "order.paid",
  "created": 1793070000,
  "environment": "test",
  "livemode": false,
  "data": {
    "object": {
      "id": "ord_test_example",
      "object": "order",
      "environment": "test",
      "livemode": false,
      "status": "paid",
      "order_id": "ord_test_example",
      "merchant_id": "mer_example",
      "store_id": "sto_example",
      "merchant_reference": "demo-001",
      "product_id": "prd_example",
      "price_id": "prc_APPROVED",
      "amount_minor": 1000,
      "currency": "USD",
      "payment_method": "test",
      "paid_at": "2026-10-27T03:00:00.000Z",
      "test": true
    }
  }
}

Integration testing

  • Use synthetic Test data, never a real customer payment as an integration prerequisite. Hosted/manual delivery needs a clear sales entry and a practical manual delivery check, not forced API work.
  • In Merchant Portal > Checkout & API, select the intended Store and use its Test Webhook. Enter your own Test order reference, choose an approved one-time, monthly or yearly Price, create the Test link and complete Checkout. An API Test order_id is your merchant_reference. Old Hosted system-generated TEST numbers are not merchant references; create a new purchase instead of inventing a mapping.
  • Check delivery history for the initial purchase events. In Test events for a purchase, select that exact reference, Price and session for further subscription scenarios: renewal success, renewal failure, scheduled cancellation and end. Failed renewal preserves the previous paid period; scheduled cancellation is not a refund. A completed one-time Test purchase offers Full refund failed and Full refund succeeded using one operation ID and sending refund events only. Check failure then success, late failure and Replay without a second reversal. Partial and subscription refunds are not simulated; the current execution path supports full refunds only. Subscription recovery after failed renewal remains excluded.
  • Repeated simulation reuses events and may make a first delivery where none exists; it does not replay existing attempts. Use Replay on the latest completed Test delivery to verify a duplicate or retry. There are at most eight attempts per event/endpoint. A stale, concurrent or unconfirmed attempt requires inspection and reconciliation, not repeated clicking or a replacement purchase.
  • For API/automatic delivery, map a local Test customer/order to the correct reference and approved Price. Exercise successful, cancelled, expired and unknown-state UX.
  • Prove a valid signature is accepted; tampered body, wrong secret, malformed signature, stale/future timestamp and wrong environment are rejected without fulfillment.
  • Deliver the SAME event twice and prove exactly one entitlement. Also test a repeated order/invoice business key and recovery after an interrupted worker.
  • Repeat creation with the same Idempotency-Key and confirm the same session. Match amount/currency/Price/order before granting Test access.
  • Provide environment, order/reference/event IDs, UTC time, expected/actual result and redacted evidence of the actual Test entitlement. A 200 response with processing disabled is not complete integration evidence.

Verification and launch

  • Reuse approved catalog, support and refund policies; do not resubmit the same facts. Confirm the actual website URL or sales channel where the Checkout is used, plus the agreed manual or automated delivery method.
  • For automatic/API delivery, provide non-funds Test evidence of order correlation, invalid-signature rejection, duplicate-event handling and actual Test fulfillment.
  • A published Checkout is platform preparation, not proof of merchant-side installation. Merchant integration readiness is not formal launch approval.
  • NineLogix retains formal activation authority. The first natural live order is observed after launch; an extra real pre-launch purchase is not mandatory.
  • Payment methods, currencies, markets and fixed monthly/yearly subscription availability are confirmed for each Store. A capability available elsewhere does not enable it for your Store.
  • Launch handoff: reuse the published Product/Price, currency, billing period and agreed entitlement, then identify the actual buying location, account/order mapping and each side’s next step. You may start with a few representative Prices without removing other tiers. Record checks per Price and mode; one result does not cover the rest. Use Test first where available, or observe the first natural order after launch; no new timing choice or real payment is required. Label Test, controlled real payments and natural sales separately. Missing Test capability is for NineLogix to resolve, not an unfinished merchant action.

Event handling and operations

  • Track payment, delivery, reconciliation, settlement and payout separately. A paid Order is not delivered merely because a webhook returned 2xx.
  • For timeout, pending, unknown or expired sessions, retain the identifiers and check authoritative state before another attempt. Never blindly charge again or infer no payment from expiry.
  • refund.succeeded and refund.failed describe a refund result, not a new payment. On success, reverse only the entitlement linked to the referenced order/invoice under your agreed policy, once; a failed refund does not establish a reversal.
  • For fixed delivery subscriptions, grant once per subscription_id on the initial signed order.paid. A paid renewal extends the same units to period_end. Apply each invoice_id once. Keep subscription_id, invoice_id, order_id, merchant_reference and UTC period_start/period_end (end exclusive).
  • subscription.active, subscription.updated and subscription.ended are state events, not credit grants. A scheduled end-of-period cancellation preserves the paid period; cancellation is not a refund. A later failed renewal must not revoke a previously paid period.
  • Refunds, cancellations, disputes, settlement and payout use the separately available operations/support process; the two Checkout API endpoints do not grant write access to them.
  • For support send Store/environment, request_id, event id, order/reference/session IDs, time and a safe error code or redacted screenshot. Never send secrets, raw headers, tokens or customer data.

Developer guide to fulfillment

When creating Checkout, use the approved price_id. quantity is the number of packs and defaults to 1. For a retry, keep order_id, price_id, quantity and Idempotency-Key identical to the original request.

Verify the raw order.paid request and read entitlement_label and total_licenses from data.object.license_purchase. Older packs use entitlement_type. Fulfill a one-time order once. For subscriptions, provision once per subscription_id on billing_reason=subscription_initial. A paid subscription_cycle invoice extends existing access to period_end; deduplicate by invoice_id. Failure, replay and the browser return do not grant units.

How to handle access on renewalNineLogix product update: Buy team seats or activation codes in one checkout