Private partner API

Partner API
for code retail.

Quote, order and receive Nintendo eShop codes programmatically against your USD balance. One REST interface for stores, marketplaces, bots and back-office panels.

Interface
REST over HTTPS, JSON only
Balance
USD, minor units as strings
Entry
USD 2,500.00 minimum
Delivery
Polling; no webhooks

Access is invited,
billing is a balance.

API access uses the existing private partner account. There is no public sign-up, and the entry amount is not a fee: it is credited to the same USD balance that pays for orders.

  1. Open the partner account.Approved partners receive an invitation-only account with a USD balance. Public registration stays disabled.
  2. Add the entry balance.Verified paid top-ups totaling at least USD 2,500.00 qualify the account. The full amount is credited to the balance and remains spendable on orders.
  3. Wait for activation.API access is activated after the entry top-ups are verified. It is not switched on automatically by a payment.
  4. Create keys in the dashboard.After activation, the Partner API section of the account issues live and test keys. Each token is shown once and can be revoked at any time.

What the entry does not change

The threshold is one-time. If the balance later falls below USD 2,500.00, the API stays active; ordering simply requires enough available balance for the next quote.

There is no separate API subscription, per-call fee or minimum order in the API itself. Commercial terms beyond the entry follow the partner agreement.

Access can be suspended or keys revoked under that agreement. A suspended account receives 403 access_inactive on every authenticated call.

First order
in six calls.

Sandbox uses the same endpoints as production. A test key reads a fixed synthetic catalog, starts with USD 10,000.00 and never touches real money, supplier stock or live codes.

  1. 1. Create a test key

    In the partner dashboard, open Partner API and create a key in test mode. Copy the token immediately; it is displayed once.

    Shell
    export NCS_KEY='ncs_pk_<16 hex key id>_<64 hex secret>'
  2. 2. Confirm the key and mode

    Shell
    curl -s https://nintendocards.supply/api/partner/v1/account \
      -H "Authorization: Bearer $NCS_KEY"
  3. 3. Read the catalog

    Shell
    curl -s https://nintendocards.supply/api/partner/v1/catalog \
      -H "Authorization: Bearer $NCS_KEY"

    Use a product id from the response, not the SKU, when quoting.

  4. 4. Create a quote

    Shell
    curl -s https://nintendocards.supply/api/partner/v1/quotes \
      -H "Authorization: Bearer $NCS_KEY" \
      -H "Content-Type: application/json" \
      -d '{"items":[{"product_id":"<product id>","quantity":2}]}'

    A quote fixes the unit prices and expires at expires_at. A quote does not reserve stock or charge balance.

  5. 5. Create the order

    Shell
    curl -s https://nintendocards.supply/api/partner/v1/orders \
      -H "Authorization: Bearer $NCS_KEY" \
      -H "Content-Type: application/json" \
      -d '{"quote_id":"<quote id>","operation_key":"<new UUIDv4>"}'

    operation_key is your idempotency key. Generate it once per logical purchase and reuse it on every retry.

  6. 6. Poll, then read codes

    Shell
    curl -s https://nintendocards.supply/api/partner/v1/orders/<order id> \
      -H "Authorization: Bearer $NCS_KEY"
    
    curl -s https://nintendocards.supply/api/partner/v1/orders/<order id>/items/<item id>/codes \
      -H "Authorization: Bearer $NCS_KEY"

    Sandbox items move to delivered after about 5 seconds. The transition is applied when you read the order, so polling is required.

Polling loop

This server-side helper retries the read with backoff and stops at a final status. It never creates a second order.

JavaScript
const base = 'https://nintendocards.supply/api/partner/v1';
const headers = {
  Authorization: 'Bearer ' + process.env.NCS_PARTNER_KEY,
  'Content-Type': 'application/json',
};

async function call(path, init = {}) {
  const response = await fetch(base + path, { ...init, headers });
  const body = await response.json();
  if (!response.ok) throw new Error(response.status + ' ' + body.error);
  return body;
}

async function waitForOrder(orderId) {
  for (let attempt = 0; attempt < 120; attempt++) {
    const { order } = await call('/orders/' + orderId);
    if (['delivered', 'partial', 'failed'].includes(order.status)) return order;
    await new Promise(done => setTimeout(done, 2000));
  }
  throw new Error('order still processing');
}

