> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chargefy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Subscription Schedule

> Cria uma schedule para uma subscription.

Cria uma schedule para uma subscription existente. Se a primeira fase começa
agora, ela é aplicada imediatamente e a próxima fase é agendada.

<ParamField body="subscription" type="string" required>
  Subscription que será controlada pela schedule. Também aceito como
  `from_subscription`.
</ParamField>

<ParamField body="start_date" type="string">
  Data de início da primeira fase. Aceita ISO 8601, Unix seconds ou `now`.
</ParamField>

<ParamField body="end_behavior" type="string">
  `release` ou `cancel`. Padrão: `release`.
</ParamField>

<ParamField body="phases" type="array" required>
  Fases sequenciais. Cada fase aceita `items`, `start_date`, `end_date`,
  `collection_method`, `days_until_due`, `default_payment_method`, `discount`,
  `trial_end`, `trial_settings`, `proration_behavior` e `metadata`.
</ParamField>

<RequestExample>
  ```bash Com subscription + phases theme={}
  curl -X POST "https://api.chargefy.io/v1/subscription-schedules" \
    -H "Authorization: Bearer {{API_KEY}}" \
    -H "Content-Type: application/json" \
    -d '{
      "phases": [
        {}
      ],
      "subscription": "sub_123"
    }'
  ```

  ```bash Derivando phases de from_subscription theme={}
  curl -X POST "https://api.chargefy.io/v1/subscription-schedules" \
    -H "Authorization: Bearer {{API_KEY}}" \
    -H "Content-Type: application/json" \
    -d '{
      "from_subscription": "sub_123"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response 200 theme={}
  {
    "id": "subsched_123",
    "object": "subscription_schedule",
    "canceled_at": null,
    "completed_at": null,
    "created_at": "2026-05-20T12:00:00Z",
    "current_phase": null,
    "current_phase_index": null,
    "customer": "cus_123",
    "end_behavior": "release",
    "livemode": true,
    "metadata": {},
    "phases": {
      "object": "list",
      "data": [],
      "has_more": false,
      "url": "/v1/subscription-schedules/subsched_123/phases"
    },
    "released_at": null,
    "released_subscription": null,
    "start_date": "2026-05-20T12:00:00Z",
    "status": "not_started",
    "subscription": "sub_123",
    "updated_at": null
  }
  ```
</ResponseExample>
