The Musqet developer platform
Musqet has a REST API so your own software can do what the dashboard does: read your transactions and settlements, create and manage payment links, run a terminal sale, and more. It can also call you back: register a webhook and Musqet will POST to your server the moment a payment is created or completed.
There are two sides to this, and you will use both.
- In My Musqet you create the API keys your code authenticates with, and you register the webhook endpoints Musqet delivers to. This is point-and-click, and it is where the secrets live.
- From your own code you send requests with your key and receive webhooks on your endpoint. That is the rest of this page.
API keys and Webhooks are under Developer in the My Musqet sidebar once your card payments are approved. If your business takes only bitcoin, contact Musqet and we will turn on developer access for it. Until then Musqet refuses to create a key or a webhook endpoint, from My Musqet or the API, with a 403. Keys and endpoints you already have keep working. By default only the business owner sees them.
The API in one place
Section titled “The API in one place”Every endpoint lives under the /api/v1 prefix. Rather than list them all here, where a copy would drift from the code, Musqet publishes the catalogue live:
- The OpenAPI document is the machine-readable OpenAPI 3 description of every endpoint, its inputs and its responses, for generating a client, importing into Postman or Insomnia, or reading from an agent.
- The interactive reference is the same document rendered for a person, with examples, and shows the base URL to use.
The examples below use two shell variables so you can paste them as-is once you have set them:
export MUSQET_API_URL="…" # the base URL shown at the top of /docsexport MUSQET_API_KEY="msqt_api_live_…" # created in My Musqet, see belowAPI keys
Section titled “API keys”An API key is the credential your code presents on every request. Musqet stores only a hash of the key, never the key itself, so a key is shown to you once at the moment you create it and can never be retrieved again. It carries a set of permissions, so a key can be scoped to only what a given integration needs.
Create a key
Section titled “Create a key”Keys are created in My Musqet only. The API cannot create a key. Open API keys and create one. You give it:
- a name, so you can tell your keys apart later,
- a preset, which fills in the permissions a known integration needs so you do not have to know them yourself. Pick your integration (for example Odoo) and its permissions are selected for you. Pick Custom to choose the permissions yourself.
- the permissions it should hold. You can grant only permissions you hold yourself, and never Manage API keys. A key never holds more than its creator: if your role or permissions change so you no longer hold one of a key’s permissions, that key is revoked, and if you leave the business, every key you created there is revoked. Changing the team is also checked against your role and permissions at every request (see Team and staff). See Permissions below for what each one allows.
- optionally an expiry date, after which the key stops working on its own.
Then confirm with your password and your authenticator code or a passkey. A key can act on your business, so creating one always needs two-factor authentication. If it is not turned on, the screen asks you to turn it on in your account settings first.
The new key is shown in full one time, prefixed msqt_api_live_. Copy it into your secret store there and then. If you lose it, you cannot see it again: revoke it and make a new one.
The API keys screen lists each key with who created it. A member is named only to someone who can also see the Team page; anyone else sees A team member. A key Musqet staff made for your business shows Musqet staff: it belongs to the business, not to a member, so no change to your team revokes it. A key whose creator left before keys were revoked on leaving shows Former member.
Permissions
Section titled “Permissions”A key carries a set of permissions, and every endpoint requires one. If a key does not hold the permission an endpoint needs, the request comes back 403. Grant a key only the permissions its integration actually uses.
Each permission has a name you see in My Musqet, a code you pass in the API’s permissions array (and see quoted in a 403), and the actions it allows.
| In My Musqet | Permission | What it lets a key do |
|---|---|---|
| View sales | sales:read | Read your sales and settlement history. |
| View Bitcoin backend | bitcoin-backend:read | Read your Bitcoin node and wallet configuration. |
| Manage Bitcoin backend | bitcoin-backend:write | Change your Bitcoin node and wallet configuration. |
| View payments | take-payments:read | Read your payments and hosted checkouts. |
| Take payments | take-payments:write | Create hosted checkouts and take payments. |
| View tip links | tip-links:read | Read your tip links. |
| Manage tip links | tip-links:write | Create and delete tip links. |
| Issue refunds | refunds:write | Issue refunds against sales. |
| Withdraw funds | withdraw:write | Move funds out of your Musqet balance. |
| View backup | backup:read | Read your wallet backup data. |
| View devices | devices:read | Read your enrolled terminals and their settings. |
| Manage devices | devices:write | Enrol, configure and remove terminals. |
| View team | team:read | Read your team members and their roles. |
| Manage team | team:write | Invite, edit and remove team members, within what the key’s creator may do today. |
| View API keys | api-keys:read | List the API keys on your business. |
| Manage API keys | api-keys:write | For team members only: create and revoke keys in My Musqet. A key cannot hold it. |
| View webhooks | webhooks:read | List your webhook endpoints and their delivery history. |
| Manage webhooks | webhooks:write | Create, edit and remove webhook endpoints, and rotate their signing secrets. |
| Customise dashboard | dashboard:write | Change your dashboard layout. |
| Verify UCP Lightning preimages | ucp:verify | Verify Lightning payment preimages. |
| Manage notification recipients | notifications:write | Manage who receives your notifications. |
| View terminal sales | terminal-sales:read | Read sales taken on a payment terminal. |
| Take terminal sales | terminal-sales:write | Start, poll and cancel sales on a payment terminal. A terminal refund also needs refunds:write. |
The Odoo preset selects View devices (devices:read), View terminal sales (terminal-sales:read) and Take terminal sales (terminal-sales:write): what the point-of-sale integration needs to resolve a terminal by serial and run a sale.
Revoke a key
Section titled “Revoke a key”If a key leaks, or an integration is retired, revoke it from the same API keys screen. Revocation takes effect immediately: the very next request that presents it is rejected. Revoking one key does not touch your others.
Your code can also revoke the key it is using, for example when rotating to a new one: send DELETE /api/v1/api-keys/{id} with that key’s own ID. A key cannot revoke any other key; a request naming another ID comes back 403.
Authenticating a request
Section titled “Authenticating a request”Present your key as a bearer token in the Authorization header:
curl "$MUSQET_API_URL/api/v1/transactions" \ -H "Authorization: Bearer $MUSQET_API_KEY"Musqet hashes the key you send, looks it up, and checks that it is not revoked, not past its expiry, and belongs to a business account that is open. If it fails any of those, the request comes back 401. Keys of a business account Musqet has closed are refused this way, and work again if the account is reopened. So are keys created by someone whose Musqet login has been suspended, which work again once the suspension is lifted. Repeated failures are limited for 15 minutes, with a Retry-After header giving the seconds to wait:
- A key that does not exist, or a malformed or missing header: after 20 of these from one IP address or IPv6 /64 network within 15 minutes, every request from that address or network to an endpoint that needs a key comes back
429, including requests with a valid key. Other callers that share it, behind the same office or cloud network, are refused too. - A revoked or expired key, a key of a closed business account, or a key whose creator is suspended: after 20 tries within 15 minutes, that key alone comes back
429. Other keys on the same address are not affected.
A request with a valid key never counts towards either limit. If the key is valid but does not hold the permission an endpoint requires, the request comes back 403. The key also decides which business the request acts on, so you never pass a business id yourself.
Two things are worth knowing:
- The key is a static bearer token, not a signature. Send it only over HTTPS, and keep it server-side. There is no request-signing step on the calling side.
- Only the
Authorizationheader is read, on every method. A key put in the query string or the request body is ignored, so the request comes back401as if no key had been sent. Keep the key out of URLs: they end up in logs along the way. - The checkout endpoints are the exception.
POST /api/v1/checkoutsand reading or subscribing to a checkout need no API key, because they are meant to be driven from a customer’s browser where a secret key must never appear. Everything else under/api/v1needs a key. Creating a checkout is limited per IP address and per business instead. See Payment links and hosted checkout for that flow and its limits.
API errors
Section titled “API errors”Every error comes back as JSON in one shape:
{ "error": { "code": 401, "message": "Invalid or inactive API key.", "metadata": {} }}code is the HTTP status, repeated in the body so it survives logging. message is a human-readable reason. metadata is present only on some errors and carries structured detail.
| Status | Meaning | What to do |
|---|---|---|
400 | The request body or query failed validation, a number is outside the range we can store, or a value contains a null character | Fix the input; for a validation failure the message names the field |
401 | Missing, malformed, revoked or expired key | Check the Authorization header and the key’s state |
403 | The key is valid but lacks the required permission, or the feature is not switched on for your business (the message is then FeatureFlag not enabled for business.). A 403 with the message Forbidden on every request means your IP address is blocked for an hour | Grant the permission to the key, or use one that has it; for a feature, ask Musqet to switch it on; for a block, see Troubleshooting |
404 | The thing you asked for does not exist. The message may be just Not found. | Check the id in the path |
409 | The request clashes with something that already exists, such as a checkout externalId you have used before (or, without your API key, that any checkout for the business has used), a webhook endpoint past the limit, or a record that must be unique (the message is then That already exists.) | For a checkout, use a new value or read the existing record; for webhooks, delete an endpoint you no longer use; otherwise send a different value, and contact support if it persists |
422 | The request was valid, but we could not act on what it pointed to, such as a wallet connection whose relay does not answer. When your own connected wallet or exchange account refused the call, metadata.reason is merchant_wallet_refused | Check the value you sent; the message says what failed. For merchant_wallet_refused, check the wallet or exchange keys you connected are still active |
429 | You are being rate limited, or your IP address or key has had too many failed attempts | Wait the number of seconds in the Retry-After header, then retry |
500 | Something failed on our side | Retry; if it persists, contact support |
Webhooks
Section titled “Webhooks”A webhook lets Musqet call you. You register a URL, and Musqet POSTs a small JSON body to it when an event you asked for happens, so you do not have to poll. This is the outbound direction and is entirely separate from the callbacks Musqet receives from card and bitcoin processors.
Add an endpoint
Section titled “Add an endpoint”In My Musqet, open Webhooks and add one. You give it:
- the URL to POST to (it must be a public HTTPS address in production; private and internal addresses, and host names without a dot such as
https://redis/, are refused), - the one event it should receive, and
- an optional description.
An endpoint listens for a single event type. To receive more than one event, add an endpoint per event, pointing at the same URL. When you create an endpoint, Musqet shows you its signing secret once, prefixed whsec_. Store it: you need it to verify deliveries, and like an API key it cannot be retrieved again.
A business can have up to 10 endpoints, disabled ones included. Adding an eleventh is refused with a 409 that names the limit; delete an endpoint you no longer use to make room.
The events you can subscribe to
Section titled “The events you can subscribe to”There are four:
| Event | Fires when |
|---|---|
payment.created | A payment has been started for one of your checkouts |
payment.completed | That payment has completed |
terminal.sale.completed | A sale on a payment terminal completed |
terminal.sale.failed | A sale on a payment terminal failed |
Every delivery has the same body:
{ "eventType": "payment.completed", "checkoutId": "…", "externalId": "your-own-reference-or-null", "status": "…", "amount": 0, "currency": "GBP", "network": null, "txIds": [], "createdAt": "2026-08-12T10:00:00.000Z"}externalId is the reference you set when you created the checkout, so you can tie the event back to your own order. Someone can create a checkout without your API key under a reference before you use it, so two checkouts can carry the same externalId: match on checkoutId and check the amount before you mark an order paid. network and txIds are populated for bitcoin payments and are null or empty otherwise.
Verify a delivery came from Musqet
Section titled “Verify a delivery came from Musqet”Anyone can POST to a public URL, so verify the signature before you trust a delivery. Each request carries these headers:
| Header | Holds |
|---|---|
x-webhook-signature | t=<timestamp>,v1=<hmac> |
X-Webhook-Timestamp | The Unix timestamp used in the signature |
X-Webhook-Event | The event type |
X-Webhook-Delivery | The delivery id |
The signature is an HMAC-SHA256, keyed with your endpoint’s signing secret, over the string <timestamp>.<raw-body>. Recompute it from the raw request body (not a re-serialised copy of the parsed JSON) and compare in constant time:
import { createHmac, timingSafeEqual } from 'node:crypto'
const verify = (rawBody, header, secret) => { const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')))
// Reject a delivery whose timestamp is too old to be genuine, so a captured // request cannot be replayed later. Widen or narrow the window to suit you. if (Math.abs(Date.now() / 1000 - Number(parts.t)) > 300) return false
const expected = createHmac('sha256', secret) .update(`${parts.t}.${rawBody}`, 'utf8') .digest('hex')
const a = Buffer.from(expected) const b = Buffer.from(parts.v1 ?? '') return a.length === b.length && timingSafeEqual(a, b)}Reject anything that does not match. The freshness check rejects a delivery whose timestamp is more than five minutes old, so a request captured off the wire cannot be replayed against you later.
Rotate a signing secret
Section titled “Rotate a signing secret”If a secret leaks, rotate it from the endpoint’s page in My Musqet. You get a fresh whsec_ secret, shown once. Update your verification code to the new value.
See what was delivered
Section titled “See what was delivered”Each endpoint keeps a delivery history in My Musqet: what was sent, the response status your server returned, and whether it succeeded or failed. Use it when an event does not arrive.
Musqet retries a failed delivery for you. A delivery counts as successful only on a 2xx response. A non-2xx, a timeout (deliveries time out after 30 seconds) or a network error is retried with an increasing delay, for up to five attempts in total (the first delivery and four retries). If an endpoint fails ten deliveries in a row, Musqet disables it and stops sending, so a dead URL does not pile up forever. Re-enable it once your server is healthy again.
While Musqet has closed your business account, it sends no webhooks to any of its endpoints. A delivery that was still waiting to go out is marked failed rather than sent, and is not sent later. If the account is reopened, new events are delivered again.
Kiosk API
Section titled “Kiosk API”The kiosk API is a separate, smaller surface, under /kiosk/v1, for driving a Musqet payment terminal from your own kiosk or till software: fetch the business and terminal details for a serial, start a sale, then poll or cancel it.
It authenticates differently from the main API. Instead of a bearer key, a kiosk request carries an x-api-key header, and the value is the kiosk key issued for that installation rather than one of the per-business API keys above. A wrong kiosk key counts towards the same failed-attempt limit as a wrong API key. A kiosk key of a business account Musqet has closed is refused like an unknown key, with a 401, and works again if the account is reopened. Its failed attempts count against that key rather than your IP address: after 20 within 15 minutes that key gets 429 with Retry-After, and a closed venue’s kiosk left running does not lock out other callers on the same network. The endpoints are listed in the live reference alongside the rest.
A refund (type: refund) through the kiosk API needs the kiosk key. A request signed in with a terminal’s own session can start a sale but not a refund, and gets 403. That session also acts only on its own terminal: starting a sale on, or asking for the business details of, another terminal’s serial gets 403, and reading or cancelling another terminal’s sale gets 404. A session counts as on a terminal only once that terminal has signed in with its device key; a session from an older sign-in, or with no terminal serial, is refused with 403 on every kiosk call. The kiosk key can start, read or cancel a sale on any terminal of its business.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
Every request returns 401 | Key is wrong, revoked or expired, the header is malformed, or the key was sent in the query string or body. A key is also revoked when the team member who created it leaves the business or loses one of its permissions, and refused while their login is suspended | Confirm the header is Authorization: Bearer msqt_api_live_… and the key is active in My Musqet. A key refused because its creator is suspended still shows as active there, so if every check passes, contact Musqet support |
Every request returns 429, even with the right key | Your IP address or IPv6 /64 network, or another caller sharing it, sent 20 keys that do not exist within 15 minutes | Find and fix the caller sending the wrong key, then wait the number of seconds in the Retry-After header |
A request returns 403 | The key lacks the permission that endpoint needs | Grant the permission to the key, or use one that has it |
Every request returns 403 with Forbidden, on any endpoint | Your IP address or IPv6 /64 network, or another caller sharing it, called 30 different paths that do not exist, or used a method an endpoint does not accept (a 405) on 30 different endpoints, within 5 minutes, which is how vulnerability scanners behave. The address is blocked for 60 minutes. A path that exists but finds no record does not count, and neither does calling the same wrong path again, even for different record ids that are numbers, UUIDs, cuids or long hex strings | Find the caller using wrong URLs or methods (an old base URL, a typo in a path, a removed endpoint, PATCH where the endpoint takes PUT) and fix it, then wait for the hour to pass. If you cannot wait, contact Musqet support |
Creating a webhook endpoint returns 403 although the key holds webhooks:write | Your card payments are not approved yet, or your business takes only bitcoin and developer access is not turned on | Get card payments approved, or contact Musqet to turn on developer access for a bitcoin-only business, then try again |
Adding a terminal user, or renewing its credentials, returns 403 although the key holds devices:write | Card payments taken in person are not active for your business, which card machines need | Get card payments approved, or ask Musqet why they are suspended, then try again |
A change returns 403 with FeatureFlag not enabled for business. although the key holds the permission | The feature is not switched on for your business. Changes to the team, tip links, tips configurations and new payment links follow the same features My Musqet shows; reading them still works | Ask Musqet to switch the feature on |
Every kiosk request returns 401 with Business not found. although the kiosk key is right | Card payments taken in person are not active for your business, which card machines and kiosks need | Get card payments approved, or ask Musqet why they are suspended, then try again |
A terminal refund (type: refund) returns 403, but a sale works | On the main API the key lacks refunds:write; on the kiosk API the request used a terminal’s session instead of the kiosk key | Grant refunds:write to the key, or send kiosk refunds with the kiosk key |
A kiosk sale started with a terminal’s session returns 403, but the same request with the kiosk key works | The serial is a different terminal from the one the session signed in on, or the terminal has not yet signed in with its device key | Send the sale from the terminal it is for once it uses its device key, or use the kiosk key |
Creating a webhook endpoint returns 409 | The business already has 10 endpoints | Delete one you no longer use, then add the new one |
Uploading a file to its presigned URL returns 403 with SignatureDoesNotMatch | The upload’s headers differ from the ones the URL was signed for. This error comes from the storage service, not the API, so it is XML rather than the JSON shape above | Send the contentType you named when you asked for the URL as the Content-Type header, and Content-Disposition: attachment with no file name |
| A webhook never arrives | The endpoint is for a different event, or a previous run of failures disabled it | Check the event type on the endpoint and its delivery history in My Musqet |
| The signature check fails | Verifying against a re-serialised body, or against the wrong secret | Sign the raw request body, and confirm you are using this endpoint’s current whsec_ secret |
| A webhook stopped after a bad deploy | Ten consecutive failures disabled the endpoint | Fix your server, then re-enable the endpoint |
See also
Section titled “See also”- Payment links and hosted checkout — the public checkout endpoints, which need no API key
- Taking card payments
- Taking bitcoin payments