One bearer key,
two data domains.

Every authenticated request carries a partner key. The key mode selects live or sandbox data; the endpoints and response shapes stay the same.

Header format

HTTP
Authorization: Bearer ncs_pk_<16 hex key id>_<64 hex secret>
  • Create and revoke keys in the dashboard Partner API section after activation.
  • A key is bound to one mode, live or test. Up to 10 active keys are allowed per mode.
  • The secret is shown once. The server stores only a SHA-256 hash of the secret.
  • Revocation is immediate; a revoked key returns 401 invalid_api_key.
  • Keys are per server integration. Never ship a key in browser code, a mobile binary or a public repository.

Account response

JSON
{
  "ok": true,
  "mode": "test",
  "key_id": "a1b2c3d4e5f60718",
  "label": "Shop sandbox",
  "access": "active",
  "entry_amount": "250000",
  "limits": {
    "requests_per_minute": 240,
    "order_operations_per_minute": 120,
    "topups_per_minute": 12
  },
  "sandbox": { "available": "1000000" }
}

entry_amount is the verified entry total in minor units. sandbox.available appears only for test keys.

Catalog, quote,
order, codes.

Sequences are explicit: a quote prices a basket, an order commits it against the balance, and codes are read per delivered item. Nothing is delivered by a callback.

Endpoint reference. All paths are relative to https://nintendocards.supply/api/partner/v1.
MethodPathAuthPurpose
GET/PublicService descriptor: version and documentation links.
GET/accountBearerKey mode, access state, limits and sandbox balance.
GET/catalogBearerProducts with region, denomination and available quantity.
POST/quotesBearerPrice a basket and create a time-limited quote.
POST/ordersBearerCreate an idempotent order from a quote.
GET/ordersBearerList up to 100 most recent orders.
GET/orders/{order_id}BearerRead one order, totals and item statuses.
GET/orders/{order_id}/items/{item_id}/codesBearerRead the delivered codes of one delivered item.
GET/balanceBearerUSD available, reserved and balance revision.
GET/ledgerBearerUp to 100 most recent balance entries.
GET/topupsBearerUp to 30 most recent top-ups (live keys).
POST/topupsBearerCreate a hosted top-up invoice (live keys).
GET/topups/{topup_id}BearerRead one top-up and its hosted payment link (live keys).
POST/sandbox/resetBearerReset sandbox balance, quotes and orders (test keys).

GET /catalog

Returns every currently offered product with its sale price in USD minor units. Live keys read the current supplier catalog; test keys read eight synthetic products. checked_at is the server read time.

JSON
{
  "ok": true,
  "checked_at": "2026-11-23T12:00:00.000Z",
  "sandbox": true,
  "products": [
    {
      "id": "<product id from this response>",
      "sku": "NCS-SANDBOX-US-10",
      "name": "Nintendo eShop card 10 USD (sandbox)",
      "region": "United States",
      "region_code": "US",
      "region_type": "country_or_territory",
      "denomination": 10,
      "denomination_currency": "USD",
      "currency": "USD",
      "fulfillment_type": "code",
      "available_quantity": 1000,
      "unit_price": "900"
    }
  ]
}

Product fields: id, sku, name, region, region_code, region_type, denomination, denomination_currency, currency (always USD), fulfillment_type (code or pin), available_quantity and unit_price.

POST /quotes

Prices 1 to 20 unique products, each with quantity 1 to 500. The response total and line totals are USD minor-unit strings.

Request

JSON
{
  "items": [
    { "product_id": "<product id from /catalog>", "quantity": 2 }
  ]
}

Response

JSON
{
  "ok": true,
  "quote": {
    "id": "<quote id>",
    "total": "1800",
    "currency": "USD",
    "expires_at": "2026-11-23T12:02:30.000Z",
    "sandbox": true,
    "items": [
      {
        "product": { "sku": "NCS-SANDBOX-US-10", "denomination": 10, "region_code": "US" },
        "quantity": 2,
        "unit_price": "900",
        "total": "1800"
      }
    ]
  }
}

