Gateway

Start a credit top-up

Changed on

Asks to add credits to the authenticated workspace. Needs the opt-in billing:write scope and workspace membership. Nothing is charged here. With a saved card, every workspace owner and admin is emailed a single-use link and one of them confirms or declines the charge. Without one, the response has a checkout_url where an owner or admin pays with a new card, which is saved for later top-ups. Amounts are $5 to $500. A workspace can have 5 pending top-ups, and each expires after 30 minutes.

post/credits/topups

Request

  • Base URL
    https://api.phaseo.app/v1
  • URL
    https://api.phaseo.app/v1/credits/topups
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

Optional idempotency key. Repeating it returns the same top-up instead of creating another. Same as the idempotency_key field.

Request body

amount_usdnumber required

Amount in US dollars, with at most two decimal places.

workspace_idstring uuid

Optional. Must match the authenticated workspace.

idempotency_keystring

Optional idempotency key. Repeating it returns the same top-up instead of creating another.

Example request

{
  "amount_usd": 20
}

Response

Existing top-up for this idempotency key

oktrue required

Example response

{
  "topup": {
    "reason": "declined",
    "amount_cents": 2000,
    "amount_usd": 20,
    "currency": "usd",
    "payment_method": {
      "brand": "visa",
      "last4": "4242"
    }
  }
}

Changes