Access modes
Find the access mode in the operation contract.
Choose the operation in the API reference first, then use its documented credential and scope. The table separates the callers so an integration does not mix a merchant API key with a browser session.
| Mode | Credential | Current use |
|---|---|---|
| Public | None | API discovery, health, dependency status, OpenAPI and selected public claim or campaign resources. |
| API key | Authorization: Bearer rbx_… | Server-to-server order ingestion, refund recording and return recording. |
| Session | Secure host-only session cookie plus CSRF token for mutations | First-party merchant, cardholder and administration portals. |
Check the x-authentication annotation on each operation in the Platform OpenAPI document. Do not substitute an API key for a session-only route.
API keys
Keep each API key tied to its tenant and environment.
- Format
- Bearer credentials begin with
rbx_. The prefix is not a separate header name. - Ownership
- Each key belongs to one approved tenant and one environment.
- Current runtime scope
orders:writeauthorizes the three documented API-key operations. Do not rely on unused scope names as functional permissions.- Visibility
- The full value is returned only at creation. Later listings expose a prefix, status, scopes and usage metadata.
- Expiration
- A key may have an expiry time. Expired and revoked keys fail authentication.
Authenticated requestHTTP
POST /api/v1/orders HTTP/1.1
Host: api.rebatecardx.com
Authorization: Bearer <RBX_API_KEY>
Content-Type: application/json
Idempotency-Key: <UNIQUE_KEY_16_TO_200_CHARACTERS>Secret handling
Keep the key outside every client surface.
- Load the key from a managed secret store at runtime.
- Never embed it in browser JavaScript, mobile binaries, Shopify themes or downloadable configuration.
- Never commit it to source control or paste it into tickets, chat messages, analytics or logs.
- Redact the
Authorizationheader at ingress, egress and observability boundaries. - Use separate staging and production secrets and rotate a key if exposure is suspected.
CORS is restricted to official Rebate Card X origins. API keys are intended for approved server-to-server integrations.
Failures
Separate an invalid credential from a missing permission.
Use the error code to decide whether the credential needs attention or the requested operation is outside its permissions. The error guide explains the broader response and retry conventions.
| Status | Typical code | Meaning |
|---|---|---|
| 401 | API_KEY_REQUIRED | The operation requires a bearer key and none was accepted. |
| 401 | INVALID_API_KEY | The key is invalid, revoked, expired or does not belong to an approved tenant. |
| 403 | INSUFFICIENT_SCOPE | The key is valid but lacks the operation's required scope. |
| 403 | TENANT_STATUS_RESTRICTED | The tenant state does not permit the requested operation. |