Purchase before expires_at. An expired quote returns 409 quote_expired; create a new quote rather than reusing it. Quotes do not reserve stock or money.

POST /orders

Creates an order from a quote and reserves its total from the available balance. Live orders are fulfilled asynchronously per item; sandbox items are delivered after about 5 seconds.

Request

JSON
{
  "quote_id": "<quote id>",
  "operation_key": "<a new UUIDv4 for this purchase>"
}

Response

JSON
{
  "ok": true,
  "order": {
    "id": "<order id>",
    "total": "1800",
    "created_at": "2026-11-23T12:00:10.000Z",
    "status": "processing",
    "charged": "1800",
    "reserved": "0",
    "released": "0",
    "items": [
      {
        "id": "<item id>",
        "product": { "sku": "NCS-SANDBOX-US-10", "denomination": 10, "region_code": "US" },
        "quantity": 2,
        "unit_price": "900",
        "total": "1800",
        "status": "processing",
        "delivered_at": null
      }
    ]
  }
}
  • operation_key is a UUID you generate. The same key with the same quote returns the same order on every retry.
  • The same key with a different quote returns 400 invalid_request.
  • After a timeout, retry with the same key. Do not create a new key for a retry.
  • Insufficient available balance returns 409 insufficient_balance and creates no order.

GET /orders and /orders/{order_id}

The list returns up to 100 recent orders, newest first. A single read returns the current status, charged, reserved and released totals, and every item with its own status, delivered_at and, for failed live items, failure_code.

Use the single-order read as the polling endpoint. See section 05 for the status model.

GET /orders/{order_id}/items/{item_id}/codes

Returns the redemption values for one delivered item. The array length equals the item quantity. Read each item separately; there is no bulk code export.

JSON
{
  "ok": true,
  "item": {
    "id": "<item id>",
    "quantity": 2,
    "codes": [
      { "code": "NCS-SANDBOX-US-10-A1B2C3D4E5F6", "pin": null, "expires_at": null }
    ],
    "sandbox": true
  }
}

Each entry has code, pin and expires_at; either code or pin can be the redeemable value, and both are sensitive. Codes are encrypted at rest and every read is recorded in the access audit. The endpoint returns 404 not_found until that item is delivered.

The order is
the delivery signal.

There are no webhooks. Delivery is observable only by polling the order, item by item, until the order reaches a final status.

Order statuses

StatusMeaning
processingAt least one item is queued, submitting or pending. Keep polling.
deliveredEvery item is delivered; codes can be read.
partialSome items delivered and some failed; delivered items can be read and failed value is released.
failedEvery item failed; the reserved value is released.
reviewAt least one item needs a server-side review; the value stays reserved. Keep polling.

Item statuses

StatusMeaning
queuedSaved, not yet sent for fulfillment.
submittingFulfillment request in progress.
pendingAccepted, waiting for delivered codes.
deliveredCodes are stored and readable through the codes endpoint.
failedNot delivered; failure_code explains why and the value is released.
reviewUnder server-side review; the value stays reserved.

Polling rules

  • Poll GET /orders/{order_id} every 2 to 5 seconds and stop at delivered, partial or failed.
  • review is not final. Keep the order reserved and continue polling with a longer interval.
  • Read codes only for items whose status is delivered; a not-yet-delivered item returns 404.
  • Delivered items are charged; failed items release their value. partial means both outcomes exist in one order.
  • A dropped connection is not a failed order. Read the existing order before doing anything else.

USD balance,
hosted top-ups.

Orders draw from one USD balance. Top-ups are created through the API as hosted payment invoices and credited only after payment confirmation.

Balance and ledger

JSON
{
  "ok": true,
  "balance": {
    "currency": "USD",
    "available": "998200",
    "reserved": "0",
    "revision": "4",
    "sandbox": true
  }
}

available can be spent, reserved is held by processing orders, and revision increases on each balance change. The ledger returns up to 100 entries with delta, after-values, kind, description and timestamp.

Ledger kinds include topup_credit, order_reserve, order_capture and order_release.

Create a top-up

