> For the complete documentation index, see [llms.txt](https://api.shopwaive.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.shopwaive.com/quick-start.md). Agents can also search and read this documentation through its [MCP server](https://api.shopwaive.com/~gitbook/mcp).

# Quick Start

With this Quick Start guide, make your first request in just minutes

{% hint style="info" %}
**Tip:** Shopwaive's quick start guide helps developers set up their first request in minutes. Use this guide to create an API key and make your first request to the Shopwaive API 2026-11.
{% endhint %}

## Get your API keys

Every API request needs a Shopwaive API key, sent in the `X-Shopwaive-Access-Token` header.

To create a key:

{% stepper %}
{% step %}
**Open Developers**

In your Shopify admin, open the **Shopwaive** app. Click **Settings**, then **Developers**.
{% endstep %}

{% step %}
**Create a key**

Under **Shopwaive API keys**, type a **Label** (for example `ERP sync`). Under **Permissions**, tick `holders:read` and `wallets:read`: the first request below needs both. If your integration changes balances, tick `wallets:write` too. Click **Create API key**, check what the key will be able to do in **Review this key's permissions**, then click **Create API key** again.
{% endstep %}

{% step %}
**Copy the key**

Click **Copy**, keep the key somewhere safe, then click **Done**. The full key is shown only once.
{% endstep %}
{% endstepper %}

A key starts with `swak_`. Only admin users of the Shopwaive app can see and create keys. A request of the Shopwaive API 2026-11 uses only the permissions ticked on its key: each request's page lists the scopes it needs, and [Authentication](https://api.shopwaive.com/authentication.md#scopes) lists them all.

One key is enough. You can create more, for example one for each developer or integration. To stop a key from working, select it in the list and click **Revoke**. Your other keys are not affected. A lost key cannot be shown again: revoke it and create a new one.

{% hint style="warning" %}
**Still sending an old access token?** Shopify now gives apps access tokens that expire. The Shopwaive API 2026-11 accepts only Shopwaive API keys. Create a key and send it in place of the old token. With a key, every request that changes something also needs an `Idempotency-Key` header: see [Change a balance](#change-a-balance). [Read why](https://api.shopwaive.com/api-keys-and-shopify-expiring-tokens.md)
{% endhint %}

**Good to know:** API keys should be handled with care and never exposed in unsecured environments. They should never be shared as they provide access to your store's data. Never put a key in your theme or in any code that runs in a browser. Anyone can read it there.

### If a key is not accepted

A request whose key is not accepted answers one problem document (`application/problem+json`). Its `code` says why, and its `type` links the code's section on [Errors](https://api.shopwaive.com/reference/errors.md). Nothing is read or changed:

{% code overflow="wrap" %}

```json
{
  "type": "https://api.shopwaive.com/reference/errors#missing_header",
  "title": "Missing header",
  "status": 401,
  "detail": "No Shopwaive API key was sent.",
  "instance": "urn:shopwaive:request:9f2c4e1a7b3d5f60",
  "code": "missing_header",
  "header": "X-Shopwaive-Access-Token",
  "hint": "Send your key as X-Shopwaive-Access-Token: swak_... (create one in the Shopwaive app under Settings > Developers).",
  "request_id": "9f2c4e1a7b3d5f60"
}
```

{% endcode %}

| Status | Code                                                                               | What it means                                                                                                   |
| ------ | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `401`  | [`missing_header`](https://api.shopwaive.com/reference/errors.md#missing_header)   | No key was sent. Send it in `X-Shopwaive-Access-Token`.                                                         |
| `401`  | [`malformed_key`](https://api.shopwaive.com/reference/errors.md#malformed_key)     | The value is not a whole Shopwaive API key, or the request carries two different keys.                          |
| `401`  | [`invalid_key`](https://api.shopwaive.com/reference/errors.md#invalid_key)         | Shopwaive has no such key, or the value is a store access token.                                                |
| `401`  | [`key_revoked`](https://api.shopwaive.com/reference/errors.md#key_revoked)         | The key was revoked. Create a new one.                                                                          |
| `401`  | [`app_uninstalled`](https://api.shopwaive.com/reference/errors.md#app_uninstalled) | The key is paused while the Shopwaive app is uninstalled. It works again by itself when the app is reinstalled. |
| `403`  | [`missing_scope`](https://api.shopwaive.com/reference/errors.md#missing_scope)     | The key lacks a scope the request needs: `scope` names it. Create a key with that box ticked.                   |
| `403`  | [`plan_required`](https://api.shopwaive.com/reference/errors.md#plan_required)     | The Shopwaive API comes with the Shopwaive Checkout plan.                                                       |

Every other code is on [Errors](https://api.shopwaive.com/reference/errors.md).

## Make your first request

Your first request reads one customer by their Shopify customer id: `GET /api/2026-11/customers/{shopify_customer_id}`. The answer holds the customer's Shopwaive account and each of their wallets, with its id and its balance. Find the customer's id in your Shopify admin: open the customer, and the number at the end of the page's address is the id.

## Get a customer by Shopify customer id

> The holder (the customer's Shopwaive account at this store) with its wallets and balances. Customers are looked up by their Shopify customer id, never by an email in a URL. 409 multiple\_holders when the id is on two accounts (after an email change): list every wallet with GET /customers/{shopify\_customer\_id}/wallets, or read each holder by id. A ledger, orders and codes are their own lists: GET /wallets/{wallet\_id}/entries, GET /orders/{order\_id} and GET /redemptions.

```json
{"openapi":"3.1.0","info":{"title":"Shopwaive API","version":"2026-11"},"tags":[{"name":"Holders","description":"Customers' and companies' Shopwaive accounts at this store: look one up by Shopify customer id, or search by email in a POST body."}],"servers":[{"url":"https://app.shopwaive.com","description":"Live data of the store the key belongs to. Every path names the API version: /api/2026-11/..."}],"security":[{"ShopwaiveKey":[]}],"components":{"securitySchemes":{"ShopwaiveKey":{"type":"apiKey","in":"header","name":"X-Shopwaive-Access-Token","description":"swak_ and 40 hex characters, made in the Shopwaive app under Settings > Developer tools. The one header of the REST API."}},"headers":{"ApiVersion":{"description":"The version that answered: 2026-11 on every route of this API.","required":true,"schema":{"type":"string","enum":["2026-11"]}},"RequestId":{"description":"This request's id, 16 hex characters. Quote it to support@shopwaive.com.","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{16}$"}},"RateLimitLimit":{"description":"This key's request limit for the route: how many requests it may send at once (the burst). Requests come back at the key's rate a second up to this number.","required":false,"schema":{"type":"integer","minimum":1}},"RateLimitRemaining":{"description":"How many more requests this key may send at once, right now.","required":false,"schema":{"type":"integer","minimum":0}},"RateLimitReset":{"description":"Seconds until this key's limit is full again.","required":false,"schema":{"type":"integer","minimum":0}},"Deprecation":{"description":"RFC 9745, @<unix seconds>. Sent on every answer once this version is deprecated: the day the next version was released (2026-11 is not deprecated today; GET /versions gives each version's dates). Also sent when the key came in an older header name (X-Shopwaive-Api-Key or Authorization: Bearer): the date that name was deprecated. Send X-Shopwaive-Access-Token instead.","required":false,"schema":{"type":"string","pattern":"^@[0-9]+$"}},"Sunset":{"description":"RFC 8594, an HTTP date. Sent on every answer once this version has a last day, at least 12 months after its deprecation: from then on every request of this version is answered 410 version_removed. 2026-11 has none today.","required":false,"schema":{"type":"string"}},"Link":{"description":"With Deprecation: the changelog that says what changed and how to move (rel=\"deprecation\", and rel=\"sunset\" with Sunset) and the version that replaced this one (rel=\"successor-version\", RFC 5829). For an older key header name: the authentication page (rel=\"deprecation\").","required":false,"schema":{"type":"string"}},"Allow":{"description":"The methods this route answers.","required":true,"schema":{"type":"string"}},"RetryAfter":{"description":"Seconds to wait before sending the same request again, the same as the error's retry_after (idempotency_in_progress, rate_limited, shopify_throttled, daily_write_limit, temporary_error, outcome_pending).","required":false,"schema":{"type":"integer","minimum":1}}},"schemas":{"Holder":{"type":"object","properties":{"id":{"type":"string","description":"The holder id (hld_...).","pattern":"^hld_[0-9a-f]{24}$"},"type":{"type":"string","enum":["customer","company"],"description":"customer: a Shopify customer; company: a company (B2B). New values may be added within this version: read a value you do not know as a new one, never as an error."},"shopify_customer_id":{"type":["string","null"],"description":"Digits; null for a holder with no Shopify customer.","pattern":"^[1-9][0-9]*$"},"email":{"type":["string","null"],"description":"The email the account was made with; null where none is kept."},"external_ids":{"type":"array","items":{"type":"object","properties":{"system":{"type":"string","description":"The system that gave the id."},"id":{"type":"string","description":"The id in that system."}},"required":["system","id"],"description":"An id another system gave the holder."},"description":"Ids other systems gave this holder (none today)."},"group":{"type":["string","null"],"enum":["customer","employee",null],"description":"The program the Programs page shows. customer: the customer program; employee: the employee program. null: the store does not use Programs, or the holder is a company. New values may be added within this version: read a value you do not know as a new one, never as an error."},"company":{"oneOf":[{"type":"object","properties":{"segment_id":{"type":"string","description":"The company's Shopify customer segment."},"shopify_company_location_id":{"type":["string","null"],"description":"The Shopify company location, digits."}},"required":["segment_id","shopify_company_location_id"],"description":"The company, for a company holder."},{"type":"null"}]},"totals":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Amount"},"description":"One total per unit, of the wallets that are no part of another; never added across units. null for a key without wallets:read."},"created_at":{"type":"string","description":"When the account was made.","format":"date-time"},"livemode":{"type":"boolean","description":"true for live data. The hosted sandbox answers false (test keys only)."},"wallets":{"type":"array","items":{"$ref":"#/components/schemas/Wallet"},"description":"GET /customers/{shopify_customer_id} only: the holder's wallets."}},"required":["id","type","shopify_customer_id","email","external_ids","group","company","totals","created_at","livemode"],"description":"A customer's or a company's Shopwaive account at this store."},"Amount":{"type":"object","properties":{"amount":{"type":"string","description":"Exact decimal text in the unit; never a float. Points carry hundredths.","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]{1,3})?$"},"unit":{"type":"string","description":"The unit code: an ISO 4217 currency, points or custom."}},"required":["amount","unit"],"description":"An exact amount of a unit."},"Wallet":{"type":"object","properties":{"id":{"type":"string","description":"The wallet id (wal_...): the id a balance change names.","pattern":"^wal_[0-9a-f]{24}$"},"holder_id":{"type":"string","description":"The holder (hld_...) that owns the wallet.","pattern":"^hld_[0-9a-f]{24}$"},"type":{"type":"string","enum":["balance","company"],"description":"balance: the customer's Shopwaive balance; company: a company's wallet (B2B). New values may be added within this version: read a value you do not know as a new one, never as an error."},"name":{"type":"string","description":"\"Shopwaive balance\" or \"Company wallet\" today."},"unit":{"type":"string","description":"The unit code of every amount of this wallet."},"balance":{"oneOf":[{"$ref":"#/components/schemas/Amount"},{"type":"null"}]},"pending":{"oneOf":[{"$ref":"#/components/schemas/Amount"},{"type":"null"}]},"next_expiry":{"oneOf":[{"$ref":"#/components/schemas/WalletExpiry"},{"type":"null"}]},"spend":{"oneOf":[{"type":"object","properties":{"collections":{"type":"array","items":{"type":"string","description":"A Shopify collection id, digits.","pattern":"^[1-9][0-9]*$"},"description":"The collections the wallet may pay for."},"products":{"type":"array","items":{"type":"string","description":"A Shopify product id, digits.","pattern":"^[1-9][0-9]*$"},"description":"The products the wallet may pay for."}},"required":["collections","products"],"description":"Where the wallet may be spent."},{"type":"null"}]},"part_of":{"type":["string","null"],"description":"The wallet this one is a part of; null for a wallet of its own (every wallet in 2026-11 today)."},"code":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["discount","gift"],"description":"discount: a discount code; gift: a Shopify gift card. New values may be added within this version: read a value you do not know as a new one, never as an error."},"last4":{"type":["string","null"],"description":"The code's last 4 characters; null when it is not shown."}},"required":["kind","last4"],"description":"The code the wallet is spent through at checkout (the code itself is never answered)."},{"type":"null"}]},"program":{"type":"object","properties":{"kind":{"type":["string","null"],"enum":["b2b",null],"description":"b2b: company wallets (B2B). null: no program: the Shopwaive balance. New values may be added within this version: read a value you do not know as a new one, never as an error."},"budget_id":{"type":["string","null"],"description":"A budget's id. null in 2026-11 today."},"po_number":{"type":["string","null"],"description":"A purchase order number. null in 2026-11 today."}},"required":["kind","budget_id","po_number"],"description":"The program the wallet belongs to."},"status":{"type":"string","enum":["active"],"description":"active: can be spent and changed (every wallet in 2026-11 today). New values may be added within this version: read a value you do not know as a new one, never as an error."},"version":{"type":["integer","null"],"description":"Raised by every change of the wallet; null where the store does not keep it yet."},"created_at":{"type":"string","description":"When the wallet was made.","format":"date-time"},"created_by":{"type":["string","null"],"enum":["staff","api","flow","import",null],"description":"Who made the wallet. Not answered in 2026-11 today: every wallet answers null. staff: a staff member in the Shopwaive app; api: the Shopwaive API or an MCP client; flow: Shopify Flow; import: an import file. null: not kept. New values may be added within this version: read a value you do not know as a new one, never as an error."},"livemode":{"type":"boolean","description":"true for live data. The hosted sandbox answers false (test keys only)."}},"required":["id","holder_id","type","name","unit","balance","pending","next_expiry","spend","part_of","code","program","status","version","created_at","created_by","livemode"],"description":"One balance in one unit, with its own history. balance is null when the stored balance cannot be read exactly; pending (on its way, not spendable), next_expiry (read GET /wallets/{wallet_id}/lots), spend (where it may be spent), part_of, program.budget_id, program.po_number and created_by are null in 2026-11 today."},"WalletExpiry":{"type":"object","properties":{"at":{"type":"string","description":"When this part of the balance ends.","format":"date-time"},"amount":{"$ref":"#/components/schemas/Amount"}},"required":["at","amount"],"description":"The next part of a balance to end, and when."},"Problem":{"type":"object","properties":{"type":{"type":"string","description":"The code's section of the errors page (the RFC 9457 problem type).","format":"uri","pattern":"^https://api\\.shopwaive\\.com/reference/errors#[a-z_]+$"},"title":{"type":"string","description":"The code in words: the same for every occurrence of the code."},"status":{"type":"integer","minimum":400,"maximum":599,"description":"The HTTP status of this answer."},"detail":{"type":"string","description":"What happened this time, in plain words."},"instance":{"type":"string","description":"This occurrence: urn:shopwaive:request:<request_id>. It never names the path.","pattern":"^urn:shopwaive:request:[0-9a-f]{16}$"},"code":{"$ref":"#/components/schemas/ErrorCode"},"hint":{"type":"string","description":"What to do next."},"request_id":{"type":"string","description":"Quote it to support@shopwaive.com.","pattern":"^[0-9a-f]{16}$"},"param":{"type":"string","description":"The parameter or body field at fault."},"header":{"type":"string","description":"The header at fault."},"scope":{"type":"string","description":"The scope this key lacks."},"scopes":{"type":"array","items":{"type":"string"},"description":"The scopes this key holds."},"retry_after":{"type":"integer","minimum":1,"description":"Seconds; the same as the Retry-After header."},"holder_ids":{"type":"array","items":{"type":"string","pattern":"^hld_[0-9a-f]{24}$"},"description":"multiple_holders: every holder this Shopify customer id is on."},"wallet_ids":{"type":"array","items":{"type":"string","pattern":"^wal_[0-9a-f]{24}$"},"description":"multiple_holders: the wallet of each of those holders."},"allowed_methods":{"type":"array","items":{"type":"string"},"description":"method_not_allowed: the methods this route answers."},"balance":{"type":["string","null"],"description":"The balance now, exact decimal text.","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]{1,3})?$"},"unit":{"type":"string","description":"The unit code of balance and daily_limit."},"step":{"type":["string","null"],"description":"too_precise: the smallest amount this wallet holds."},"limit":{"type":"integer","description":"daily_request_limit: the day's request limit that was reached."},"daily_limit":{"type":"string","description":"key_daily_limit: the key's own daily limit, exact decimal text in unit.","pattern":"^-?(0|[1-9][0-9]*)(\\.[0-9]{1,3})?$"}},"required":["type","title","status","detail","instance","code","hint","request_id"],"description":"Every error answers this one RFC 9457 problem document (Content-Type: application/problem+json): type, title, status, detail and instance, then the code to branch on, the fields of that error, what to do next and the request id."},"ErrorCode":{"type":"string","enum":["missing_header","malformed_key","invalid_key","key_revoked","app_uninstalled","not_available","missing_scope","rate_limited","shopify_throttled","method_not_allowed","invalid_header","invalid_parameter","invalid_body","body_too_large","unsupported_media_type","multiple_holders","company_location_not_supported","temporary_error","idempotency_key_required","idempotency_conflict","idempotency_in_progress","amount_too_large","too_precise","unit_not_writable","wallet_not_writable","unit_mismatch","insufficient_balance","invalid_expiry","expiry_in_past","daily_write_limit","outcome_pending","write_not_confirmed","idempotency_key_expired","plan_required","mcp_only_key","wallet_not_found","holder_not_found","entry_not_found","customer_not_found","order_not_found","redemption_not_found","wallet_belongs_to_another_customer","key_daily_limit","store_credit_account_not_found","key_suspended","store_suspended","address_suspended","daily_request_limit","key_expired","address_not_allowed","test_key_not_supported","version_removed","test_mode_only","sandbox_paused","sandbox_limit_reached","not_found"],"description":"Stable snake_case codes; each has a section on https://api.shopwaive.com/reference/errors. Branch on the code, never on the message. New values may be added within this version: read a value you do not know as a new one, never as an error."}},"responses":{"E400":{"description":"The request is not valid: nothing was changed.","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E401":{"description":"No key, or a key that is not accepted.","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E403":{"description":"Refused before anything was read or changed: plan_required (the Shopwaive API comes with the Shopwaive Checkout plan, checked on every request), the key may not do this (missing_scope, mcp_only_key, address_not_allowed, test_key_not_supported: a sandbox test key on live data), the key, its store or the address is suspended (key_suspended, store_suspended, address_suspended), or the API is not available for the store (not_available).","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E404":{"description":"No such object at this store.","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E405":{"description":"This route does not answer this method (Allow names the ones it does).","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"},"Allow":{"$ref":"#/components/headers/Allow"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E409":{"description":"A conflict: multiple_holders, idempotency_conflict, idempotency_in_progress or idempotency_key_expired.","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"VersionRemoved":{"description":"version_removed: this version is past its sunset date (the Sunset header named it). Nothing was read or changed; the error names the version to use and the changelog that says how to move. GET /versions of the current version lists every version.","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E429":{"description":"Too many requests, Shopify's own limit, or the store's daily balance changes are used up (Retry-After).","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E503":{"description":"Try again after Retry-After (outcome_pending: with the SAME Idempotency-Key).","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"paths":{"/api/2026-11/customers/{shopify_customer_id}":{"get":{"operationId":"getCustomer","tags":["Holders"],"summary":"Get a customer by Shopify customer id","description":"The holder (the customer's Shopwaive account at this store) with its wallets and balances. Customers are looked up by their Shopify customer id, never by an email in a URL. 409 multiple_holders when the id is on two accounts (after an email change): list every wallet with GET /customers/{shopify_customer_id}/wallets, or read each holder by id. A ledger, orders and codes are their own lists: GET /wallets/{wallet_id}/entries, GET /orders/{order_id} and GET /redemptions.","parameters":[{"name":"shopify_customer_id","in":"path","required":true,"description":"The Shopify customer id. Never an email.","schema":{"type":"string","description":"Digits, or gid://shopify/Customer/<digits>."}},{"name":"X-Shopwaive-Api-Version","in":"header","required":false,"description":"Optional. When sent, it must name the version in the path (2026-11); any other value is answered 400 invalid_header and nothing is read or changed.","schema":{"type":"string","enum":["2026-11"]}}],"responses":{"200":{"description":"OK","headers":{"X-Shopwaive-Api-Version":{"$ref":"#/components/headers/ApiVersion"},"X-Shopwaive-Request-Id":{"$ref":"#/components/headers/RequestId"},"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"},"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Holder"}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"405":{"$ref":"#/components/responses/E405"},"409":{"$ref":"#/components/responses/E409"},"410":{"$ref":"#/components/responses/VersionRemoved"},"429":{"$ref":"#/components/responses/E429"},"503":{"$ref":"#/components/responses/E503"}}}}}}
```

Press **Test it** on the request above, enter your key for `X-Shopwaive-Access-Token` and the customer's id, and send it.

The tabs below show the same request in cURL, Node, PHP (Guzzle) and Python. Each sends one header, your key:

```
X-Shopwaive-Access-Token: swak_EXAMPLEKEY000000000000000000000000000000
```

`swak_EXAMPLEKEY000000000000000000000000000000` is an example, not a real key, and `7408432349218` is an example customer id. Replace both with your own. In your own code, read the key from an environment variable or a secrets store. Never commit a key to a repository.

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location 'https://app.shopwaive.com/api/2026-11/customers/7408432349218' \
--header 'X-Shopwaive-Access-Token: swak_EXAMPLEKEY000000000000000000000000000000'
```

{% endtab %}

{% tab title="Node" %}

```javascript
// Node 18 or later: fetch is built in.
const customerId = '7408432349218';

fetch(`https://app.shopwaive.com/api/2026-11/customers/${customerId}`, {
  headers: {
    'X-Shopwaive-Access-Token': 'swak_EXAMPLEKEY000000000000000000000000000000',
  },
})
  .then(async (response) => {
    console.log(response.status, await response.json());
  })
  .catch((error) => console.error(error));
```

{% endtab %}

{% tab title="PHP (Guzzle)" %}

```php
<?php
// composer require guzzlehttp/guzzle
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client(['base_uri' => 'https://app.shopwaive.com']);

$response = $client->request('GET', '/api/2026-11/customers/7408432349218', [
    'headers' => [
        'X-Shopwaive-Access-Token' => 'swak_EXAMPLEKEY000000000000000000000000000000',
    ],
    'http_errors' => false,
]);

echo $response->getStatusCode() . PHP_EOL;
echo $response->getBody() . PHP_EOL;
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("app.shopwaive.com")
headers = {
  'X-Shopwaive-Access-Token': 'swak_EXAMPLEKEY000000000000000000000000000000'
}
conn.request("GET", "/api/2026-11/customers/7408432349218", headers=headers)
res = conn.getresponse()
print(res.status, res.read().decode("utf-8"))
```

{% endtab %}
{% endtabs %}

### Find a customer by email

An email address is never part of a path. To find a customer by email, send it in the JSON body of `POST /api/2026-11/holders/search` (a key with `holders:read`):

```bash
curl --location 'https://app.shopwaive.com/api/2026-11/holders/search' \
--header 'X-Shopwaive-Access-Token: swak_EXAMPLEKEY000000000000000000000000000000' \
--header 'Content-Type: application/json' \
--data '{"email": "customer@example.com"}'
```

The answer lists the matching holders (Shopwaive accounts), each with its `id` (`hld_...`) and its Shopify customer id. Read a holder's wallets with `GET /api/2026-11/holders/{holder_id}/wallets`. Every request is on the [reference](https://api.shopwaive.com/api-2026-11/reference.md).

## Change a balance

This section uses the classic route `PUT /api/customer`.

A classic request that changes something needs a key with `wallets:write` and an `Idempotency-Key` header. That is `POST` and `PUT /api/customer`, `POST` and `DELETE /api/action/{actionid}`, and `POST /api/trigger`, which also takes a key with `flow:trigger`. Send a new value for each change (a UUID is a good choice). Send the same value again when you retry: a retry with the same key is never applied twice.

This request adds 10 to a customer's balance:

```bash
curl --location --request PUT 'https://app.shopwaive.com/api/customer' \
--header 'X-Shopwaive-Access-Token: swak_EXAMPLEKEY000000000000000000000000000000' \
--header 'X-Shopwaive-Platform: shopify' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 3f9c2b8e-1d4a-4c7e-9b2f-6a1e5d0c7b3a' \
--data '{"customer_email": "customer@example.com", "amount": 10, "note": "Thank you gift"}'
```

Without an `Idempotency-Key` header, the request returns HTTP `400` with the reason `idempotency_key_required`, and nothing is changed:

{% code overflow="wrap" %}

```json
{
  "status": "failed",
  "reason": "idempotency_key_required",
  "header": "Idempotency-Key",
  "message": "A request made with a Shopwaive API key that can change a balance needs an Idempotency-Key header: a unique value per change, for example a UUID, sent again unchanged on a retry. Nothing was changed."
}
```

{% endcode %}

**A key that cannot change balances.** A classic request that changes a balance (a deposit, a set, a void or an order) needs a key with `wallets:write`. `POST /api/trigger` takes that box or `flow:trigger`. A key without the box it needs returns HTTP `403` with the reason `missing_scope`, and nothing is changed. Create a key with the box ticked:

{% code overflow="wrap" %}

```json
{
  "status": "failed",
  "reason": "missing_scope",
  "scope": "wallets:write",
  "message": "This API key cannot change balances: it does not have the wallets:write scope. To change balances, create a key with Change balances through the REST API (wallets:write) ticked, in the Shopwaive app under Settings > Developers."
}
```

{% endcode %}

**A classic request with no key.** The classic routes answer a missing or unknown key in their own words, not as a problem document:

No key, or a token Shopwaive does not know, returns HTTP `401`: see [API keys and Shopify expiring tokens](https://api.shopwaive.com/api-keys-and-shopify-expiring-tokens.md).

HTTP `503` means the key could not be checked. Retry the request.

The answers to a retry are in [Retry safely](https://api.shopwaive.com/reference/rest-api-documentation/customer-api.md#retry-safely).
