> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.afternoon.co/llms.txt.
> For full documentation content, see https://docs.afternoon.co/llms-full.txt.

# List subscriptions

GET https://api.afternoon.co/v1/subscriptions

Returns a paginated list of subscriptions. Supports optional customer_id and status filters.

Reference: https://docs.afternoon.co/api-reference/afternoon-events-api/subscriptions/list

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Afternoon Events API
  version: 1.0.0
paths:
  /v1/subscriptions:
    get:
      operationId: list
      summary: List subscriptions
      description: >-
        Returns a paginated list of subscriptions. Supports optional customer_id
        and status filters.
      tags:
        - subpackage_subscriptions
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: string
            default: '50'
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: customer_id
          in: query
          required: false
          schema:
            type: string
        - name: status
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/V1SubscriptionsGetParametersStatus'
        - name: Authorization
          in: header
          description: API key obtained from the Afternoon dashboard
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Subscriptions list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionListResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
servers:
  - url: https://api.afternoon.co
  - url: http://localhost:8787
components:
  schemas:
    V1SubscriptionsGetParametersStatus:
      type: string
      enum:
        - pending_payment_method
        - trialing
        - active
        - past_due
        - canceled
      description: Filter by subscription status
      title: V1SubscriptionsGetParametersStatus
    SubscriptionStatus:
      type: string
      enum:
        - pending_payment_method
        - trialing
        - active
        - past_due
        - canceled
      title: SubscriptionStatus
    Subscription:
      type: object
      properties:
        id:
          type: string
        customer_id:
          type: string
        plan_id:
          type: string
        plan_code:
          type:
            - string
            - 'null'
          description: Human-readable plan code
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
        start_date:
          type: string
          description: ISO 8601 subscription start date
        billing_anchor_day:
          type: integer
          description: Day of month for billing anchor
        next_renewal_date:
          type:
            - string
            - 'null'
          description: ISO 8601 next renewal date
        cancel_at_period_end:
          type: boolean
          description: >-
            True when cancellation is scheduled for the end of the current
            billable period
        cancel_at:
          type:
            - string
            - 'null'
          description: ISO 8601 scheduled cancellation timestamp
        plan_transition_at_period_end:
          type: boolean
          description: >-
            True when a plan transition is scheduled for end of current billable
            period
        plan_transition_at:
          type:
            - string
            - 'null'
          description: ISO 8601 scheduled plan transition timestamp
        plan_transition_to_plan_id:
          type:
            - string
            - 'null'
          description: Target plan ID for a scheduled transition
        canceled_at:
          type:
            - string
            - 'null'
          description: >-
            ISO 8601 actual cancellation timestamp (set when status transitions
            to canceled)
        created_at:
          type: string
          description: ISO 8601 creation timestamp
        updated_at:
          type: string
          description: ISO 8601 last-updated timestamp
      required:
        - id
        - customer_id
        - plan_id
        - plan_code
        - status
        - start_date
        - billing_anchor_day
        - next_renewal_date
        - cancel_at_period_end
        - cancel_at
        - plan_transition_at_period_end
        - plan_transition_at
        - plan_transition_to_plan_id
        - canceled_at
        - created_at
        - updated_at
      title: Subscription
    SubscriptionListResponsePagination:
      type: object
      properties:
        has_more:
          type: boolean
          description: Whether there are more items after this page
        next_cursor:
          type:
            - string
            - 'null'
          description: Cursor to use for the next page, or null if no more items
      required:
        - has_more
        - next_cursor
      title: SubscriptionListResponsePagination
    SubscriptionListResponse:
      type: object
      properties:
        success:
          type: boolean
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/Subscription'
        pagination:
          $ref: '#/components/schemas/SubscriptionListResponsePagination'
        request_id:
          type: string
      required:
        - success
        - subscriptions
        - pagination
        - request_id
      title: SubscriptionListResponse
    ErrorResponseError:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          oneOf:
            - description: Any type
            - type: 'null'
      required:
        - code
        - message
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
        error:
          $ref: '#/components/schemas/ErrorResponseError'
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - success
        - error
      title: ErrorResponse
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the Afternoon dashboard

```

## SDK Code Examples

```typescript
import { AfternoonClient } from "afternoon-sdk";

async function main() {
    const client = new AfternoonClient({
        token: "YOUR_TOKEN_HERE",
    });
    await client.subscriptions.list({});
}
main();

```

```python
import requests

url = "https://api.afternoon.co/v1/subscriptions"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.afternoon.co/v1/subscriptions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.afternoon.co/v1/subscriptions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.afternoon.co/v1/subscriptions")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.afternoon.co/v1/subscriptions', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.afternoon.co/v1/subscriptions");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.afternoon.co/v1/subscriptions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```