Update order
Update specific fields of an existing order with HMAC signature verification and idempotency protection.
🔐 HMAC Signing (REQUIRED)
All order update requests MUST include HMAC-SHA256 signature:
- Generate Timestamp: Get current Unix timestamp in seconds
- Create Payload: Concatenate
timestamp + "." + JSON_body - Sign Payload:
HMAC-SHA256(hmac_secret, payload)→ base64 encode - Include Headers:
X-Timestamp: Unix timestamp (must be within 5 minutes)X-Signature: Base64-encoded HMAC signature
🔄 Idempotency Protection
Include Idempotency-Key header to prevent duplicate updates on retry.
Each PATCH operation is tracked separately - if you retry with the same key,
the original order state is returned without re-processing side effects.
Important: Use a unique idempotency key for each distinct update operation.
- ✅ Good:
update-shipping-{order_id}-{timestamp},mark-paid-{order_id}-{timestamp} - ❌ Bad: Reusing the same key for different updates to the same order
This prevents duplicate processing of critical operations like:
- Double-triggering accounting entries when marking as paid
- Re-reducing inventory stock
- Duplicate gift card redemptions
- Multiple promotion usage recordings
Updatable Fields:
payment_status: Payment status (pending, paid, failed, refunded)order_status: Order fulfillment status (pending, processing, shipped, delivered, cancelled)notes: Additional order notestracking_number: Shipping tracking numberestimated_delivery: Estimated delivery date/timeshipped_at: Timestamp when order was shippeddelivered_at: Timestamp when order was delivered
Automatic Accounting:
When payment_status is updated to paid, the system automatically:
- Triggers accounting entry creation (production only)
- Reduces inventory stock for all order items
- Updates customer purchase metrics
- Processes gift card redemptions (if applicable)
- Records promotion usage (if applicable)
Key Type Support:
- ✅ Secret keys (full access)
- ❌ Publishable keys (forbidden - returns 403)
Documentation Index
Fetch the complete documentation index at: https://docs.tybritelabs.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
API Key Authentication
Use your API key in the Authorization header:
Authorization: Bearer tybrite_sk_live_YOUR_KEYKey Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: write operations, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Read-only access (GET requests only, plus POST semantic search)
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - All write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Headers
Unique key to prevent duplicate updates (e.g., update-{operation}-{order_id}-{timestamp})
Unix timestamp in seconds (current time). Must be within 5 minutes of server time. Used to prevent replay attacks.
HMAC-SHA256 signature of the payload (timestamp + "." + request_body), base64-encoded. Sign using your HMAC secret from Settings → Integration Settings.
Path Parameters
Order UUID
Body
Payment status
pending, paid, failed, refunded "paid"
Order fulfillment status
pending, processing, shipped, delivered, cancelled "processing"
Additional order notes
"Customer requested gift wrapping"
Shipping tracking number
"1Z999AA10123456784"
Estimated delivery date and time
"2026-02-15T14:00:00Z"
Timestamp when order was shipped
"2026-02-10T10:30:00Z"
Timestamp when order was delivered
"2026-02-15T14:30:00Z"
Response
Order updated successfully
"ORD-2026-001234"
pending, processing, shipped, delivered, cancelled "pending"
pending, paid, failed, refunded "pending"
Method used for payment
stripe, paystack, mpesa, airtel, cash, bank_transfer "stripe"
1999.98
159.99
15
0
2174.97
Complete shipping calculation details for audit trail

