delete__subscription_pending-payment

DELETE /subscriptions/pending-payment

Cancel Pending Payment

Cancel a pending payment for the authenticated user's organization. This endpoint cancels any ongoing payment process and expires the associated Stripe checkout session.

Parameters

No parameters required.

TypeScript Client Library

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

Code Samples

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

Example responses

200 Response

{
  "success": true,
  "message": "Pending payment cancelled successfully",
  "data": {
    "paymentId": "pay_1234567890abcdef",
    "stripePaymentId": "cs_test_1234567890abcdef",
    "cancelledAt": "2024-01-15T10:35:00Z"
  }
}

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"
}

500 Response

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

Responses

Status
Meaning
Description
Schema

200

Pending payment cancelled successfully

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

» message

string

false

none

Success message

» data

object

false

none

Cancellation details

»» paymentId

string

false

none

Unique payment identifier

»» stripePaymentId

string

false

none

Stripe checkout session identifier

»» cancelledAt

string

false

none

Cancellation timestamp (ISO 8601)

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?