# 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

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

#### Code Samples

{% tabs %}
{% tab title="Shell" %}

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

{% endtab %}

{% tab title="HTTP" %}

```http
GET https://backend.flashback.tech/subscriptions/pending-payment HTTP/1.1
Host: backend.flashback.tech
Accept: application/json
Authorization: Bearer {access-token}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://backend.flashback.tech/subscriptions/pending-payment',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get 'https://backend.flashback.tech/subscriptions/pending-payment',
  headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://backend.flashback.tech/subscriptions/pending-payment', 
                 headers=headers)

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

try {
    $response = $client->request('GET','https://backend.flashback.tech/subscriptions/pending-payment', array(
        'headers' => $headers,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
```

{% endtab %}

{% tab title="Java" %}

```java
URL obj = new URL("https://backend.flashback.tech/subscriptions/pending-payment");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Authorization", "Bearer {access-token}");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "net/http"
)

func main() {
    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    req, err := http.NewRequest("GET", "https://backend.flashback.tech/subscriptions/pending-payment", nil)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

> Example responses

> 200 Response

```json
{
  "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

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

> 404 Response (User Not Found)

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

> 404 Response (No Pending Payment)

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

> 404 Response (Subscription Period Not Found)

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

> 500 Response

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

#### Responses <a href="#get_subscription_pending-payment-responses" id="get_subscription_pending-payment-responses"></a>

| Status | Meaning                                                                                             | Description                                      | Schema |
| ------ | --------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                                             | Pending payment details retrieved                | Inline |
| 400    | [Bad Request](https://www.rfc-editor.org/rfc/rfc9110.html#name-400-bad-request)                     | Invalid request or configuration                 | Inline |
| 404    | [Not Found](https://www.rfc-editor.org/rfc/rfc9110.html#name-404-not-found)                         | User, organization, or pending payment not found | Inline |
| 500    | [Internal Server Error](https://www.rfc-editor.org/rfc/rfc9110.html#name-500-internal-server-error) | Server error                                     | Inline |

#### Response Schema <a href="#get_subscription_pending-payment-responseschema" id="get_subscription_pending-payment-responseschema"></a>

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      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashback.tech/support-reference/platform-api-reference/subscriptions/get__subscription_pending-payment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
