---
title: "Test a direct Shared Payment Token credit purchase (local sandbox only)"
method: POST
path: "/v1/credit-payments"
tags: ["Credits"]
---

# Test a direct Shared Payment Token credit purchase (local sandbox only)

`POST /v1/credit-payments`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/credit-payments`
- Auth: HTTP bearer

Unavailable in production. Requires explicit sandbox configuration and local Supabase. Attempts a test payment using a payer-issued SPT and the same USD base credit pricing as Checkout; no taxes or discounts are calculated. Requires write permission and Idempotency-Key; team purchases require active ownership. Workspace comes from authentication. The caller must obtain user approval for this exact purchase before submitting the token over HTTPS (HTTP only on localhost). Never put payment tokens in prompts or URLs. Only the dedicated signature-verified sandbox webhook grants credits. This is not MPP, a Muse-specific payment contract, or a Managed Payments integration. Never retry an uncertain outcome with a new key or token.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `amount_cents` integer, required: USD purchase amount in whole cents, from $10 to $10,000, before checkout taxes or discounts. Workspace comes from authentication.
  - `shared_payment_token` string, required: Sandbox Shared Payment Token issued by the payer wallet for this approved purchase. Never put it in a prompt, URL, log or saved card field.

## Response `201`

Sandbox payment status; credits_added is backed by the ledger

- object
  - `data` object, required
    - `id` string, required
    - `status` 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'requires_capture' | 'canceled' | 'succeeded', required
    - `amount_cents` integer, required
    - `currency` 'usd', required
    - `credits` integer, required
    - `credits_added` boolean, required
    - `organization_id` string, uuid, nullable, required
    - `livemode` false, required
    - `status_url` string, required

## Other responses

- `202`: Sandbox payment status; credits_added is backed by the ledger
- `400`: Invalid input or missing Idempotency-Key
- `401`: Authentication required
- `403`: Write permission or active team ownership required
- `404`: Payment or token not found in this account/workspace
- `409`: Operation conflict or unconfirmed execution
- `422`: Token rejected or payment needs unsupported customer action
- `500`: Invalid payment record
- `503`: Sandbox disabled, provider unavailable, or payment outcome unknown

---

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