API Reference
A human-readable summary of all Subscription Service API endpoints. For the full interactive OpenAPI specification with request/response schemas, see API Specification.
Overview
All endpoints are served by the site-subscriptions API Gateway Lambda at https://subscription-service.api.floatme.io/v1.
Authorization is enforced at the API Gateway level using AWS Signature Version 4 (IAM):
-
IAM (awsSigV4) — all callers authenticate with AWS IAM credentials. The
Authorizationheader carries the AWS SigV4 signature. Mobile clients reach this service via the internal FloatMe API gateway, which proxies requests with its own IAM identity.
All user-scoped paths are prefixed with /{user_id}, scoping every operation to a single user record.
Subscription Management
Endpoints for creating, retrieving, and reactivating subscriptions.
| Method | Path | Description |
|---|---|---|
|
|
Create the user’s first scheduled subscription record. Idempotent — returns 200 without error if a |
|
|
Reactivate a lapsed subscription. Immediately charges the user via pinless debit for the current period, writes a |
|
|
Return all subscription records for the user, ordered ascending by subscription date. Returns |
|
|
Return the active subscription most relevant to the mobile app — either the upcoming scheduled subscription or the most recently past-due one. Applies status normalisation: |
|
|
Support-tool update for a subscription record. Allows overriding |
POST /{user_id}/subscriptions/reactivate — Request Body
The request body is optional. If omitted (or empty), the base/v0 tier defaults are used.
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Conditional |
Membership tier name (e.g., |
|
string |
Conditional |
Tier version string (e.g., |
Both tier and version must be present together or both absent. Tier and version are validated against the global.tiers.config GrowthBook feature flag for the user.
POST /{user_id}/subscriptions/reactivate — Responses
| Status | Schema | Meaning |
|---|---|---|
|
(empty) |
User already has a |
|
|
Payment succeeded. Body contains the new scheduled subscription and the masked debit card number. |
|
|
The pinless debit charge failed (payment provider returned a failure). User must update their payment method before retrying. |
|
|
The user’s debit card is invalid. |
|
|
Unexpected error (GrowthBook unavailable, DynamoDB write failure, etc.). |
PATCH /{user_id}/subscriptions — Request Body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
ID of the subscription record to update. |
|
string (RFC 3339) |
No |
New billing due date. Must be a valid RFC 3339 timestamp. If omitted, the existing date is kept. |
|
string |
No |
New status value. If omitted, the existing status is kept. |
Billing
Endpoints for manual payment, billing history, billing details, and active term length.
| Method | Path | Description |
|---|---|---|
|
|
Manually pay a specific subscription via pinless debit. The user must be |
|
|
Return all history entries for a specific subscription record from the |
|
|
Return billing details for display in the mobile app. If a |
|
|
Return the count of consecutive paid months in the user’s current active term, plus the full subscription list. Counts |
POST /{user_id}/subscriptions/{subscription_id}/pay — Path Parameters
| Parameter | Type | Description |
|---|---|---|
|
string |
ID of the user whose subscription is being paid. |
|
string |
ID of the specific subscription record to charge. Must be in |
GET /{user_id}/subscriptions/billing_details — Response Fields
| Field | Type | Description |
|---|---|---|
|
string |
Subscription amount as a decimal string (e.g., |
|
string (RFC 3339) |
Next scheduled billing date. |
|
boolean |
Whether the Friday billing schedule is active for this environment. |
|
integer |
Week-of-month number (1–5) for the billing Friday. Present only when Friday billing is enabled. |
Plan Management
Endpoints for changing a user’s membership tier on their next scheduled billing.
| Method | Path | Description |
|---|---|---|
|
|
Upgrade the user’s next scheduled subscription to a higher membership tier. Finds the current |
|
|
Downgrade the user’s next scheduled (or paused) subscription to a lower membership tier. Accepts |
Both upgrade and downgrade validate the requested tier and version against the global.tiers.config GrowthBook feature flag before writing. The amount is updated to the tier’s monthly price from the GrowthBook config.
POST /{user_id}/subscriptions/upgrade — Request Body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
Name of the tier to upgrade to (e.g., |
|
string |
Yes |
Version of the tier to upgrade to (e.g., |
POST /{user_id}/subscriptions/downgrade — Request Body
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
Name of the tier to downgrade to (e.g., |
|
string |
Yes |
Version of the tier to downgrade to (e.g., |
Upgrade / Downgrade Responses
| Status | Schema | Meaning |
|---|---|---|
|
|
Tier change applied. Body contains the updated subscription record. |
|
|
The requested tier or version is not valid per GrowthBook config. |
|
|
No eligible scheduled (or paused) subscription found for the user. |
|
|
Unexpected internal error. |
Administration
Endpoints restricted to specific callers or environments.
| Method | Path | Description |
|---|---|---|
|
|
Handle a user ban by cancelling any pending subscriptions. Finds all subscriptions in |
|
|
(Test environment only) Batch-create subscription records and history entries for QA automation. Restricted to the |
PUT /qa/subscriptions/create — Request Body
| Field | Type | Required | Description |
|---|---|---|---|
|
array of |
Yes |
Subscription records to create. Each entry may include a |
Each QASubscription in records requires: user_id, subscription_id, subscription_date, subscription_amount, subscription_status, subscription_period, last_run_date, initial_run_date, completion_date, created_date, and history.
Optional fields per record: transaction_id, usio_error, process, updated_event, term, return_code.
Shared Schemas
Subscription
The core subscription record returned by most read endpoints.
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
Owner of the subscription. |
|
string |
Yes |
Unique identifier for this subscription record. |
|
string |
Yes |
Billing due date (RFC 3339). |
|
string |
Yes |
Amount as a decimal string (e.g., |
|
string |
Yes |
Current status. See Subscription Lifecycle for all values. |
|
string |
Yes |
Billing period in |
|
string |
Yes |
Timestamp when the record was created (RFC 3339). |
|
string |
No |
Payment confirmation ID from the payments provider. |
|
string |
No |
Error message from the payments provider when a collection attempt fails. |
|
string |
No |
Timestamp of the first collection attempt (RFC 3339). |
|
string |
No |
Timestamp when the subscription was marked |
|
string |
No |
Timestamp of the most recent write to this record (RFC 3339). |
|
string |
No |
What process last wrote this record (e.g., |
|
string |
No |
Event that triggered the last status change (e.g., |
|
string |
No |
Billing term ( |
|
boolean |
No |
|
CurrentSubscriptionDetails
Returned by GET /{user_id}/subscriptions/current.
| Field | Type | Required | Description |
|---|---|---|---|
|
string |
Yes |
ID of the current subscription record. |
|
string (date) |
Yes |
Due date in |
|
string |
Yes |
Subscription amount as a decimal string. |
|
string |
Yes |
Normalised display status: |
|
string (date) |
Yes |
Due date of the next upcoming subscription record (empty string if none). |
|
boolean |
Yes |
|
|
boolean |
Yes |
|
|
string (date) |
Yes |
Date when the 20-day grace period expires ( |
|
integer |
Yes |
Length of the grace period in days (always |
Error Responses
All error responses use the ErrorResponse schema:
{
"message": "human-readable description",
"code": 402
}
Common HTTP Status Codes
| HTTP Status | Meaning | Typical Cause |
|---|---|---|
|
Success (no-op) |
Idempotent operations where the desired state already exists (e.g., subscription already scheduled). |
|
Resource created or payment completed |
New subscription written, reactivation charge succeeded, QA records written. |
|
Update accepted |
Returned by |
|
Invalid request body |
Malformed JSON, missing required fields, or invalid tier/version combination. |
|
Charge declined |
Pinless debit rejected by the payments provider during reactivation. |
|
Unauthorised caller |
Environment mismatch or caller identity check failed ( |
|
Resource not found |
No subscription records exist for the user, or the target subscription was not found. |
|
State conflict |
Subscription is in the wrong status for the requested operation, the subscription is too old, or the debit card is invalid. |
|
Parse error |
Request body decoded but record fields could not be parsed (e.g., invalid date format). |
|
Unexpected error |
DynamoDB failure, external service unavailable, or unhandled exception. |
Related Pages
-
API Specification — Full interactive OpenAPI spec (Swagger UI)
-
Subscription Lifecycle — Subscription statuses, transitions, and activation flows
-
Collections — How scheduled and manual collections process subscriptions
-
DynamoDB Tables —
billing-activityandbilling-activity-historyschema and access patterns