API Reference
Waqti provides a RESTful API for programmatic access to procurement data.
Base URL
Production: https://api.waqti.sa/v1Authentication
All API requests require authentication using Bearer tokens.
Getting an API Token
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy the token (shown only once)
Using the Token
bash
curl -X GET "https://api.waqti.sa/v1/purchase-orders" \
-H "Authorization: Bearer 3|a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0" \
-H "Accept: application/json"Token Security
- Tokens never expire but can be revoked
- Store tokens securely (environment variables)
- Never commit tokens to version control
Request Format
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token |
Accept | Yes | application/json |
Content-Type | For POST/PUT | application/json |
Accept-Language | No | en or ar (default: en) |
Query Parameters
Common query parameters for list endpoints:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 15, max: 100) |
sort | string | Sort field (e.g., created_at) |
order | string | asc or desc |
search | string | Search term |
Response Format
Success Response
json
{
"data": {
"id": 1,
"po_number": "PO-2025-0042",
"status": "approved"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z"
}
}List Response
json
{
"data": [...],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 73
},
"links": {
"first": "https://api.waqti.sa/v1/purchase-orders?page=1",
"last": "https://api.waqti.sa/v1/purchase-orders?page=5",
"next": "https://api.waqti.sa/v1/purchase-orders?page=2",
"prev": null
}
}Error Response
json
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The given data was invalid.",
"details": {
"vendor_id": ["The vendor id field is required."]
}
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "req_abc123"
}
}HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
204 | No Content (successful delete) |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
422 | Validation Error |
429 | Rate Limited |
500 | Server Error |
Rate Limiting
API requests are rate limited per token:
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Basic | 60 | 1,000 |
| Professional | 300 | 10,000 |
| Enterprise | 1,000 | Unlimited |
Rate limit headers are included in every response:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 297
X-RateLimit-Reset: 1705312200Available Endpoints
Purchase Orders
GET /purchase-orders- List POsPOST /purchase-orders- Create POGET /purchase-orders/{id}- Get POPUT /purchase-orders/{id}- Update PODELETE /purchase-orders/{id}- Delete POPOST /purchase-orders/{id}/submit- Submit for approval
Vendors
GET /vendors- List vendorsPOST /vendors- Create vendorGET /vendors/{id}- Get vendorPUT /vendors/{id}- Update vendor
Budgets
GET /budgets- List budgetsGET /budgets/{id}- Get budgetGET /budgets/{id}/utilization- Get utilization
Invoices
GET /invoices- List invoicesPOST /invoices- Create invoiceGET /invoices/{id}- Get invoice
Webhooks
Register webhooks to receive real-time notifications:
bash
POST /webhooks
{
"url": "https://your-app.com/webhook",
"events": ["po.approved", "invoice.created"]
}Sandbox Environment
Test your integration with our sandbox:
Base URL: https://api.sandbox.waqti.sa/v1Sandbox data is reset daily at 00:00 UTC.
Support
- Technical Support: api-support@waqti.sa
- WhatsApp: +966 55 578 4686
- API Changelog: /changelog