get__subscription_my

GET /subscriptions/my

Get My Subscription

Get the current subscription details for the authenticated user's organization, including status, billing period, and renewal information.

Parameters

This endpoint does not accept query parameters. Authentication is required.

TypeScript Client Library

public getMySubscription = async (): Promise<MySubscriptionResponse> => {
  return this.makeRequest<MySubscriptionResponse>('subscriptions/my', 'GET', null);
};

Code Samples

# You can also use wget
curl -X GET https://backend.flashback.tech/subscriptions/my \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Example responses

200 Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Pro Plan",
    "description": "Includes higher limits and priority support",
    "periodId": "123e4567-e89b-12d3-a456-426614174000",
    "periodType": "MONTHLY",
    "price": 1999,
    "dateFrom": "2024-01-15T10:00:00Z",
    "dateTo": "2024-02-15T10:00:00Z",
    "status": "ACTIVE",
    "autoRenew": true
  }
}

200 Response (No Subscription)

{
  "success": true,
  "data": null,
  "message": "No subscription found"
}

400 Response

{
  "success": false,
  "error_code": "NO_ORGANIZATION",
  "message": "User must belong to an organization"
}

404 Response

{
  "success": false,
  "error_code": "USER_NOT_FOUND",
  "message": "User not found"
}

500 Response

{
  "success": false,
  "error_code": "INTERNAL_ERROR",
  "message": "An unexpected error occurred"
}

Responses

Status
Meaning
Description
Schema

200

Current subscription details

Inline

400

User not in organization

Inline

404

User not found

Inline

500

Server error

Inline

Response Schema

Status Code 200

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Indicates if the request was successful

» data

object

false

none

Current subscription details (null if no subscription)

»» id

string

false

none

Unique identifier for the subscription

»» name

string

false

none

Human-readable name for the subscription

»» description

string

false

none

Description of what the subscription includes

»» periodId

string

false

none

Unique identifier for the current billing period

»» periodType

string

false

none

Billing period type (DAILY, WEEKLY, MONTHLY, YEARLY, ALL_TIME)

»» price

number

false

none

Price for the period in the smallest currency unit

»» dateFrom

string(date-time)

false

none

Start date of the current subscription period

»» dateTo

string(date-time)

false

none

End date of the current subscription period (null for ALL_TIME)

»» status

string

false

none

Current subscription status (ACTIVE, EXPIRED, CANCELLED)

»» autoRenew

boolean

false

none

Whether the subscription will automatically renew

» message

string

false

none

Additional message when no subscription is found

Status Code 400

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Will be false for error responses

» error_code

string

false

none

Machine-readable error code

» message

string

false

none

Human-readable error message

Status Code 404

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Will be false for error responses

» error_code

string

false

none

Machine-readable error code

» message

string

false

none

Human-readable error message

Status Code 500

Name
Type
Required
Restrictions
Description

» success

boolean

false

none

Will be false for error responses

» error_code

string

false

none

Machine-readable error code

» message

string

false

none

Human-readable error message

Last updated

Was this helpful?