Memberships API (0.1.0)

Download OpenAPI specification:

Memberships as multi-seat plans. Responses are JSON:API 1.1 documents in the PHP APIs' shapes, served as application/vnd.api+json: a single resource is { data } alone; a collection is { links, data, meta } with the page counts directly under meta; an error document is { errors }, each error as Dusk renders it: { status, title, source?, detail }. Three departures from the spec, all the PHP APIs': a collection's previous-page link is previous, not prev; an error's status is an integer; and its source is the field's name as a plain string (dot notation when nested), not an object. Write requests (POST, PATCH) send a flat JSON object of attributes as application/json (charset=utf-8 allowed), not a JSON:API document; the id is the URL's on PATCH and server-generated on POST. The request id is the X-Request-Id response header; no body carries it.

System

Liveness

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Subscriptions API connectivity, member path

Call with a member's X-Auth-Token. Reads the caller's own Subscriptions API customer with the default token and their X-USER-ID forwarded as X-User-ID; no token registry read. A member with no customer there yet still passes, since the API answered. Says whether a customer exists, never any of its data. This is not the path a member's real calls take: those resolve a client first.

Authorizations:
gatewayMemberTokengatewayServiceKey

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Subscriptions API connectivity, client path

Call with a client's X-Api-Token. Presents the Subscriptions API token this API holds for the caller's X-Authorized-Client on a one-row products read. Says whether the client has a token of its own or uses the default, never which token. A pass proves the token is valid and unexpired, not that it carries the claims the client needs. A fault in the client's token configuration answers 500. The member path is GET /health/subscriptions/member.

Authorizations:
gatewayMemberTokengatewayServiceKey

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Plan types

List plan types

Client audiences see active rows only; the admin audience sees every row, inactive and retired included, and may filter by status.

Authorizations:
gatewayMemberTokengatewayServiceKey
query Parameters
page[number]
integer [ 1 .. 1000 ]
Default: 1
Example: page[number]=1
page[size]
integer [ 1 .. 100 ]
Default: 25
Example: page[size]=25
filter[status]
string
Enum: "inactive" "active" "retired"
Example: filter[status]=active
sort
string^-?(name|createdAt|updatedAt)(,-?(name|create...
Example: sort=-createdAt

Responses

Response samples

Content type
application/vnd.api+json
{
  • "links": {
    },
  • "data": [
    ],
  • "meta": {
    }
}

Create a plan type

The row is created inactive: it is not orderable and not in the client collection until it is activated. Its name must not belong to any non-retired plan type, inactive or active.

Authorizations:
gatewayMemberTokengatewayServiceKey
Request Body schema: application/json
required
name
required
string [ 1 .. 120 ] characters
seatCap
required
integer or null >= 1

Maximum seats a plan of this type may hold. null = unbounded.

Responses

Request samples

Content type
application/json
{
  • "name": "Family",
  • "seatCap": 4
}

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Get a plan type

Returns an inactive or retired row too, to every audience: a plan bought under a retired type must still resolve it.

Authorizations:
gatewayMemberTokengatewayServiceKey
path Parameters
id
required
string <uuid>
Example: 0192a9c4-7b2e-7c3d-9e4f-1a2b3c4d5e6f

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Update a plan type (name, seatCap)

An inactive or active plan type takes edits; its status moves only through the activate and retire actions, and a retired plan type takes no edits: it is a 422. A new name must not belong to another non-retired plan type.

Authorizations:
gatewayMemberTokengatewayServiceKey
path Parameters
id
required
string <uuid>
Example: 0192a9c4-7b2e-7c3d-9e4f-1a2b3c4d5e6f
Request Body schema: application/json
required
name
string [ 1 .. 120 ] characters
seatCap
integer or null >= 1

Maximum seats a plan of this type may hold. null = unbounded.

Responses

Request samples

Content type
application/json
{
  • "seatCap": 5
}

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Retire a plan type

An inactive or active plan type can retire. Retired is final: the row stays readable by id, leaves the client collection, and is never re-activated. Takes no request body; anything sent is ignored.

Authorizations:
gatewayMemberTokengatewayServiceKey
path Parameters
id
required
string <uuid>
Example: 0192a9c4-7b2e-7c3d-9e4f-1a2b3c4d5e6f

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Activate a plan type

Makes an inactive plan type active, and so orderable and visible to the client audience. An active row is already active and a retired one is final, so both are a 422. The name needs no check: an inactive row already holds it. Takes no request body; anything sent is ignored.

Authorizations:
gatewayMemberTokengatewayServiceKey
path Parameters
id
required
string <uuid>
Example: 0192a9c4-7b2e-7c3d-9e4f-1a2b3c4d5e6f

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}