---
title: "API conventions"
---

How SaaSify shapes responses, reports errors, paginates lists, and names things — read this before you parse your first response.

:::note
Base URLs: `https://api.saasify.ai` (production). Test against
`https://api-demo.saasify.ai` (demo). See [Environments](/developers/environments).
:::

## The response envelope

Every endpoint returns the same wrapper around its payload. Field names are PascalCase, and enum values are serialized as strings.

```json
{
  "OperationType": null,
  "Status": "SUCCESS",
  "RequestCorrelationID": "f1e2d3c4-...",
  "ErrorDetail": null,
  "Data": { "...": "your payload" },
  "StatusCode": null,
  "ErrorMessage": ""
}
```

| Field | What it holds |
|---|---|
| `Status` | `"SUCCESS"` or `"ERROR"`. **Check this first.** |
| `Data` | The operation's payload on success. See the note on double-encoding below. |
| `ErrorMessage` | A human-readable message when `Status` is `"ERROR"`. |
| `RequestCorrelationID` | An ID for this request. Include it when you contact support. |
| `ErrorDetail` | Diagnostic detail. Treat it as opaque — do not parse it or depend on its shape. |

:::warning[`Data` may be a JSON string]
For some endpoints, `Data` is not a JSON object but a JSON **string** that itself contains JSON (it comes straight from the database as text). When `Data` is a string, parse it a second time to get the object. Check the type before you parse.
:::

## Errors can arrive as HTTP 200

The most important thing to know: **many business errors come back with HTTP status `200 OK` and `Status: "ERROR"` in the body.** If you branch on the HTTP status code alone, you will treat failures as successes.

A failed call often looks like this — note the `200`:

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "ERROR",
  "ErrorMessage": "Subscription not found for the given identifier.",
  "Data": null
}
```

Always gate on `Status` before you trust `Data`:

:::code-group
```python title="Python"
r = requests.post(url, json=body, headers=headers)
r.raise_for_status()            # catches transport/5xx errors
payload = r.json()
if payload["Status"] != "SUCCESS":
    raise RuntimeError(payload.get("ErrorMessage", "SaaSify request failed"))
data = payload["Data"]
```
```javascript title="Node"
const resp = await fetch(url, { method: "POST", headers, body });
const payload = await resp.json();
if (payload.Status !== "SUCCESS") {
  throw new Error(payload.ErrorMessage || "SaaSify request failed");
}
const data = payload.Data;
```
:::

For the HTTP status codes SaaSify *does* set, and what common errors mean, see the [Error catalog](/developers/errors).

## Pagination

Pagination is not uniform across endpoints — follow the parameters listed for each operation in the [API reference](/developers/api-reference). In general:

- List endpoints take their paging and sorting inputs either as query parameters or in a POST body, using some combination of `StartIndex` (1-based), `PageSize`, `PageNumber` / `PageNo`, `SearchText`, `SortColumn` and `SortOrder`.
- The total count comes back **inside `Data`**, under a name such as `TotalCount`, `TotalRecords` or `TotalDataCount`, depending on the endpoint.
- There are no cursors and no `Link` headers.

Read an operation's reference entry for its exact parameter names before you page through it.

## Identifiers

SaaSify uses several kinds of identifier. Match the one an endpoint asks for:

| Identifier | What it is |
|---|---|
| `subscriptionId` | A subscription, usually a GUID. |
| `sellerCode` | A seller account for one cloud. Many resource URLs are scoped by it. |
| `dealReferenceID` | A private offer / deal. |
| `referenceId` | A reference key used by leads and some other objects. |
| `saasifyRecordId` | SaaSify's internal record ID, used by co-sell and integration endpoints. |
| `crmID` / `crmId` | Your CRM's ID for a record, accepted on lookup endpoints that bridge to a CRM. |

See the [glossary](/concepts/glossary) for how these map to the clouds.

## Dates

Dates and times in responses are ISO 8601 strings. Where an endpoint needs a time window (for example, usage reporting), send timestamps in the format shown in that operation's reference entry.


## Versioning

There is no platform-wide API version header. Some routes carry an ad-hoc version segment in the path (for example `api/v2/subscriptions/...`, `api/cosell/v3/...`, `api/benefits/v1/...`). Use the exact path shown in the [API reference](/developers/api-reference); the published reference is the "v1" surface and its shapes are the ones to build against.

## Related

::::cards
:::card[Error catalog]{href="/developers/errors"}
Status codes and common errors.
:::
:::card[Rate limits and best practices]{href="/developers/rate-limits"}
Polite polling and backoff.
:::
:::card[Authentication]{href="/developers/authentication"}
Get and send a token.
:::
::::
