Authentication
Sedra uses a different credential for each kind of caller. Never reuse one for another purpose.
| Caller | Credential | Where it may live | Used with |
|---|---|---|---|
| Storefront or shopping app | Publishable key pk_… |
Anywhere, including browsers and apps. It is not a secret. | Storefront API |
| Shopper | Customer token (JWT) from POST /auth/customer/emailpass |
The shopper’s device | Storefront API (account, orders) |
| Merchant integration | sdr_int_… |
Your server only | Merchant Agent API |
| AI assistant | sdr_ai_…, or an OAuth token issued by the MCP server |
The MCP client or your server | MCP, Merchant Agent API |
| Sedra Apple app | App session (30-minute JWT + rotating refresh token) after Sign in with Apple or Google | The app’s Keychain | Sedra App API |
| Vending machine | sdr_dev_… plus signed timestamp and nonce headers |
The device’s secure storage | Device API |
Older credentials that start with fos_ keep working.
Getting a merchant or AI credential
Section titled “Getting a merchant or AI credential”Credentials are issued by a person, never by an API call from an integration or AI:
- Today a business owner or a Sedra operator issues
sdr_int_andsdr_ai_credentials in the Sedra console, choosing the business, the role (viewer, operator, manager, owner) and read-only or operator permissions. - The secret is shown once. Sedra stores only a hash.
- Revoking a credential takes effect on the next request.
- Self-service issuing from the Sedra app is planned and not available yet.
Send it as a bearer token:
curl -X POST https://api.sedra.one/foulad/agent/invoke/platform.whoami \ -H "Authorization: Bearer $SEDRA_API_KEY" \ -H "content-type: application/json" -d '{}'Each credential acts as a member of one or more businesses with a role. Every capability declares the minimum role it needs:
viewer (read) → operator (day-to-day writes) → manager (prices, promotions, refunds requests) → owner (team and settings).
A marketplace vendor seat is limited further: it only sees and changes the vendor’s own products and order shares.
Foulad ID (planned)
Section titled “Foulad ID (planned)”Sedra will accept Foulad ID (OpenID Connect) for merchants and developers. The provider module exists in the backend but is not connected to the live Foulad ID service yet, so you cannot use it today. Sedra will not introduce a separate login system; Foulad ID will be the shared identity for Foulad products.
What never to do
Section titled “What never to do”- Never put an
sdr_int_orsdr_ai_credential in a website, a mobile app or a shopping assistant. Use the Storefront API with a publishable key there. - Never paste a credential into a public issue, chat or prompt. If you did, ask the issuer to revoke it.