Base URL: https://api.mofavo.com
Available APIs:
POST /woocommerce/stock) - Get product stock quantitiesPOST /woocommerce/status) - Get order status and destinationBoth APIs use the same authentication method.
All requests require two things:
Include in the Authorization header:
Authorization: Bearer <your-jwt-token>
Include in the x-mofavo-signature header:
x-mofavo-signature: <base64-encoded-signature>
Create a signature using HMAC-SHA256 (don’t forget to use your real secret key in <your-secret-key>). The result should be encoded as a base64 string:
const crypto = require('crypto');
const signature = crypto
.createHmac('sha256', '<your-secret-key>')
.update(JSON.stringify(requestBody), 'utf8')
.digest('base64');
| Header | Value |
|---|---|
Authorization |
Bearer <your-jwt-token> |
x-mofavo-signature |
<base64-encoded-signature> |
Content-Type |
application/json |
Endpoint: POST /woocommerce/stock
Get stock quantities for products by their reference codes.
Note: Replace product-ref-1 and product-ref-2 with your actual product reference codes.
{
"refs": ["product-ref-1", "product-ref-2"]
}
{
"success": true,
"products": [
{
"ref": "product-ref-1",
"quantity": 10
},
{
"ref": "product-ref-2",
"quantity": 5
}
]
}
Note: Only products that match the refs AND belong to your merchant will be returned.
curl -X POST https://api.mofavo.com/woocommerce/stock \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-jwt-token>" \
-H "x-mofavo-signature: <base64-encoded-signature>" \
-d '{"refs": ["product-ref-1", "product-ref-2"]}'
Endpoint: POST /woocommerce/status
Get order status and destination information by their WooCommerce order reference codes.
Note: Replace ref-order1 and ref-order2 with your actual order reference codes.
{
"refs": ["ref-order1", "ref-order2"]
}
{
"success": true,
"orders": [
{
"ref": "ref-order1",
"status": "draft",
"finalDestination": "address-1"
},
{
"ref": "ref-order2",
"status": "readyForPickUp",
"finalDestination": "address-2"
}
]
}
Response fields:
ref - Order’s woocomerce referencestatus - Current order status (e.g., “draft”, “readyForPickUp”, “inTransit”)finalDestination - Delivery addressNote: Only orders that match the refs AND belong to your merchant will be returned.
curl -X POST https://api.mofavo.com/woocommerce/status \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-jwt-token>" \
-H "x-mofavo-signature: <base64-encoded-signature>" \
-d '{"refs": ["ref-order1", "ref-order2"]}'
Both APIs return the same error responses:
| Status | Error | Description |
|---|---|---|
| 400 | Invalid request payload |
Missing refs field or invalid format |
| 401 | Missing or invalid Authorization header |
Authorization header missing or malformed |
| 401 | Invalid token |
JWT token is malformed or cannot be verified |
| 401 | Invalid token payload |
Token missing required fields (merchantId or jti) |
| 401 | Token revoked or not found |
Token doesn’t exist, is inactive, or revoked |
| 401 | Invalid signature |
Request signature doesn’t match payload |
| 404 | Product not found / Order not found |
No items found matching the refs |
| 500 | Internal server error |
Unexpected server error |
Error Response Format:
{
"success": false,
"error": "Error message"
}
Or for authorization errors:
{
"message": "Error message"
}
For issues or questions, please contact your API administrator or refer to the internal documentation.