Making API Requests

The JAVIS API follows standard RESTful conventions and uses JSON-based request and response formats. All API calls must include the appropriate headers and authentication tokens.


🌍 Base URL Structure

JAVIS APIs follow a consistent base URL structure across environments:

EnvironmentBase URL
Staginghttps://sandbox.api.javis.ai/api/v1/
User Acceptance Testing (UAT)https://partners-uat.javis.ai/api/v1/
Production (Prod)https://api.javis.ai/api/v1/
⚠️

Versioning: The API currently does not support explicit versioning.


🔗 Required Headers

All requests must include the following headers:

Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json
  • Authorization → Required for authentication (OAuth 2.0 Bearer Token)
  • Content-Type → Specifies the request body format (application/json)
  • Accept → Ensures responses are returned in JSON format

📡 HTTP Methods & Conventions

JAVIS API follows standard RESTful HTTP methods:

MethodDescription
GETRetrieve data (e.g., fetch purchase orders, invoices).
POSTCreate new records (e.g., create purchase orders).
PUT/PATCHUpdate existing records (e.g., update inventory).
DELETERemove records (e.g., delete transactions).

📥 Example Requests

1️⃣ Retrieving Purchase Orders (GET Request)

curl --request GET \
  --url "https://sandbox.api.javis.ai/api/v1/purchase-orders" \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Accept: application/json"

2️⃣ Creating a Purchase Order (POST Request)

curl --request POST \
  --url "https://sandbox.api.javis.ai/api/v1/purchase-orders" \
  --header "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "purchaseOrderNumber": "PO12345",
    "orderState": "NEW",
    "items": [
      { "articleCode": "ITEM001", "quantity": 10 }
    ]
  }'

🔄 Response Structure

All responses follow a consistent JSON format:

✅ Success Response

{
  "status": "success",
  "data": {
    "purchaseOrderNumber": "PO12345",
    "orderState": "NEW"
  },
  "error": null
}

❌ Error Response

{
  "status": "error",
  "error": {
    "code": 400,
    "message": "Invalid request parameters."
  }
}

📊 Pagination (Upcoming Feature)

Although pagination is not yet supported, it will be introduced using the following parameters:

ParameterDescription
limitNumber of records per request (e.g., limit=50).
offsetSkip a number of records (e.g., offset=100).

Example future request:

GET /api/v1/purchase-orders?limit=50&offset=100