---
title: "Buy prepaid plan time with a Shared Payment Token"
method: POST
path: "/v1/workspaces/{workspaceId}/billing/agent-payment"
---

# Buy prepaid plan time with a Shared Payment Token

`POST /v1/workspaces/{workspaceId}/billing/agent-payment`

## Request

- Base URL: `https://api.bangermail.com`
- URL: `https://api.bangermail.com/v1/workspaces/{workspaceId}/billing/agent-payment`
- Auth: HTTP bearer

## Path parameters

- `workspaceId` string, uuid, required

## Request body

- object
  - `plan_key` 'premium' | 'starter', required: Premium; its plan key is starter.
  - `interval` 'month' | 'year'
  - `shared_payment_token` string, required

## Response `200`

Successful response.

- object
  - `data` object, required
    - `status` string, required
    - `payment_intent_id` string, required
    - `message` string, required
    - `plan_key` 'starter'
    - `prepaid_until` string, date-time, nullable
    - `amount_cents` integer: What was charged.
    - `discount` AgentPaymentDiscount
      - `offer` 'switch_from_mailchimp', required
      - `amount_off_cents` integer, required
      - `full_price_cents` integer, required
      - `message` string, required

## Other responses

- `default`: Request failed.

---

[API](https://skmtc.dev/bangermail/apis/banger-api.md) · [All operations](https://skmtc.dev/bangermail/apis/banger-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bangermail/apis/banger-api/revisions/a149909267f9?raw)
