ElebneElebneDocs
Getting Started

Authentication

API key types, scopes, security best practices, and how to authenticate requests to the Elebne Developer API.

Authentication

Every request to the Elebne Developer API must include a valid API key. This page covers key types, how to pass them, the scope system, and security best practices.

API key types

KeyPrefixPermissionUsage
Publishable Testpk_test_Read onlyClient-safe, sandbox queries
Secret Testsk_test_Read + WriteServer-side, sandbox mutations
Publishable Livepk_live_Read onlyClient-safe, production queries
Secret Livesk_live_Read + WriteServer-side, production mutations
  • Publishable keys (pk_) can only read data. They are safe to include in client-side code.
  • Secret keys (sk_) can read and write. They must only be used on your server.
  • Test keys operate in sandbox mode — no real money is moved.
  • Live keys operate in production — real transactions with real funds.

Authorization header

Pass your API key in the Authorization header as a Bearer token:

Authorization: Bearer sk_test_YOUR_KEY

Requests without a valid key return 401 Unauthorized.

Scopes

API keys are assigned granular scopes that control which endpoints they can access. Scopes are grouped by surface area.

Pay scopes

ScopeDescriptionRequires secret key
pay.intents:readList and retrieve payment intentsNo
pay.intents:writeCreate, update, cancel, and refund payment intentsYes

Store scopes

ScopeDescriptionRequires secret key
store.products:readList and retrieve productsNo
store.products:writeCreate, update, and delete productsYes
store.orders:readList and retrieve ordersNo
store.orders:writeUpdate order status, fulfill ordersYes
store.inventory:readRead inventory levelsNo
store.inventory:writeUpdate stock quantitiesYes
store.import:writeImport products via CSVYes

Enterprise scopes

ScopeDescriptionRequires secret key
enterprise.transfers:readList and retrieve transfersNo
enterprise.transfers:writeCreate transfersYes
enterprise.bulk:writeCreate bulk transfersYes
enterprise.bills:writePay billsYes
enterprise.ledger:readRead ledger entriesNo

Webhook scopes

ScopeDescriptionRequires secret key
webhooks.endpoints:readList webhook endpointsNo
webhooks.endpoints:manageCreate, update, and delete endpointsYes
webhooks.deliveries:readList webhook event deliveriesNo
webhooks.deliveries:retryRetry failed deliveriesYes

IP allowlist

For additional security, you can restrict API access to specific IP addresses:

  1. Open the Elebne mobile app, go to Commerce > Developer.
  2. Under IP Allowlist, add your server's IP addresses.
  3. Requests from unlisted IPs will be rejected with 403 Forbidden.

Optional in sandbox

IP allowlists are optional but strongly recommended for production keys.

Key rotation

You can rotate your API keys at any time:

  1. Go to Commerce > Developer in the Elebne mobile app.
  2. Tap Rotate next to the key you want to replace.
  3. A new key is generated immediately. The old key is invalidated.

Rotation is immediate

Once you rotate a key, the old key stops working instantly. Update your integration before rotating.

Security best practices

  • Never expose secret keys in client-side code. Use pk_ keys for browser and mobile apps; keep sk_ keys on your server only.
  • Rotate keys regularly. If a key may have been compromised, rotate it immediately.
  • Use IP allowlists in production. Restrict live keys to your server IPs.
  • Use the minimum required scopes. Request only the scopes your integration needs.
  • Store keys in environment variables. Never commit keys to version control.
  • Use HTTPS only. The API rejects plain HTTP requests.

Next steps

  • Sandbox — Test your integration without real money
  • Common Patterns — Required headers, amounts, pagination
  • Webhooks — Verify webhook signatures

Was this page helpful?

On this page