Production Checklist¶
Use this checklist before sending production traffic through Spendware.
Runtime Integration¶
- Use customer keys with
preflight:readandusage:writefor provider-adapter traffic. - Keep management keys server-side only.
- Configure runtime context for multi-tenant services.
- Ensure SDK shutdown or cleanup runs during process shutdown.
- Choose strict or best-effort preflight behavior deliberately.
Usage And Billing¶
- Send raw token and request counts for writes.
- Use stable external IDs for assets from your application.
- Use idempotency keys for retried side effects.
- Verify usage analytics and billing previews with real date windows.
- Confirm currency and provider pricing rules before using billing output.
- Confirm the first runtime event is visible in analytics before treating an integration as activated. Do not use a synthetic event as the production smoke test.
- Create and activate a default billing template when your Spendware plan includes templates; keep template customization separate from the first-event activation path.
Webhooks¶
- Verify signatures against the raw request body.
- Store endpoint signing secrets securely.
- Return
2xxonly after durable processing. - Deduplicate deliveries by event ID or delivery ID.
- Test endpoint delivery before subscribing production workflows.
Observability And Support¶
- Capture request IDs, event IDs, delivery IDs, customer IDs, project IDs, and external IDs in your logs.
- Do not log raw keys, provider credentials, prompts, webhook secrets, or sensitive payloads.
- Document your retry behavior and alert on persistent webhook failures.
Smoke Test¶
```bash
curl "$SPENDWARE_BASE_URL/api/v1/usage/query-usage?include_statistics=true" \
-H "Authorization: Bearer $SPENDWARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_ids":["PROJECT_ID"],"customer_ids":["CUSTOMER_ID"]}'
```
```python
usage = client.usage.query(
{"project_ids": ["PROJECT_ID"], "customer_ids": ["CUSTOMER_ID"]},
include_statistics=True,
)
print(usage)
```
```typescript
const usage = await client.usage.query(
{ project_ids: ["PROJECT_ID"], customer_ids: ["CUSTOMER_ID"] },
{ includeStatistics: true },
);
console.log(usage);
```