Skip to content
SIBISIBI Developers
Esc
navigateopen⌘Jpreview
On this page

Making a REST Request

How to call the SIBI REST APIs

The SIBI public REST API exposes resources for Offers, Products, Assets, Orders, and Draft Orders. You can use any HTTP client to make requests. The examples below use curl & fetch.

Endpoint

The REST API is available at: https://api.sibipro.com

Resources are exposed under the following base paths:

  • /offers — manage offers (see the Offers reference)
  • /products — look up product details (see the Products reference)
  • /orders — create, read, and cancel orders (see the Orders reference)
  • /draft-orders — price an order without placing it, then place it (see the Draft Orders reference)
  • /assets — look up installed assets and their warranty coverage (see the Assets reference)

Authentication

The SIBI REST API authenticates with a REST API token. Create one in the SIBI developer dashboard, choosing the scopes your integration needs, and send it in the Authorization header of every request, prefixed by Bearer. REST API tokens are scoped: an endpoint refuses a token that does not contain a scope it requires. See REST API Tokens for the scope catalog.

Some REST endpoints still accept GraphQL tokens, with no scope checks, because those endpoints shipped before scopes existed. That support is limited and going away — newer endpoints already refuse them with 403 REST_TOKEN_REQUIRED. Use a REST API token.

curl \
  --request GET \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  https://api.sibipro.com/offers
# => {"data": [...]}
const response = await fetch('https://api.sibipro.com/offers', {
  method: 'GET',
  headers: { Authorization: `Bearer ${yourApiKey}` },
});
const offers = await response.json();
console.log(JSON.stringify(offers, null, 2));

Making a Request

REST endpoints follow standard HTTP conventions. Use GET to read a resource and POST to create or trigger an action. Request bodies are sent as JSON with Content-Type: application/json.

Reading a resource

curl \
  --request GET \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  https://api.sibipro.com/products/<SKU>
const response = await fetch(`https://api.sibipro.com/products/${sku}`, {
  method: 'GET',
  headers: { Authorization: `Bearer ${yourApiKey}` },
});
const product = await response.json();

Sending data

curl \
  --request POST \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{"reason": "Customer requested a cancellation"}' \
  https://api.sibipro.com/orders/<ORDER_ID>/cancel
const response = await fetch(`https://api.sibipro.com/orders/${orderId}/cancel`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${yourApiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ reason: 'Customer requested a cancellation' }),
});
const result = await response.json();

Responses

Successful responses return JSON. For example, a cancellation request returns:

{
  "cancellationStatus": "pending",
  "cancellationReason": "Customer requested a cancellation",
  "requestedAt": "2024-01-20T12:00:00Z"
}

Errors

Errors are returned with a standard HTTP status code (4xx for client errors, 5xx for server errors) and a JSON body describing the failure:

{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input parameters",
  "details": [{ "field": "reason", "error": "Required" }]
}

Authentication and scope failures use these codes:

Status Code Meaning
401 UNAUTHORIZED No Authorization header, or a token we cannot resolve
403 INSUFFICIENT_SCOPE Valid REST API token, but it lacks a scope this endpoint accepts
403 REST_TOKEN_REQUIRED A GraphQL token was sent to an endpoint that requires a REST API token
403 TOKEN_ENVIRONMENT_MISMATCH The token was minted for the other environment

For full schema details and the complete list of endpoints, see the per-resource references in the navigation.

Was this page helpful?