Shell
curl -s https://nintendocards.supply/api/partner/v1/topups \
  -H "Authorization: Bearer $NCS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":"2500.00","operation_key":"<new UUIDv4>"}'
JSON
{
  "ok": true,
  "topup": {
    "id": "<top-up id>",
    "amount": "250000",
    "currency": "USD",
    "invoice_id": "INV-XXXXXXXXXXXX",
    "status": "pending",
    "expires_at": "2026-11-23T12:30:00.000Z",
    "paid_at": null,
    "created_at": "2026-11-23T12:00:00.000Z",
    "last_checked_at": null,
    "payment_url": "<hosted payment link>"
  }
}

Amount is a decimal string from USD 20.00 to USD 9,999,999,999.99. Open payment_url to pay; it is present only while the invoice is payable. The same operation_key and amount return the same top-up; a different amount returns 400 invalid_request. Top-up creation is unavailable for test keys.

Top-up statuses
StatusMeaning
pendingInvoice created and awaiting payment; payment_url is present while it is usable.
paidPayment confirmed and credited to the USD balance.
expiredInvoice expired without payment.
failedInvoice failed or was rejected; create a new top-up to retry.

Errors say
what to do next.

A failed request returns ok: false and an error code. The HTTP status and the code are stable; messages are not part of the contract.

Limits

ScopePer minuteApplies to
All authenticated requests240Every endpoint called with one API key.
Order operations120Quote creation and order creation on one key.
Top-up creation12Live keys only.
Sandbox reset6Test keys only.
  • Limits are fixed one-minute windows per key, not sliding windows or monthly quotas.
  • A throttled call returns 429 rate_limited with a numeric retry_after and the same value in the Retry-After header.
  • JSON bodies are limited to 16 KB and must use Content-Type: application/json.
  • The descriptor GET / needs no key and is not throttled.

Error codes

HTTPCodeRetryMeaning
400invalid_requestNoMalformed body, invalid field values, or a reused operation_key with different order content.
400invalid_itemsNoQuote basket outside 1-20 unique product lines or quantity outside 1-500.
400sandbox_key_requiredNoSandbox reset was called with a live key.
400sandbox_topups_not_availableNoA test key tried to create a top-up.
400topup_amount_invalidNoTop-up amount outside USD 20.00 to USD 9,999,999,999.99, or not a decimal string.
401invalid_api_keyNoAuthorization header missing, malformed, unknown or revoked.
403access_inactiveNoThe key is valid but API access is not active: not activated or suspended.
404not_foundNoUnknown path or unknown record for this account.
404product_not_availableNoA requested product is not in the current catalog.
409stock_changedNoRequested quantity exceeds current available quantity; re-quote for a smaller quantity.
409quote_expiredYesThe quote is past expires_at; create a new quote and purchase again.
409insufficient_balanceNoAvailable USD balance is below the quote total; add balance first.
409balance_changed_refreshYesA concurrent balance change interrupted the purchase; retry the same operation_key.
409conflictNoA uniqueness conflict on the request; do not repeat blindly, read the current state first.
413request_too_largeNoRequest body exceeds 16 KB.
415json_requiredNoPOST body is not sent as application/json.
429rate_limitedYesPer-key limit for the current minute is exhausted; wait for Retry-After seconds.
503catalog_not_availableYesLive catalog or supplier pricing is temporarily unavailable.
503payments_not_availableYesTop-up invoicing is temporarily unavailable.
503supplier_response_invalidYesA supplier response failed server-side validation; no order was created.
503delivery_not_availableYesA stored delivery failed server-side validation; retry the read later.
503service_unavailableYesUnexpected server-side failure; retry with backoff.

Retry and idempotency

Retry only after 429, 503, 409 quote_expired (with a new quote) or 409 balance_changed_refresh (same order request). For order creation, always reuse the original operation_key; for top-ups, reuse the original key and amount. Never generate a second key to "make sure" an earlier request failed.

There is no callback or webhook to register. Signature headers, event delivery and endpoint registration are not part of this API.

A full rehearsal,
no real money.

Test keys run in the same application but a separate data domain: synthetic catalog, synthetic codes, separate balance. They never call the supplier, move real money or touch live orders.

