API keys
Each Flint endpoint that an API key calls checks for the scopes it needs, and a key that lacks them gets 403 INSUFFICIENT_SCOPE. Give each key only the scopes its job calls, so a leaked key can do less. Every operation in the API reference lists the scopes it accepts, and the scope catalog describes every scope you can grant.
To send a key, choose between test and live keys, or create keys over the API, see Authentication. For expiry, rotation, and leak response, see Key security.
Listing, reading, updating, and revoking keys use the caller's environment. Dashboard sessions in live mode manage only live keys; in test mode, they manage only keys in the selected sandbox. Reading, updating, or revoking a key outside that environment returns 404 RESOURCE_NOT_FOUND. Creating a key can still name another sandbox with sandbox_id when the caller is a Dashboard session or live credential.
An onboarding session with a role that manages API keys can create and revoke external keys without a connected app link in any of its merchant's active sandboxes. Send the session to POST /v1/api-keys/{api_key_id}/revoke to revoke a sandbox key.
Find the user accountable for a key#
created_by_user_id is the user accountable for this key: the user who created it, or who created the API key or workload identity that did. created_by names the credential that made the request. created_by_user_id is absent when the root creator isn't a user.
For example, if a user creates a key and that key creates another key, both keys have the same created_by_user_id. The second key's created_by points to the first key.
On each request, Flint checks whether the accountable user's current role can grant the key's access. If the user loses that permission or loses access to the merchant, requests with the key return 401 INVALID_CREDENTIAL. This applies to live and test keys, including keys created by the user's other credentials.
GET /v1/api-keys?created_by_user_id=usr_... lists keys accountable to that exact user, including keys their credentials created. This single-value filter combines with other filters and the caller's environment. A malformed or repeated ID returns 400 INVALID_REQUEST; a valid unknown ID returns an empty list. Keep the filter unchanged when following next_page_token.
Use created_by_type and created_by_id to filter by the credential that made the request. For example, created_by_type=user&created_by_id=usr_... returns only keys that user created directly.
When signed in to the Dashboard as a Developer, you can update or revoke a restricted key if you are its accountable user and your current role can grant its scopes. A merchant Owner or Admin can update or revoke any key in the selected environment.
Link a key to a connected app#
When you give a platform an API key, set partner_app_install_id on POST /v1/api-keys to bind the key's lifetime to that app's install. The field is optional on create and immutable afterward. Every key resource, including create responses and list items, includes partner_app_install_id: the install's pinst_... ID when linked, or null when unlinked. Omit the create field for an unlinked key; sending null returns 400 INVALID_REQUEST with detail INVALID_VALUE.
Only a live credential or a Dashboard session can explicitly set the field. The install must belong to your merchant, be active, and have an active grant for the key's target environment: the live grant for a live key, or the test grant bound to the same sandbox for a test key. An explicit field from a test credential returns 403 FORBIDDEN with reason live_mode_required before Flint reads the install.
Each install can have up to 25 active linked API keys per environment, separately from its limit of 25 linked webhook endpoints. Another key returns 409 LIMIT_REACHED with reason partner_app_install_links, param partner_app_install_id, and limit 25. Revoke an unused linked key before creating another.
Inherited links and credential restrictions#
Keys and merchant webhook endpoints created by a linked key inherit its install link, including when the caller is a linked test key. A live linked key can omit the field or repeat its own install ID; naming another install returns 400 INVALID_REQUEST with detail NOT_ALLOWED. A linked test key must omit the field and let Flint inherit it. The target environment still needs the install's active grant.
A linked key can't create access that would outlive its install. These operations return 403 FORBIDDEN with reason linked_key_not_allowed, before making changes:
- Create a workload identity, change its subject, claim conditions or scopes, or reactivate it.
- Create a delivery rate callback.
- Create a sandbox with
issue_test_key: true. - Register partner app client credentials or rotate a partner app's client secret.
- Create a customer access link.
- Regenerate an invoice public link.
- Copy webhook endpoints, including catalog or sandbox copies with
clone_webhooks: true.
Workload identity name changes, deactivation, and archive remain available. Short-lived customer sessions, checkout credentials, and merchant account sessions remain available within the key's scopes. Linking doesn't grant additional scopes or change which keys the caller can manage.
Invoice creation, issuance, scheduling, and reads remain available. After revoke, a platform can still open public pages for invoices it issued until they are paid, voided, or their public links are regenerated.
Find and end linked access#
GET /v1/api-keys?partner_app_install_id=pinst_... is a single-value, exact-match filter. It combines with the other filters and the caller's mode: live credentials list live keys, and test credentials list keys in their own sandbox. A malformed ID returns 400 INVALID_REQUEST; a well-formed unknown ID returns an empty list. Keep the filter unchanged when following next_page_token.
Revoking the install revokes its linked keys in every environment. Revoking one environment grant revokes the keys linked in that environment. A revoked key returns 401 INVALID_CREDENTIAL with reason revoked. Moving the test grant to another sandbox during code exchange or archiving its sandbox also ends the old sandbox's links. Resetting the sandbox keeps the links. Reinstalling the app never restores revoked keys or deleted endpoints; create new ones after the install is active again.
Unlinked keys keep working until separately revoked or expired. Sending partner_app_install_id on PATCH /v1/api-keys/{api_key_id} returns 400 INVALID_REQUEST with detail UNKNOWN_FIELD; an existing key can't be linked or unlinked. What revoking an install ends covers endpoints and the revoke response too.
Link errors#
| Response | Meaning |
|---|---|
404 RESOURCE_NOT_FOUND | The create field names an unknown install or one belonging to another merchant. param is partner_app_install_id. |
409 ACTION_NOT_ALLOWED, reason terminal_status | The install is revoked. |
409 ACTION_NOT_ALLOWED, reason status_not_reached | The install is still pending_exchange. Exchange its authorization code first. |
409 ACTION_NOT_ALLOWED, reason environment_not_granted | The install has no active grant for the target environment. Authorize the app there before creating the key. |
Pick a key's scopes#
A key's access decides where its scopes come from:
access | The key holds |
|---|---|
restricted | Exactly the scopes you list. Flint never adds more. |
full | Every scope the catalog allows for the key's mode, including scopes Flint adds later. |
read_only | Every .read scope that full access includes, including read scopes Flint adds later. |
Give production services restricted keys. For each operation the service calls, grant a scope the reference lists for it. A write scope already covers its read scope, so a service that reads and writes orders needs only commerce.orders.write.
| Job | Scopes |
|---|---|
| A checkout backend that creates checkout sessions, reads orders, and issues refunds | checkouts.checkout_sessions.write, commerce.orders.read, commerce.refunds.write |
| A reconciliation worker that reads payouts and balance transactions | money_movement.payouts.read, money_movement.balance_transactions.read |
| A warehouse app that records stock changes and receives returns | commerce.inventory.write, commerce.returns.operations.write |
| A register that looks up and redeems gift cards | commerce.gift_cards.redemptions.write |
| A service that lists event tickets and looks them up by admission code | commerce.tickets.read |
| A point-of-sale server that registers readers and opens Tap to Pay connection sessions | payments.readers.write |
Key access covers who can grant full and read_only.
Scope catalog#
Scope names follow <area>[.<qualifier>].<read|write>, such as commerce.orders.read or commerce.returns.policies.write. A qualifier splits off a permission inside its area that deserves separate trust, such as changing return policies or overriding refund tax.
- Key modes says whether live keys, test keys, or both can hold the scope. A few scopes, such as
developer.partner_apps.write, are live only.developer.sandboxes.writeis in both modes, but a test key uses it only on its own sandbox. Asking for one on a test key returns400 INVALID_REQUEST, and the error detail names thescopeand itsallowed_key_modes. - Full access and Read only list the modes in which a
fullorread_onlykey holds the scope. Full access holds every scope its mode allows. Read-only access holds the.readscopes among them. - Partner installs says whether a partner app can request the scope for its installs. A scope is available to installs only when a route that accepts partner app tokens requires it.
The table is generated from the catalog that validates API keys and fills the dashboard's scope pickers. OpenAPI publishes the same catalog as the root x-flint-scopes list, where each scope's implied_by names the other scopes that satisfy it.
Credentials and API keys
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
accounts.api_keys.read | Read API keys. | live, test | live, test | live, test | Not allowed |
accounts.api_keys.write | Manage API keys. | live, test | live, test | Not included | Not allowed |
accounts.workload_identities.read | Read workload identities and their API keys. | live, test | live, test | live, test | Not allowed |
accounts.workload_identities.write | Manage workload identities and their API keys. | live, test | live, test | Not included | Not allowed |
Developer tools
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
developer.partner_apps.read | Read partner apps. | live | live | live | Not allowed |
developer.partner_apps.write | Manage partner apps. | live | live | Not included | Not allowed |
developer.sandboxes.read | Read sandboxes. | live, test | live, test | live, test | Not allowed |
developer.sandboxes.write | Manage sandboxes. | live, test | live, test | Not included | Not allowed |
developer.test_clocks.read | Read sandbox test clocks. Grantable on live keys so a live key can grant it to the sandbox keys it mints. Test clock routes refuse live credentials. | live, test | live, test | live, test | Not allowed |
developer.test_clocks.write | Manage sandbox test clocks. Grantable on live keys so a live key can grant it to the sandbox keys it mints. Test clock routes refuse live credentials. | live, test | live, test | Not included | Not allowed |
developer.merchant_signups.read | Read merchant signups your partner apps started, including their owners' names and emails. Live keys only. | live | live | live | Not allowed |
developer.merchant_signups.write | Start, verify, resend, cancel, and rotate the codes of merchant signups for your partner apps. Live keys only. | live | live | Not included | Not allowed |
Merchant account
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
merchants.profile.read | Read the merchant profile. | live, test | live, test | live, test | Allowed |
merchants.profile.write | Manage the merchant profile. | live, test | live, test | Not included | Allowed |
merchants.onboarding.read | Read merchant onboarding information. | live, test | live, test | live, test | Allowed |
merchants.account_sessions.write | Create merchant account sessions. | live, test | live, test | Not included | Allowed |
merchants.onboarding.write | Manage merchant onboarding information. | live, test | live, test | Not included | Allowed |
merchants.locations.read | Read merchant locations. | live, test | live, test | live, test | Allowed |
merchants.locations.write | Manage merchant locations. | live, test | live, test | Not included | Allowed |
merchant_billing.read | Read merchant billing information. | live, test | live, test | live, test | Not allowed |
Developer and account
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
settings.read | Read settings. | live, test | live, test | live, test | Allowed |
settings.write | Manage settings. | live, test | live, test | Not included | Allowed |
accounts.devices.read | Read devices. | live, test | live, test | live, test | Not allowed |
accounts.devices.write | Manage devices. | live, test | live, test | Not included | Not allowed |
analytics.read | Read analytics. | live, test | live, test | live, test | Allowed |
webhooks.read | Read webhook endpoints and deliveries. | live, test | live, test | live, test | Allowed |
webhooks.write | Manage webhook endpoints and deliveries. | live, test | live, test | Not included | Not allowed |
developer.request_logs.self.read | Read request summaries and detail for the calling credential. | live, test | live, test | live, test | Not allowed |
developer.resource_timelines.read | Read resource timelines with the read scope for each requested resource. | live, test | live, test | live, test | Not allowed |
developer.request_logs.read | Read request summaries and detail for every caller in the current environment. | live, test | live, test | live, test | Not allowed |
Customers
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
customers.read | Read customers. | live, test | live, test | live, test | Allowed |
customers.write | Manage customers. | live, test | live, test | Not included | Allowed |
customers.sessions.write | Create and revoke customer sessions. | live, test | live, test | Not included | Not allowed |
Commerce
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
commerce.products.read | Read products. | live, test | live, test | live, test | Allowed |
commerce.products.write | Manage products. | live, test | live, test | Not included | Allowed |
commerce.orders.read | Read orders. | live, test | live, test | live, test | Allowed |
commerce.orders.write | Manage orders. | live, test | live, test | Not included | Allowed |
commerce.refunds.read | Read refunds. | live, test | live, test | live, test | Allowed |
commerce.refunds.write | Manage refunds. | live, test | live, test | Not included | Allowed |
commerce.subscription_plans.read | Read subscription plans. | live, test | live, test | live, test | Allowed |
commerce.subscription_plans.write | Manage subscription plans. | live, test | live, test | Not included | Allowed |
commerce.subscriptions.read | Read subscriptions. | live, test | live, test | live, test | Allowed |
commerce.subscriptions.write | Manage subscriptions. | live, test | live, test | Not included | Allowed |
commerce.invoices.read | Read invoices. | live, test | live, test | live, test | Allowed |
commerce.invoices.write | Manage invoices. | live, test | live, test | Not included | Allowed |
commerce.bundles.read | Read bundles. | live, test | live, test | live, test | Allowed |
commerce.bundles.write | Manage bundles. | live, test | live, test | Not included | Allowed |
commerce.catalog.read | Read catalog objects. | live, test | live, test | live, test | Allowed |
commerce.catalog.write | Manage catalog objects. | live, test | live, test | Not included | Allowed |
commerce.refunds.tax_overrides.write | Override tax amounts and tax treatment when creating refunds. | live, test | live, test | Not included | Not allowed |
commerce.promotions.read | Read promotions. | live, test | live, test | live, test | Allowed |
commerce.promotions.write | Manage promotions. | live, test | live, test | Not included | Allowed |
commerce.inventory.read | Read inventory stock, movements, and reservations. | live, test | live, test | live, test | Allowed |
commerce.inventory.write | Manage inventory stock, movements, and reservations. | live, test | live, test | Not included | Allowed |
commerce.inventory.policies.write | Manage inventory allocation policies. | live, test | live, test | Not included | Allowed |
commerce.inventory.allocation.write | Change whether a merchant location accepts inventory allocation. | live, test | live, test | Not included | Allowed |
commerce.returns.read | Read returns. | live, test | live, test | live, test | Allowed |
commerce.returns.write | Manage returns. | live, test | live, test | Not included | Allowed |
commerce.returns.operations.write | Record return receipts, inspections, and dispositions. | live, test | live, test | Not included | Allowed |
commerce.returns.resolutions.write | Manage return resolutions. | live, test | live, test | Not included | Allowed |
commerce.returns.policies.write | Manage return policies. | live, test | live, test | Not included | Allowed |
commerce.returns.reasons.write | Manage return reasons. | live, test | live, test | Not included | Allowed |
commerce.delivery.read | Read delivery configuration and fulfillment options. | live, test | live, test | live, test | Allowed |
commerce.delivery.write | Manage delivery configuration and fulfillment options. | live, test | live, test | Not included | Allowed |
commerce.credit_notes.read | Read credit notes. | live, test | live, test | live, test | Allowed |
commerce.credit_notes.write | Manage credit notes. | live, test | live, test | Not included | Allowed |
commerce.gift_cards.read | Read gift cards and their ledger. | live, test | live, test | live, test | Allowed |
commerce.gift_cards.write | Issue, update, freeze, unfreeze, and close gift cards, and add funded value. | live, test | live, test | Not included | Allowed |
commerce.gift_cards.redemptions.write | Redeem gift cards and refund gift card redemptions. | live, test | live, test | Not included | Allowed |
commerce.gift_cards.adjustments.write | Adjust gift card balances and cash out gift cards. | live, test | live, test | Not included | Allowed |
commerce.gift_cards.secrets.write | Access gift card codes and deliver gift cards to recipients. | live, test | live, test | Not included | Allowed |
commerce.tickets.read | Read event tickets and look up admissions. | live, test | live, test | live, test | Allowed |
commerce.tickets.write | Manage event ticket admissions without refund authority. | live, test | live, test | Not included | Not allowed |
commerce.license_keys.read | Read masked license keys and pools, and look up licenses by key. | live, test | live, test | live, test | Allowed |
commerce.license_keys.write | Manage issued license keys and license key pools. | live, test | live, test | Not included | Allowed |
commerce.license_keys.secrets.write | Reveal and replace full license keys. | live, test | live, test | Not included | Not allowed |
Payments
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
checkouts.checkout_sessions.read | Read checkout sessions. | live, test | live, test | live, test | Allowed |
checkouts.checkout_sessions.write | Manage checkout sessions. | live, test | live, test | Not included | Allowed |
payments.payment_intents.read | Read payment intents. | live, test | live, test | live, test | Allowed |
payments.payment_intents.write | Manage payment intents. | live, test | live, test | Not included | Allowed |
payments.payment_methods.read | Read payment methods. | live, test | live, test | live, test | Allowed |
payments.payment_methods.write | Manage payment methods. | live, test | live, test | Not included | Allowed |
checkouts.payment_links.read | Read payment links. | live, test | live, test | live, test | Allowed |
checkouts.payment_links.write | Manage payment links. | live, test | live, test | Not included | Allowed |
payments.disputes.read | Read disputes. | live, test | live, test | live, test | Allowed |
payments.disputes.write | Manage disputes. | live, test | live, test | Not included | Allowed |
payments.payment_method_domains.read | Read payment method domains. | live, test | live, test | live, test | Not allowed |
payments.payment_method_domains.write | Manage payment method domains. | live, test | live, test | Not included | Not allowed |
payments.readers.read | View card readers and Tap to Pay phones. | live, test | live, test | live, test | Allowed |
payments.readers.write | Register card readers and Tap to Pay phones and take payments on them. | live, test | live, test | Not included | Allowed |
checkouts.shops.read | Read shops. | live, test | live, test | live, test | Allowed |
checkouts.shops.write | Manage shops. | live, test | live, test | Not included | Allowed |
Risk
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
risk.read | Read risk data. | live, test | live, test | live, test | Allowed |
risk.reviews.write | Manage risk reviews. | live, test | live, test | Not included | Allowed |
risk.controls.write | Manage risk controls. | live, test | live, test | Not included | Allowed |
Money movement
| Scope | Permission | Key modes | Full access | Read only | Partner installs |
|---|---|---|---|---|---|
money_movement.balances.read | Read balances. | live, test | live, test | live, test | Allowed |
money_movement.balance_transactions.read | Read balance transactions. | live, test | live, test | live, test | Allowed |
money_movement.payouts.read | Read payouts. | live, test | live, test | live, test | Allowed |
money_movement.payouts.write | Manage payouts. | live, test | live, test | Not included | Not allowed |
money_movement.payout_settings.read | Read payout settings. | live, test | live, test | live, test | Allowed |
money_movement.payout_settings.write | Manage payout settings. | live, test | live, test | Not included | Not allowed |
reports.read | Read reports. | live, test | live, test | live, test | Not allowed |
reports.write | Manage reports. | live, test | live, test | Not included | Not allowed |
money_movement.platform_fees.read | Read platform fees, platform fee balances, and their ledger for partner apps you own. | live, test | live, test | live, test | Not allowed |
money_movement.payment_splits.read | Read payment splits you collected or received, including reversals. | live, test | live, test | live, test | Not allowed |
How Flint checks scopes#
Each operation requires either all of its listed scopes or any one of them. Read operations list the read scope together with every scope that satisfies it, so GET /v1/orders accepts commerce.orders.read or commerce.orders.write.
Write scopes cover their reads#
<area>.write satisfies <area>.read. A key with commerce.orders.write can call every route that requires commerce.orders.read. A write scope never covers another area: commerce.orders.write doesn't read refunds or payment intents.
A qualified scope is a separate grant, and the unqualified write scope doesn't include it. commerce.refunds.write can't override refund tax, and commerce.returns.write can't record receipts or confirm resolutions. Some qualified write scopes also satisfy their area's read scope, and the rest satisfy nothing beyond themselves:
| Qualified scope | Also satisfies |
|---|---|
commerce.gift_cards.redemptions.write, commerce.gift_cards.adjustments.write, commerce.gift_cards.secrets.write | commerce.gift_cards.read |
commerce.returns.operations.write, commerce.returns.resolutions.write, commerce.returns.policies.write, commerce.returns.reasons.write | commerce.returns.read |
risk.reviews.write, risk.controls.write | risk.read |
commerce.inventory.policies.write, commerce.inventory.allocation.write | Nothing. Add commerce.inventory.read to read stock. |
commerce.refunds.tax_overrides.write | Nothing. Add commerce.refunds.write to create the refund. |
customers.sessions.write | Nothing. Add customers.read to read customers. |
Requests that need several scopes#
A few operations combine several permissions and need every scope they list:
- POST
/v1/returns/{return_id}/processRequired API key scopes: commerce.returns.operations.write, commerce.returns.resolutions.write and commerce.returns.writecommerce.returns.operations.writeandcommerce.returns.resolutions.writeandcommerce.returns.writeReference for POST /v1/returns/{return_id}/processRecords decisions, receipts, inspections, and resolutions for a return in one request.
Fields that need an extra scope#
Creating a refund with refund_type: credit_note needs commerce.credit_notes.write as well as commerce.refunds.write.
Some requests need another scope only when you send a particular field or value. Without it, the request returns 403 INSUFFICIENT_SCOPE naming the extra scope. A refund that overrides refund tax, for example, needs commerce.refunds.tax_overrides.write as well as commerce.refunds.write.
| Request | Extra scope | When |
|---|---|---|
GET /v1/api-request-logs | developer.request_logs.read | When filtering by caller_type, caller_id, partner_app_id, or customer_id. |
GET /v1/files/{file_id} | commerce.products.read | For product and product_variant files. Fields: file_id. |
GET /v1/files/{file_id} | commerce.bundles.read | For bundle files. Fields: file_id. |
GET /v1/files/{file_id} | checkouts.payment_links.read | For payment_link files. Fields: file_id. |
GET /v1/files/{file_id} | commerce.subscription_plans.read | For subscription_plan files. Fields: file_id. |
GET /v1/files/{file_id} | merchants.profile.read | For merchant_logo and merchant_icon files. Fields: file_id. |
POST /v1/locations | commerce.inventory.allocation.write | When setting inventory_allocation_enabled. |
PATCH /v1/locations/{location_id} | commerce.inventory.allocation.write | When setting inventory_allocation_enabled. |
POST /v1/merchant-account-session-refreshes | payments.payment_intents.read and payments.disputes.write | When the launch token's components include payments. Fields: launch_token. |
POST /v1/merchant-account-sessions | payments.payment_intents.read and payments.disputes.write | When components includes payments. |
POST /v1/orders | commerce.delivery.write | When delivery is present. |
PATCH /v1/orders/{order_id} | commerce.delivery.write | When delivery is present, including null. |
POST /v1/orders/{order_id}/pay | payments.payment_methods.write | When an API key or partner token sends save_payment_method: true. |
POST /v1/orders/{order_id}/pay | payments.readers.write | When a payment source or selection has credential_type reader. Fields: payment_source.credential_type, payment_intents[].payment_source.credential_type. |
POST /v1/payment-intents/{payment_intent_id}/confirm | payments.payment_methods.write | When save_payment_method is true. |
POST /v1/payment-intents/{payment_intent_id}/confirm | payments.readers.write | When payment_source.credential_type is reader. |
POST /v1/refunds | commerce.credit_notes.write | For refund_type credit_note. Fields: credit_note_id. |
POST /v1/refunds | commerce.refunds.tax_overrides.write | When providing tax overrides. Fields: tax_breakdown_refunds, line_items[].tax_refund_mode, line_items[].tax_money, line_items[].tax_breakdown_refunds, line_items[].tax_adjustment_reason, line_items[].tax_adjustment_audit. |
POST /v1/sandboxes | accounts.api_keys.write | When issue_test_key is true. |
POST /v1/subscriptions/{subscription_id}/access-links | commerce.subscriptions.write | When purpose is subscription_manage. |
The table is generated from x-flint-conditional-scopes in OpenAPI, and each operation's entry below shows its own extra scopes.
When a restricted key creates a webhook endpoint, changes its subscriptions or delivery URL, or activates it, webhooks.write must be paired with read access for each subscribed event resource. For example, subscribing to order.paid requires commerce.orders.read or commerce.orders.write. A wildcard requires read access for every event resource. See Webhooks.
Payment routes check the route, not the payment#
The route you call decides the scope, not whether the payment intent belongs to an order. Routes under /v1/payment-intents check the payments scopes for every payment intent, and routes under /v1/orders check the order scopes. A key with only commerce.orders.write can pay an order but can't create, capture, or cancel its payment intents. A key with only payments.payment_intents.write can create, capture, or cancel any payment intent. Send order_id when creating an order-owned payment intent; paying the order still requires commerce.orders.write.
- POST
/v1/payment-intentsRequired API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for POST /v1/payment-intentsCreates a standalone payment intent, or an order-owned payment intent when you send
order_id. - POST
/v1/orders/{order_id}/payRequired API key scope: commerce.orders.writecommerce.orders.writeReference for POST /v1/orders/{order_id}/payPays the order with a payment source.
- GET
/v1/orders/{order_id}/payment-attemptsRequired API key scopes: commerce.orders.read or commerce.orders.writecommerce.orders.readorcommerce.orders.writeReference for GET /v1/orders/{order_id}/payment-attemptsLists the order's payment attempts.
- GET
/v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}Required API key scopes: commerce.orders.read or commerce.orders.writecommerce.orders.readorcommerce.orders.writeReference for GET /v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}Retrieves one payment attempt.
- POST
/v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}/cancelRequired API key scope: commerce.orders.writecommerce.orders.writeReference for POST /v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}/cancelCancels a payment attempt.
- POST
/v1/payment-intentsRequired API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for POST /v1/payment-intentsCreates a standalone payment intent.
- GET
/v1/payment-intentsRequired API key scopes: payments.payment_intents.read or payments.payment_intents.writepayments.payment_intents.readorpayments.payment_intents.writeReference for GET /v1/payment-intentsLists payment intents, standalone and order-owned. Filter by
order_idfor one order's. - GET
/v1/payment-intents/{payment_intent_id}Required API key scopes: payments.payment_intents.read or payments.payment_intents.writepayments.payment_intents.readorpayments.payment_intents.writeReference for GET /v1/payment-intents/{payment_intent_id}Retrieves any payment intent.
- PATCH
/v1/payment-intents/{payment_intent_id}Required API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for PATCH /v1/payment-intents/{payment_intent_id}Updates any payment intent. An order-owned one accepts only
metadataandexternal_reference_id. - POST
/v1/payment-intents/{payment_intent_id}/confirmRequired API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for POST /v1/payment-intents/{payment_intent_id}/confirmConfirms a standalone payment intent. Pay an order-owned one through
POST /v1/orders/{order_id}/payinstead. - POST
/v1/payment-intents/{payment_intent_id}/captureRequired API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for POST /v1/payment-intents/{payment_intent_id}/captureCaptures any payment intent, standalone or order-owned.
- POST
/v1/payment-intents/{payment_intent_id}/cancelRequired API key scope: payments.payment_intents.writepayments.payment_intents.writeReference for POST /v1/payment-intents/{payment_intent_id}/cancelCancels any payment intent, standalone or order-owned.
Check which scopes a key holds#
GET /v1/auth-context returns non-secret metadata for the credential that sent the request, including its granted scopes. It needs no scope, so any valid key can call it, which makes it a quick deploy check that a service runs with the key you expect:
curl https://api.withflintpay.com/v1/auth-context \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"auth_type": "api_key",
"partner_app_install_id": null,
"api_key_id": "key_01KWK4Q8Z1MB7F0T2S9R3V6HAX",
"name": "Checkout backend",
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"organization_id": "org_01KEZF7C00MTFBRRKJA6QQX04J",
"mode": "test",
"access": "restricted",
"sandbox_id": "test_01KNB061AGD0CYYF16M5QAQE3N",
"scopes": [
"checkouts.checkout_sessions.write",
"commerce.orders.read",
"commerce.refunds.write"
]
},
"request_id": "req_01KWM6SZJQGQWNFPTAF5HE7MHH"
}
For full and read_only keys, Flint resolves scopes on each request, so scopes shows what the key holds today. An API key also returns access, nullable partner_app_install_id, and expires_at when it has one. CLI logins, workload identities, partner apps, and onboarding sessions have their own auth_type shapes; onboarding sessions report role capabilities instead of scopes. Scoped tokens identify themselves differently; see CLI OAuth and workload identity tokens.
Change a key's scopes#
PATCH /v1/api-keys/{api_key_id} with access restricted replaces the key's whole scopes list. Every key returns a version that increases each time the key is updated or revoked. Send it as expected_version whenever the body includes access or scopes, so your change can't undo one someone made after you read the key. POST /v1/api-keys/{api_key_id}/revoke accepts an optional expected_version too.
A stale expected_version returns 409 VERSION_CONFLICT with the current version in details[0].current_version, and the key keeps its scopes. Read the key again, compare its scopes with the ones you meant to set, and resend with the new version. Change a key's access or scopes has a full example, and Key management errors lists the rules for access and scopes in the body.
A key can grant only scopes it holds, and can change or revoke only keys whose scopes it holds, so no key can raise its own permissions.
Scope errors#
- StatusHTTP 403What to doThe key lacks a scope the operation, or a field you sent, requires. In
details[0],scope_requirement.modeisallorany,scope_requirement.scopeslists the requirement, andmissing_scopeslists what the key doesn't satisfy. Add those scopes to the key, or use a key that has them. Creating or changing a key returns it too when the calling key lacks a scope it tried to grant. - StatusHTTP 403CodeFORBIDDENWhat to doThe key's mode can't make the request. Reason
live_mode_requiredneeds a live key, andtest_mode_requiredneeds a test key bound to the sandbox. Scopes can't change a key's mode, so send the request with a key in the mode it needs. - StatusHTTP 400CodeINVALID_
REQUEST What to doA scope in a create or update request is unknown, listed twice, or not allowed for the key's mode. The error detail'sparampoints at the scope, and an unknown name comes with close matches insuggestions.
Authentication and authorization errors shows a full INSUFFICIENT_SCOPE response and every 401.
A recognized credential on an endpoint that does not accept its type returns 401 INVALID_CREDENTIAL with reason wrong_credential_type, auth_type, and accepted_auth_types in details[0]. A token Flint cannot classify returns malformed. Expired tokens report expired; revoked grants and sessions whose access was withdrawn report revoked. See the credential reasons.
The API key object#
A credential used to authenticate API requests.
Returned by GET /v1/api-keys/{api_key_id} and carried by the endpoints below.
Attributes
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
fullread_onlyrestricted
api_key_idstringRequiredUnique identifier for this api key, prefixed `key_`.
created_atstringRequiredRFC3339 timestamp.
created_byobjectWho created this key: the API key or workload identity whose credential made the request, or else the user, including through the Dashboard, a CLI login, or an onboarding session. An API key creator can belong to another mode, such as a live key that creates a sandbox key. Keys a workload token created before Flint recorded workload identity creators name the user who set up that workload identity. Filter the list with `created_by_type` and `created_by_id`. Absent when the creator is unavailable.
resource_idstringRequiredPublic Flint ID of the referenced resource.
resource_typeenumRequiredPublic resource kind identified by resource_id, such as payment_intent for a payment.
api_keyapi_request_logbalancebalance_transactionbundlebundle_componentcategorycheckout_sessioncheckout_session_customer_verificationcredit_notecredit_note_allocationcustom_domaincustomercustomer_addresscustomer_deletion_requestcustomer_email_preferencescustomer_sessioncustomer_tax_exemptioncustomer_verificationdelivery_choice_groupdelivery_location_setdelivery_methoddelivery_profiledelivery_quotedelivery_ratedelivery_rate_callbackdelivery_revocationdelivery_selectiondelivery_zonedemo_sessiondevicediscountdisputeemail_change_requestenvironment_grantfileflint_walletflint_wallet_cardfraud_warningfulfillmentfulfillment_eventfulfillment_notificationgift_cardgift_card_funding_dispositiongift_card_loadgift_card_notificationgift_card_redemptiongift_card_transactionimageinventory_adjustmentinventory_allocation_policyinventory_allocation_policy_revisioninventory_countinventory_iteminventory_levelinventory_movementinventory_receiptinventory_reservationinventory_reservation_lineinventory_transferinventory_transfer_lineinvoiceinvoice_delivery_attemptinvoice_late_feeinvoice_line_iteminvoice_manual_paymentinvoice_payment_attemptinvoice_payment_termlicense_keylicense_key_activationlicense_key_poollicense_key_pool_keylocationmerchantmerchant_billing_balancemerchant_billing_entrymerchant_billing_invoicemerchant_signupmodifiermodifier_groupmodifier_setorderorder_chargeorder_editorder_line_itemorder_line_item_modifierorder_payment_attemptpackagepackage_itempartner_apppartner_app_credentialpartner_app_installpayment_attemptpayment_intentpayment_linkpayment_link_custom_fieldpayment_link_line_itempayment_methodpayment_method_domainpayment_reviewpayment_splitpayoutpayout_destinationpayout_settingsplatform_feeplatform_fee_balance_transactionplatform_fee_payoutprice_listprice_list_priceproductproduct_optionproduct_option_valueproduct_variantpromotionpromotion_codepurchase_refund_allocationreaderrefundrefund_allocationrefund_line_item_adjustmentremembered_buyerreportreport_downloadreturnreturn_activityreturn_dispositionreturn_inspectionreturn_inspection_line_itemreturn_line_itemreturn_policyreturn_policy_revisionreturn_reasonreturn_receiptreturn_receipt_line_itemreturn_resolutionrisk_listrisk_list_itemrisk_rulesandboxsettingsshipmentshopshop_listingsubscriptionsubscription_delivery_migrationsubscription_line_itemsubscription_offersubscription_payment_retrysubscription_plansubscription_plan_line_itemtax_calculation_callbacktax_connectiontax_registrationtest_clockticketuserwebhook_deliverywebhook_endpointwebhook_eventworkload_identity
created_by_user_idstringThe user accountable for this key: the user who created it, or who created the API key or workload identity that did. `created_by` names the credential that made the request.
expires_atstringRFC3339 timestamp.
key_prefixstringRequiredThe start of the secret key: its `flint_` mode prefix and the first 8 characters of the random part. It identifies the key in a list without revealing the secret, which only the create response returns.
last_used_atstringRFC3339 timestamp.
merchant_idstringRequiredID of the merchant this resource belongs to.
namestringRequiredThe label the key was given, 1 to 100 characters.
partner_app_install_idstring or nullRequiredThe connected app install this key is linked to. The key is revoked when that install is revoked or loses its grant for this key's environment. Null when the key is unlinked. Never changes.
revoked_atstringWhen this key was revoked, in RFC 3339 format. Present only for revoked keys. For keys revoked before revocation timestamps were recorded, this is the last update time.
sandbox_idstringID of the sandbox this resource belongs to.
scopesarray of enumRequiredThe scopes the key holds now. For full and read_only keys this list grows when Flint adds scopes.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
statusenumRequiredCurrent key status. A non-revoked key is expired when expires_at is at or before the current time; otherwise it is active. Revoked keys remain revoked regardless of expires_at.
activeexpiredrevoked
supported_actionsarray of enumRequiredLifecycle actions Flint accepts now. Active and expired keys can be revoked; revoked keys accept none.
revoke
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
{
"access": "restricted",
"api_key_id": "key_01KEZF7C007F5ZGD2ZXDWJGD76",
"created_at": "2026-03-17T14:30:00Z",
"created_by": {
"resource_id": "usr_01K0P7W6A4N9F3J2T8Q5R1C6XM",
"resource_type": "user"
},
"expires_at": "2027-03-17T14:30:00Z",
"key_prefix": "example",
"last_used_at": "2026-03-17T15:00:00Z",
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"name": "Sandbox orders integration",
"partner_app_install_id": null,
"sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
"scopes": [
"accounts.api_keys.read",
"accounts.api_keys.write",
"commerce.orders.read",
"commerce.orders.write"
],
"status": "active",
"supported_actions": [
"revoke"
],
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
}List API keys#
/v1/api-keysRequires scope accounts.api_keys.read or accounts.api_keys.write
Rate limit: read
Returns merchant-bound external API key metadata. Live callers list only live keys; test callers list only keys in their selected sandbox. Dashboard sessions use the mode and sandbox selected by the request. Internal keys, demo-session keys, and secrets are never returned. Default order: created_at descending, then api_key_id descending.
Query parameters
partner_app_install_idstringExact-match filter on partner_app_install_id.
statusarray of enumOptional API key status filter. Active keys have no expiration or a future expires_at. Expired keys are not revoked and have expires_at at or before the current time. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.
activeexpiredrevoked
created_by_typearray of enumFilter by created_by.resource_type. A user filter matches keys a user created directly, not keys their other keys created. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.
api_keyuserworkload_identity
created_by_idstringFilter by created_by.resource_id. The ID prefix (key_, usr_, or wid_) sets the creator type, so created_by_type is optional; when sent, it must be that one type.
created_by_user_idstringFilter by the exact ID of the user accountable for the key, including keys their API keys or workload identities created. Combines with created_by_type and created_by_id.
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.
sort_byenumField to sort by. Defaults to created_at; ties are broken by api_key_id.
created_atlast_used_atname
sort_directionenumSort direction. Defaults to desc.
ascdesc
created_afterstringInclusive lower bound on created_at.
created_beforestringExclusive upper bound on created_at.
updated_afterstringInclusive lower bound on updated_at.
updated_beforestringExclusive upper bound on updated_at.
Response · 200
A page of API key metadata.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
fullread_onlyrestricted
api_key_idstringRequiredUnique identifier for this api key, prefixed `key_`.
created_atstringRequiredRFC3339 timestamp.
created_byobjectWho created this key: the API key or workload identity whose credential made the request, or else the user, including through the Dashboard, a CLI login, or an onboarding session. An API key creator can belong to another mode, such as a live key that creates a sandbox key. Keys a workload token created before Flint recorded workload identity creators name the user who set up that workload identity. Filter the list with `created_by_type` and `created_by_id`. Absent when the creator is unavailable.
created_by_user_idstringThe user accountable for this key: the user who created it, or who created the API key or workload identity that did. `created_by` names the credential that made the request.
expires_atstringRFC3339 timestamp.
key_prefixstringRequiredThe start of the secret key: its `flint_` mode prefix and the first 8 characters of the random part. It identifies the key in a list without revealing the secret, which only the create response returns.
last_used_atstringRFC3339 timestamp.
merchant_idstringRequiredID of the merchant this resource belongs to.
namestringRequiredThe label the key was given, 1 to 100 characters.
partner_app_install_idstring or nullRequiredThe connected app install this key is linked to. The key is revoked when that install is revoked or loses its grant for this key's environment. Null when the key is unlinked. Never changes.
revoked_atstringWhen this key was revoked, in RFC 3339 format. Present only for revoked keys. For keys revoked before revocation timestamps were recorded, this is the last update time.
sandbox_idstringID of the sandbox this resource belongs to.
scopesarray of enumRequiredThe scopes the key holds now. For full and read_only keys this list grows when Flint adds scopes.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
statusenumRequiredCurrent key status. A non-revoked key is expired when expires_at is at or before the current time; otherwise it is active. Revoked keys remain revoked regardless of expires_at.
activeexpiredrevoked
supported_actionsarray of enumRequiredLifecycle actions Flint accepts now. Active and expired keys can be revoked; revoked keys accept none.
revoke
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/api-keys \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of API key metadata.
{
"data": [
{
"access": "restricted",
"api_key_id": "key_01KEZF7C007F5ZGD2ZXDWJGD76",
"created_at": "2026-03-17T14:30:00Z",
"created_by": {
"resource_id": "usr_01K0P7W6A4N9F3J2T8Q5R1C6XM",
"resource_type": "user"
},
"expires_at": "2027-03-17T14:30:00Z",
"key_prefix": "example",
"last_used_at": "2026-03-17T15:00:00Z",
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"name": "Sandbox orders integration",
"partner_app_install_id": null,
"sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
"scopes": [
"accounts.api_keys.read",
"accounts.api_keys.write",
"commerce.orders.read",
"commerce.orders.write"
],
"status": "active",
"supported_actions": [
"revoke"
],
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
}
],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM6PD3JGCHCDXQ93W96GT2V"
}Create an API key#
/v1/api-keysIdempotentRequires scope accounts.api_keys.write
Rate limit: sensitive_write
Creates a merchant-bound external API key. A live credential creates a live key, or a test key bound to the sandbox named by sandbox_id. A sandbox-bound credential, such as a test key, creates test keys in its own sandbox only. An onboarding session creates its merchant's first keys here, in its default sandbox. secret_key is returned only in the initial successful response and accepted idempotent replays of the same create request.
Request body
Send exactly one of these
The `full` variant of `CreateAPIKeyRequest`.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
full
expires_atstringRFC3339 timestamp.
namestringRequiredA label that helps you tell keys apart, 1 to 100 characters. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
partner_app_install_idstringLinks this key to a connected app's install. Revoking the install or its grant for this key's environment revokes the key. The install must be active and authorized for that environment. Set only at creation; it never changes. Omit for an unlinked key. Keys created by a linked key inherit its link. Each install can have up to 25 linked keys that have not been revoked per environment.
sandbox_idstringPublic ID of the sandbox the new test key is bound to. A live credential or a user session sends it to create a test key in that sandbox, and omits it for a live key. A sandbox-bound credential, such as a test key, may name only its own sandbox and gets a test key there either way; any other sandbox returns 404. A Dashboard or onboarding session may name any of the merchant's active sandboxes, and an onboarding session must send it: its first key goes to default_sandbox_id. Storage generation IDs are never accepted.
The `read_only` variant of `CreateAPIKeyRequest`.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
read_only
expires_atstringRFC3339 timestamp.
namestringRequiredA label that helps you tell keys apart, 1 to 100 characters. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
partner_app_install_idstringLinks this key to a connected app's install. Revoking the install or its grant for this key's environment revokes the key. The install must be active and authorized for that environment. Set only at creation; it never changes. Omit for an unlinked key. Keys created by a linked key inherit its link. Each install can have up to 25 linked keys that have not been revoked per environment.
sandbox_idstringPublic ID of the sandbox the new test key is bound to. A live credential or a user session sends it to create a test key in that sandbox, and omits it for a live key. A sandbox-bound credential, such as a test key, may name only its own sandbox and gets a test key there either way; any other sandbox returns 404. A Dashboard or onboarding session may name any of the merchant's active sandboxes, and an onboarding session must send it: its first key goes to default_sandbox_id. Storage generation IDs are never accepted.
The `restricted` variant of `CreateAPIKeyRequest`.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
restricted
expires_atstringRFC3339 timestamp.
namestringRequiredA label that helps you tell keys apart, 1 to 100 characters. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
partner_app_install_idstringLinks this key to a connected app's install. Revoking the install or its grant for this key's environment revokes the key. The install must be active and authorized for that environment. Set only at creation; it never changes. Omit for an unlinked key. Keys created by a linked key inherit its link. Each install can have up to 25 linked keys that have not been revoked per environment.
sandbox_idstringPublic ID of the sandbox the new test key is bound to. A live credential or a user session sends it to create a test key in that sandbox, and omits it for a live key. A sandbox-bound credential, such as a test key, may name only its own sandbox and gets a test key there either way; any other sandbox returns 404. A Dashboard or onboarding session may name any of the merchant's active sandboxes, and an onboarding session must send it: its first key goes to default_sandbox_id. Storage generation IDs are never accepted.
scopesarray of enumRequiredThe scopes to grant. Required only with access restricted; forbidden with full or read_only. For a test key, use only scopes whose key_modes includes test in x-flint-scopes. The developer.sandboxes.read and developer.sandboxes.write scopes are valid on test keys; developer.partner_apps.read and developer.partner_apps.write are live-only.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
Response · 201
The created external API key and one-time secret.
dataobjectRequiredResource, collection, or operation result returned by this request.
secret_keystringOne-time secret returned only when the API key is created. Returned only to the credential that created it, and omitted when another credential replays the request.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
fullread_onlyrestricted
api_key_idstringRequiredUnique identifier for this api key, prefixed `key_`.
created_atstringRequiredRFC3339 timestamp.
created_byobjectWho created this key: the API key or workload identity whose credential made the request, or else the user, including through the Dashboard, a CLI login, or an onboarding session. An API key creator can belong to another mode, such as a live key that creates a sandbox key. Keys a workload token created before Flint recorded workload identity creators name the user who set up that workload identity. Filter the list with `created_by_type` and `created_by_id`. Absent when the creator is unavailable.
created_by_user_idstringThe user accountable for this key: the user who created it, or who created the API key or workload identity that did. `created_by` names the credential that made the request.
expires_atstringRFC3339 timestamp.
key_prefixstringRequiredThe start of the secret key: its `flint_` mode prefix and the first 8 characters of the random part. It identifies the key in a list without revealing the secret, which only the create response returns.
last_used_atstringRFC3339 timestamp.
merchant_idstringRequiredID of the merchant this resource belongs to.
namestringRequiredThe label the key was given, 1 to 100 characters.
partner_app_install_idstring or nullRequiredThe connected app install this key is linked to. The key is revoked when that install is revoked or loses its grant for this key's environment. Null when the key is unlinked. Never changes.
revoked_atstringWhen this key was revoked, in RFC 3339 format. Present only for revoked keys. For keys revoked before revocation timestamps were recorded, this is the last update time.
sandbox_idstringID of the sandbox this resource belongs to.
scopesarray of enumRequiredThe scopes the key holds now. For full and read_only keys this list grows when Flint adds scopes.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
statusenumRequiredCurrent key status. A non-revoked key is expired when expires_at is at or before the current time; otherwise it is active. Revoked keys remain revoked regardless of expires_at.
activeexpiredrevoked
supported_actionsarray of enumRequiredLifecycle actions Flint accepts now. Active and expired keys can be revoked; revoked keys accept none.
revoke
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/api-keys \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"access": "restricted",
"expires_at": "2027-03-17T14:30:00Z",
"name": "Sandbox orders integration",
"scopes": [
"accounts.api_keys.read",
"commerce.orders.read",
"commerce.orders.write"
]
}'Get an API key#
/v1/api-keys/{api_key_id}Requires scope accounts.api_keys.read or accounts.api_keys.write
Rate limit: read
Returns external API key metadata. Secrets, internal keys, and demo-session keys are not returned. Dashboard sessions can manage only live keys in live mode or keys in the selected sandbox in test mode. A key outside that environment returns 404 RESOURCE_NOT_FOUND.
Path parameters
api_key_idstringRequiredFlint API key ID. Must be a valid ID with prefix key_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Response · 200
The requested API key metadata.
dataobjectRequiredResource, collection, or operation result returned by this request.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
fullread_onlyrestricted
api_key_idstringRequiredUnique identifier for this api key, prefixed `key_`.
created_atstringRequiredRFC3339 timestamp.
created_byobjectWho created this key: the API key or workload identity whose credential made the request, or else the user, including through the Dashboard, a CLI login, or an onboarding session. An API key creator can belong to another mode, such as a live key that creates a sandbox key. Keys a workload token created before Flint recorded workload identity creators name the user who set up that workload identity. Filter the list with `created_by_type` and `created_by_id`. Absent when the creator is unavailable.
created_by_user_idstringThe user accountable for this key: the user who created it, or who created the API key or workload identity that did. `created_by` names the credential that made the request.
expires_atstringRFC3339 timestamp.
key_prefixstringRequiredThe start of the secret key: its `flint_` mode prefix and the first 8 characters of the random part. It identifies the key in a list without revealing the secret, which only the create response returns.
last_used_atstringRFC3339 timestamp.
merchant_idstringRequiredID of the merchant this resource belongs to.
namestringRequiredThe label the key was given, 1 to 100 characters.
partner_app_install_idstring or nullRequiredThe connected app install this key is linked to. The key is revoked when that install is revoked or loses its grant for this key's environment. Null when the key is unlinked. Never changes.
revoked_atstringWhen this key was revoked, in RFC 3339 format. Present only for revoked keys. For keys revoked before revocation timestamps were recorded, this is the last update time.
sandbox_idstringID of the sandbox this resource belongs to.
scopesarray of enumRequiredThe scopes the key holds now. For full and read_only keys this list grows when Flint adds scopes.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
statusenumRequiredCurrent key status. A non-revoked key is expired when expires_at is at or before the current time; otherwise it is active. Revoked keys remain revoked regardless of expires_at.
activeexpiredrevoked
supported_actionsarray of enumRequiredLifecycle actions Flint accepts now. Active and expired keys can be revoked; revoked keys accept none.
revoke
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/api-keys/key_01KEZF7C008CTC2G5V6J08M6S7 \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The requested API key metadata.
{
"data": {
"access": "restricted",
"api_key_id": "key_01KEZF7C007F5ZGD2ZXDWJGD76",
"created_at": "2026-03-17T14:30:00Z",
"created_by": {
"resource_id": "usr_01K0P7W6A4N9F3J2T8Q5R1C6XM",
"resource_type": "user"
},
"expires_at": "2027-03-17T14:30:00Z",
"key_prefix": "example",
"last_used_at": "2026-03-17T15:00:00Z",
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"name": "Sandbox orders integration",
"partner_app_install_id": null,
"sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
"scopes": [
"accounts.api_keys.read",
"accounts.api_keys.write",
"commerce.orders.read",
"commerce.orders.write"
],
"status": "active",
"supported_actions": [
"revoke"
],
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6PPKZFMV6QYJMRKT8A6D7"
}Update an API key#
/v1/api-keys/{api_key_id}IdempotentRequires scope accounts.api_keys.write
Rate limit: sensitive_write
Updates an API key's name, access, scopes, or expires_at. Expired keys can be updated, and a future expires_at reactivates one. A revoked key can't be updated. An API key caller may grant only scopes it holds and can manage only keys whose scopes it holds. Dashboard sessions can manage only live keys in live mode or keys in the selected sandbox in test mode. A key outside that environment returns 404 RESOURCE_NOT_FOUND.
Path parameters
api_key_idstringRequiredFlint API key ID. Must be a valid ID with prefix key_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
Send exactly one of these
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
full
expected_versionintegerResource version last read by the caller. Required when access or scopes is present. Optional for scalar updates.
expires_atstring or nullFuture RFC3339 timestamp. Send null to clear an existing API-key expiration.
namestringA label that helps you tell keys apart, 1 to 100 characters. Omit to keep the current name; `null` is rejected. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
read_only
expected_versionintegerResource version last read by the caller. Required when access or scopes is present. Optional for scalar updates.
expires_atstring or nullFuture RFC3339 timestamp. Send null to clear an existing API-key expiration.
namestringA label that helps you tell keys apart, 1 to 100 characters. Omit to keep the current name; `null` is rejected. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
accessenumRequiredKey access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.
restricted
expected_versionintegerResource version last read by the caller. Required when access or scopes is present. Optional for scalar updates.
expires_atstring or nullFuture RFC3339 timestamp. Send null to clear an existing API-key expiration.
namestringA label that helps you tell keys apart, 1 to 100 characters. Omit to keep the current name; `null` is rejected. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
scopesarray of enumRequiredThe scopes to grant. Required only with access restricted; forbidden with full or read_only.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
expected_versionintegerResource version last read by the caller. Required when access or scopes is present. Optional for scalar updates.
expires_atstring or nullFuture RFC3339 timestamp. Send null to clear an existing API-key expiration.
namestringA label that helps you tell keys apart, 1 to 100 characters. Omit to keep the current name; `null` is rejected. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
scopesarray of enumThe scopes to grant. Required only with access restricted; forbidden with full or read_only.
accounts.api_keys.readaccounts.api_keys.writeaccounts.devices.readaccounts.devices.writeaccounts.workload_identities.readaccounts.workload_identities.writeanalytics.readcheckouts.checkout_sessions.readcheckouts.checkout_sessions.writecheckouts.payment_links.readcheckouts.payment_links.writecheckouts.shops.readcheckouts.shops.writecommerce.bundles.readcommerce.bundles.writecommerce.catalog.readcommerce.catalog.writecommerce.credit_notes.readcommerce.credit_notes.writecommerce.delivery.readcommerce.delivery.writecommerce.gift_cards.adjustments.writecommerce.gift_cards.readcommerce.gift_cards.redemptions.writecommerce.gift_cards.secrets.writecommerce.gift_cards.writecommerce.inventory.allocation.writecommerce.inventory.policies.writecommerce.inventory.readcommerce.inventory.writecommerce.invoices.readcommerce.invoices.writecommerce.license_keys.readcommerce.license_keys.secrets.writecommerce.license_keys.writecommerce.orders.readcommerce.orders.writecommerce.products.readcommerce.products.writecommerce.promotions.readcommerce.promotions.writecommerce.refunds.readcommerce.refunds.tax_overrides.writecommerce.refunds.writecommerce.returns.operations.writecommerce.returns.policies.writecommerce.returns.readcommerce.returns.reasons.writecommerce.returns.resolutions.writecommerce.returns.writecommerce.subscription_plans.readcommerce.subscription_plans.writecommerce.subscriptions.readcommerce.subscriptions.writecommerce.tickets.readcommerce.tickets.writecustomers.readcustomers.sessions.writecustomers.writedeveloper.merchant_signups.readdeveloper.merchant_signups.writedeveloper.partner_apps.readdeveloper.partner_apps.writedeveloper.request_logs.readdeveloper.request_logs.self.readdeveloper.resource_timelines.readdeveloper.sandboxes.readdeveloper.sandboxes.writedeveloper.test_clocks.readdeveloper.test_clocks.writemerchant_billing.readmerchants.account_sessions.writemerchants.locations.readmerchants.locations.writemerchants.onboarding.readmerchants.onboarding.writemerchants.profile.readmerchants.profile.writemoney_movement.balance_transactions.readmoney_movement.balances.readmoney_movement.payment_splits.readmoney_movement.payout_settings.readmoney_movement.payout_settings.writemoney_movement.payouts.readmoney_movement.payouts.writemoney_movement.platform_fees.readpayments.disputes.readpayments.disputes.writepayments.payment_intents.readpayments.payment_intents.writepayments.payment_method_domains.readpayments.payment_method_domains.writepayments.payment_methods.readpayments.payment_methods.writepayments.readers.readpayments.readers.writereports.readreports.writerisk.controls.writerisk.readrisk.reviews.writesettings.readsettings.writewebhooks.readwebhooks.write
curl -X PATCH https://api.withflintpay.com/v1/api-keys/key_01KEZF7C008CTC2G5V6J08M6S7 \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"access": "restricted",
"expected_version": 1,
"expires_at": "2027-06-17T14:30:00Z",
"name": "Sandbox orders readonly",
"scopes": [
"accounts.api_keys.read",
"commerce.orders.read"
]
}'Revoke an API key#
/v1/api-keys/{api_key_id}/revokeIdempotentRequires scope accounts.api_keys.write
Rate limit: sensitive_write
Permanently revokes an external API key and returns metadata with status revoked. A CLI login with accounts.api_keys.write can revoke a key in its own merchant and environment context even when the key holds broader scopes. API keys and workload credentials must also hold the target key's scopes. Dashboard sessions can manage only live keys in live mode or keys in the selected sandbox in test mode. A key outside that environment returns 404 RESOURCE_NOT_FOUND. An onboarding session with permission to manage API keys can revoke unlinked external keys in any active sandbox of its merchant.
Path parameters
api_key_idstringRequiredFlint API key ID. Must be a valid ID with prefix key_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
expected_versionintegerVersion last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.
curl -X POST https://api.withflintpay.com/v1/api-keys/key_01KEZF7C008CTC2G5V6J08M6S7/revoke \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1
}'Get the current authentication context#
/v1/auth-contextRequires an API key. No scope needed.
Rate limit: read
Returns non-secret metadata for the credential that sent the request, as one object per credential type selected by auth_type. API keys, CLI logins, workload identities, partner apps, and onboarding sessions are accepted. No scope is required.
Response · 200
The calling credential and its current access
dataone ofRequiredResource, collection, or operation result returned by this request.
One of these shapes
Non-secret metadata for the calling credential, selected by auth_type.
accessenumRequiredAccess level; scoped tokens always have restricted access.
fullread_onlyrestricted
api_key_idstringRequiredID of the API key.
auth_typeenumRequiredCredential type that selects this object's fields.
api_key
expires_atstringTime the credential expires; absent for keys without an expiry.
merchant_idstringRequiredMerchant the credential acts for.
modeenumRequiredWhether the credential acts in test or live mode.
testlive
namestringRequiredName of the key, CLI context, or workload identity.
organization_idstringOrganization selected by the key's access scope, when available.
partner_app_install_idstring or nullRequiredID of the partner app install. Null when the API key is not linked to an install.
sandbox_idstringSandbox the credential is bound to, present only in test mode.
scopesarray of stringRequiredCurrent granted API scopes, resolved at request time for full and read_only keys.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/auth-context \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The calling credential and its current access
{
"data": {
"access": "restricted",
"api_key_id": "key_01KEZF7C00Q6S9W2D8HF4YBN3T",
"auth_type": "api_key",
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"mode": "test",
"name": "Backend integration",
"partner_app_install_id": null,
"sandbox_id": "test_01KEZF7C00JVWYYN2SBWFFSA36",
"scopes": [
"commerce.orders.read"
]
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Was this helpful?