zenly/Documentação
Buscar na documentação
Português
API referenceContracts

Get a contract

GET/v1/contracts/{id}
Authorization

Any active key, sent as a bearer token. Keys are owner-equivalent, so there are no scopes to grant and nothing to configure per endpoint. See Authentication.

Parameters
idstring (uuid)pathREQUIRED

Edit any field above and the request updates as you type. Empty fields are left out.

Response fields
accessBlockedboolean
allLocationsboolean

When true the contract is usable at every location and locationIds is empty

billingIntervalstring (enum)OPTIONAL
billingKindstring (enum)
cancelledAtstring (date-time)OPTIONAL
clientIdstring
createdAtstring (date-time)
currencystring
endDatestring (date)OPTIONAL

Inclusive last day. Absent on an open-ended term.

entitlementsarray of ContractEntitlementBody

Empty when listing; read one contract for its balances.

8 fields per item
idstring
maxVisitsPerPeriodinteger (int32)OPTIONAL
periodstring (enum)OPTIONAL
remainingCreditsinteger (int32)OPTIONAL

Present only for type=credits

revokedAtstring (date-time)OPTIONAL

Set when plan propagation withdrew this grant. It covers no new booking; what it already drew stands.

serviceGroupIdstringOPTIONAL

Scope reference, not an expansion: what the group holds is live catalog, so this contract follows it.

serviceTypeIdstringOPTIONAL
typestring (enum)
idstring
isTrialboolean
locationIdsarray of string
planIdstringOPTIONAL

The plan it was sold from. Absent once that plan has been deleted; the snapshot below still stands.

planNamestring
priceCentsinteger (int64)

Integer minor units of currency, as agreed at signup

startDatestring (date)
statusstring (enum)
termsRespondedAtstring (date-time)OPTIONAL
termsResponsestring (enum)OPTIONAL

The member's answer to the agreement. Absent while it is unanswered or the plan carried no terms.

updatedAtstring (date-time)
Errors

These apply to every endpoint on the API, not just this one. Errors covers the body shape.

401
Unauthorized

No bearer token, or a token that is unknown, revoked or expired. All four answer identically on purpose, so a caller probing tokens learns nothing about which is which.

402
Payment Required

The organization’s plan does not include the public API. It is available on Pro and above, and the check runs on every request, so a downgrade stops keys that were minted earlier.

403
Forbidden

The organization is not active.

429
Too Many Requests

The key is over its rate limit. Back off and retry.

500
Internal Server Error

Something failed on our side. The body carries a short sentence and never an internal error string, so quote your own request timestamp when reporting one.

stays in this tab
cURL
curl "https://api.zenly.app.br/v1/contracts/019f9a89-62bf-750a-bdc0-375919dea60a" \
  -H "Authorization: Bearer $ZENLY_API_KEY"
Response200 OK
{
  "accessBlocked": false,
  "allLocations": false,
  "billingInterval": "week",
  "billingKind": "recurring",
  "cancelledAt": "2026-01-31T09:00:00Z",
  "clientId": "string",
  "createdAt": "2026-01-31T09:00:00Z",
  "currency": "string",
  "endDate": "2026-01-31",
  "entitlements": [
    {
      "id": "string",
      "maxVisitsPerPeriod": 0,
      "period": "day",
      "remainingCredits": 0,
      "revokedAt": "2026-01-31T09:00:00Z",
      "serviceGroupId": "string",
      "serviceTypeId": "string",
      "type": "access"
    }
  ],
  "id": "string",
  "isTrial": false,
  "locationIds": [
    "string"
  ],
  "planId": "string",
  "planName": "string",
  "priceCents": 0,
  "startDate": "2026-01-31",
  "status": "active",
  "termsRespondedAt": "2026-01-31T09:00:00Z",
  "termsResponse": "accepted",
  "updatedAt": "2026-01-31T09:00:00Z"
}