get__subscription_pending-payment

GET /subscriptions/pending-payment

Get Pending Payment Details

Retrieve details about a pending payment for the authenticated user's organization. This endpoint returns information about any ongoing payment process, including Stripe checkout session details.

Parameters

No parameters required.

TypeScript Client Library

public getPendingPayment = async (): Promise<GetPendingPaymentResponse> => {
  return this.makeRequest<GetPendingPaymentResponse>('subscriptions/pending-payment', 'GET', null);
};

Code Samples

curl -X GET https://backend.flashback.tech/subscriptions/pending-payment \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Example responses

200 Response

{
  "success": true,
  "data": {
    "id": "pay_1234567890abcdef",
    "stripePaymentId": "cs_test_1234567890abcdef",
    "amount": 29.99,
    "currency": "usd",
    "status": "PENDING",
    "createdAt": "2024-01-15T10:30:00Z",
    "subscription": {
      "id": "sub_1234567890abcdef",
      "name": "Professional Plan",
      "description": "Professional subscription with advanced features"
    },
    "subscriptionPeriod": {
      "id": "period_1234567890abcdef",
      "periodType": "MONTHLY",
      "price": 29.99
    },
    "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_1234567890abcdef",
    "sessionStatus": "open"
  }
}

400 Response

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

404 Response (User Not Found)

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

404 Response (No Pending Payment)

{
  "success": false,
  "error_code": "NO_PENDING_PAYMENT",
  "message": "No pending payment found"
}

404 Response (Subscription Period Not Found)

{
  "success": false,
  "error_code": "SUBSCRIPTION_PERIOD_NOT_FOUND",
  "message": "Subscription period not found"
}

500 Response

{
  "success": false,
  "error_code": "INTERNAL_ERROR",
  "message": "Failed to retrieve pending payment"
}

Responses

Status
Meaning
Description
Schema

200

Pending payment details retrieved

Inline

400

Invalid request or configuration

Inline

404

User, organization, or pending payment 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

Pending payment details

»» id

string

false

none

Unique payment identifier

»» stripePaymentId

string

false

none

Stripe checkout session identifier

»» amount

number

false

none

Payment amount

»» currency

string

false

none

Payment currency (e.g., "usd")

»» status

string

false

none

Payment status (PENDING, PROCESSING, COMPLETED, FAILED, CANCELLED, UNPAID, EXPIRED)

»» createdAt

string

false

none

Payment creation timestamp (ISO 8601)

»» subscription

object

false

none

Subscription details

»»» id

string

false

none

Subscription identifier

»»» name

string

false

none

Subscription name

»»» description

string

false

none

Subscription description

»» subscriptionPeriod

object

false

none

Subscription period details

»»» id

string

false

none

Subscription period identifier

»»» periodType

string

false

none

Period type (ALL_TIME, DAILY, WEEKLY, MONTHLY, YEARLY)

»»» price

number

false

none

Period price

»» checkoutUrl

string

false

none

Stripe hosted checkout URL

»» sessionStatus

string

false

none

Stripe checkout session status

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?