# collab: Add endpoint for migrating users to new billing \(\#29769\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1ffedf4a08d88299ce23ba4c4b3b49b7223dcebe)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1ffedf4a08d88299ce23ba4c4b3b49b7223dcebe

Requested commit: 1ffedf4a08d88299ce23ba4c4b3b49b7223dcebe

Commit: 1ffedf4a08d88299ce23ba4c4b3b49b7223dcebe

Tree: 31411e15ef0e6ecf9ba4f6093dc7d53884c7fa2d

Author: Marshall Bowers

Committer: GitHub

## Message

```
collab: Add endpoint for migrating users to new billing (#29769)

This PR adds a new `POST /billing/subscriptions/migrate` endpoint for
migrating users to the new billing system.

When called with a GitHub user ID this endpoint will:

1. Find the active billing subscription for this user (if they have one)
2. Cancel the subscription and send a final invoice
3. Ensure the user is in the `new-billing` and `assistant2` feature
flags

Release Notes:

- N/A
```

## Parents

- [d25da9728bdb0d695b45e4703b7ec7f533825ce0](https://git.cafe/gitcafe/zed/commit/d25da9728bdb0d695b45e4703b7ec7f533825ce0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1ffedf4a08d88299ce23ba4c4b3b49b7223dcebe?format=markdown)
