---
title: "Confirm manual execution funding"
method: POST
path: "/v1/billing/funding/purchase"
---

# Confirm manual execution funding

`POST /v1/billing/funding/purchase`

## Request

- Base URL: `https://docs.greatwait.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.greatwait.dev/v1/billing/funding/purchase`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer and API key in header `Greatwait-Environment` and API key in header `Greatwait-Project`

Confirms one exact manual execution-credit quote and creates or replays its durable payment operation. Billing-owner authority and explicit agent approval apply; the Idempotency-Key preserves one payment identity across retries. Manual funding stays outside the automatic-charge ceiling. A browser redirect never grants credit: only authenticated provider reconciliation can move the operation to paid and grant its exact execution credit once, while the operation reports provider-confirmed tax and gross when known. With savePaymentMethod, the payment method used becomes the organization's saved payment method once the payment is confirmed, unless one is already saved.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `automaticTopUp` boolean: true: the customer also asks to top up automatically when credit runs low. The hosted payment then saves the payment method for later off-session charges (it offers every method the account enables except Klarna, which cannot be charged that way), and once the provider confirms this payment paid, automatic top-up is enabled with the default rule (add USD 10.00 when available credit falls below USD 2.00, at most USD 50.00 of automatic charges a month) using that payment method. A rule that is already ready is left unchanged; an enabled rule waiting for a payment method keeps its own amounts and gains this one. Omitted or false: the purchase does exactly what it always did. An unpaid, expired or cancelled payment enables nothing.
  - `confirmed` true, required
  - `expectedRevision` integer, required
  - `quote` string, required
  - `savePaymentMethod` boolean: true: the customer also asks to keep the payment method they pay with, for automatic top-up and for projects past the free one. The hosted payment then saves it for later charges made without the customer present (it offers every method the account enables except Klarna, which cannot be charged that way), and once the provider confirms this payment paid, that method becomes the organization's saved payment method if it has none. An existing saved payment method is never replaced, and saving one never turns automatic top-up on. Omitted or false: the purchase does exactly what it always did.

## Response `201`

Confirm manual execution funding

- object
  - `automaticExecutionTopUp` object, required
    - `ceiling` object, nullable, required
      - `currency` 'USD', required
      - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
      - `scale` 6, required
    - `currentPeriod` object, required
      - `end` string, required
      - `pending` object, required
        - `currency` 'USD', required
        - `microdollars` string, required
        - `scale` 6, required
      - `remaining` object, nullable, required
        - `currency` 'USD', required
        - `microdollars` string, required
        - `scale` 6, required
      - `settled` object, required
        - `currency` 'USD', required
        - `microdollars` string, required
        - `scale` 6, required
      - `start` string, required
    - `rule` object, required
      - `cooldownUntil` string, nullable, required
      - `desired` object, nullable, required
        - `ceiling` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
        - `credit` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
        - `triggerBelow` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
      - `effective` object, nullable, required
        - `ceiling` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
        - `credit` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
        - `triggerBelow` object, required
          - `currency` 'USD', required
          - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
          - `scale` 6, required
      - `setupUrl` string, uri
      - `state` 'disabled' | 'payment-method-required' | 'ready', required
      - `suspension` object, nullable, required
        - `at` string, required
        - `reason` 'authentication-required' | 'payment-failed', required
    - `revision` integer, required
  - `credit` object, required
    - `amountOwed` object, required
      - `currency` 'USD', required
      - `microdollars` string, required
      - `scale` 6, required
    - `available` object, required
      - `currency` 'USD', required
      - `microdollars` string, required
      - `scale` 6, required
    - `reserved` object, required
      - `currency` 'USD', required
      - `microdollars` string, required
      - `scale` 6, required
  - `freshness` object, required
    - `kind` 'authoritative', required
  - `paymentOperations` object[], required
    - `createdAt` string, required
    - `credit` object, required
      - `currency` 'USD', required
      - `microdollars` string, required: A canonical nonnegative integer multiple of 10,000 microdollars, no greater than 9,223,372,036,854,770,000.
      - `scale` 6, required
    - `gross` object, nullable, required
      - `currency` 'USD', required
      - `microdollars` string, required
      - `scale` 6, required
    - `id` string, required
    - `kind` 'manual' | 'automatic', required
    - `paymentUrl` string, uri
    - `reason` string
    - `receiptUrl` string, uri
    - `state` 'pending' | 'paid' | 'failed' | 'authentication-required' | 'action-required' | 'canceled' | 'refunded' | 'reversed' | 'disputed', required
    - `tax` object, nullable, required
      - `currency` 'USD', required
      - `microdollars` string, required
      - `scale` 6, required
    - `taxStatus` 'calculated-at-checkout' | 'confirmed', required
    - `updatedAt` string, required
  - `subscribedProjectFees` object, required
    - `currency` 'USD', required
    - `microdollars` string, required
    - `scale` 6, required

## Other responses

- `400`: Problem document. Possible codes at this status: invalid_request.
- `401`: Problem document. Possible codes at this status: authentication_required, credential_expired, credential_revoked.
- `403`: Problem document. Possible codes at this status: scope_missing, test_to_live_escalation.
- `404`: Problem document. Possible codes at this status: not_found.
- `409`: Problem document. Possible codes at this status: idempotency_key_reused, project_archived, revision_conflict, state_conflict.
- `429`: Problem document. Possible codes at this status: rate_limited.
- `503`: Problem document. Possible codes at this status: capability_not_configured, service_unavailable.

---

[API](https://skmtc.dev/greatwait/apis/greatwait-v1.md) · [All operations](https://skmtc.dev/greatwait/apis/greatwait-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/greatwait/apis/greatwait-v1/revisions/6855bce23e72?raw)