Starting balanceUSD 10,000.00
Delivery delay5 seconds
Quote lifetime150 seconds
Top-upsNot available
Sandbox catalog. Prices are synthetic and shown in USD.
SKURegionDenominationUnit priceStock
NCS-SANDBOX-US-10United States (US)USD 10USD 9.001000
NCS-SANDBOX-US-25United States (US)USD 25USD 22.501000
NCS-SANDBOX-US-50United States (US)USD 50USD 45.001000
NCS-SANDBOX-CA-20Canada (CA)CAD 20USD 15.001000
NCS-SANDBOX-GB-15United Kingdom (GB)GBP 15USD 18.001000
NCS-SANDBOX-DE-25Germany (DE)EUR 25USD 29.001000
NCS-SANDBOX-JP-3000Japan (JP)JPY 3,000USD 20.001000
NCS-SANDBOX-FR-15France (FR)EUR 15USD 18.001000

Reset between rehearsals

Shell
curl -s -X POST https://nintendocards.supply/api/partner/v1/sandbox/reset \
  -H "Authorization: Bearer $NCS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Reset deletes the account's sandbox quotes and orders and restores the USD 10,000.00 balance. It is limited to 6 calls per minute and requires a test key; a live key receives 400 sandbox_key_required.

Sandbox boundaries

Sandbox codes follow NCS-SANDBOX-<REGION>-<DENOMINATION>-<12 HEX> and are always fake. Never validate them against a Nintendo account or a real store.

Test and live keys see different catalogs, balances, orders and top-ups. Switching modes is a matter of switching the key, not the base URL.

Fits the system
you already run.

The API is deliberately small: four write actions and read endpoints for state. The same flow fits a storefront, a marketplace, a bot or an internal panel.

Online store

Sell the code as a normal product, but keep the partner key on the server.

  1. Sync /catalog into your product list and display your own retail price.
  2. On checkout confirmation, create a quote for the exact basket.
  3. Create one order with an operation_key derived from your order ID and stored with it.
  4. Poll the order, then show codes on the customer's order page only after delivered.

Marketplace

Automate per-order fulfillment without exposing supplier economics.

  1. Map each marketplace order to one stored operation_key.
  2. Quote and order in a background worker, not in the marketplace webhook handler.
  3. Store delivered codes encrypted in your own database; re-read them from the API only when needed.
  4. Use the item status to decide replacement or refund handling for failed items.

Telegram bot

Keep the bot responsive: the API call belongs in a queue, not in the message handler.

  1. Confirm payment in your own flow, then enqueue a quote-and-order job.
  2. Create the order once and store the returned order ID with the chat ID.
  3. Poll with backoff, then send each code in a private message.
  4. Never place the partner key in bot client code or logs.

Own panel

Use the API as a fulfillment backend behind your own interface.

  1. Show balance, reserved and recent orders from your backend cache.
  2. Refresh the balance after every order and reconcile it with /ledger.
  3. Use a test key in staging and a live key in production; never share one key across environments.
  4. Expose only your own authenticated staff UI to the browser.

One entry,
one contract.

This page is the canonical human guide. partner-api.md is the canonical machine specification for an integrating AI agent. Both describe the same interface.

Handling rules

  • Send requests over HTTPS and keep the key server-side.
  • Do not log authorization headers, redemption codes or request bodies containing either.
  • Store delivered codes with at least the same protection as other payment-adjacent secrets.
  • Rotate by creating a new key, deploying it, then revoking the old key.
  • Use the sandbox for integration tests and load checks; do not load-test live keys.

Integration boundaries

  • Use only the documented endpoints. Do not probe the dashboard, source, configuration or database.
  • The documented surface is the complete integration contract; undocumented behavior is not guaranteed.
  • The API is versioned in the path (/v1). Additive fields may appear; breaking changes require a new version.
  • Commercial terms and access decisions belong to the partner agreement, not to API responses.
  • There is no webhook, no callback registration and no event stream.

Building with an AI agent

Give the agent the machine specification.

https://nintendocards.supply/partner-api.md contains every endpoint, schema, status, error, limit and acceptance check in one self-contained file.

Open partner-api.md

Wholesale supply, ready to scale