> For the complete documentation index, see [llms.txt](https://peoplescourt.ai/llms.txt). This page is also available as Markdown.

# Initiate payment for one fee, provider-neutrally

Available when canonical API access is enabled. The fee is selected by the resource path; the existing checkout operation keeps its authority, sponsorship-coverage, rate-limit and fee-intent identity checks, so an equivalent retry returns the same provider intent instead of creating a second one. A card fee returns a Stripe Checkout session; an x402 fee returns the exact payment requirements committed when the fee was quoted, still confirmed by its own signed machine route.

Reference

Fees

POST

partial

`/api/fees/{feeId}/checkout`

`startFeeCheckoutPreview`

## Authentication and authority

Use one listed account-session, scoped OAuth, or partner credential alternative. Account tokens retain the approving account’s authority. Cookie-authenticated writes require same-origin authorization. Alternatives are OR; schemes in one alternative are AND.

`CanonicalSession`

The signed-in account’s session. Access is limited to that account’s authority; writes require same-origin authorization.

`CanonicalPartnerBearer`

Partner key issued after partner access is approved. The key’s role and current case membership determine which actions it authorizes.

`AccountOAuth`

Account tokens authorize only their approving account and approved scopes. S256 PKCE is mandatory on the code flow. Client credentials require a registered autonomous-agent account and cannot request offline_access; on the MCP resource they permit only cases:read for the registered existing case. Connector clients use authorization code on the MCP resource with its supported connector permissions. Explicit reacceptance is required after Rules or disclosure changes.

## Parameters

Name

Location

Requirement

Schema

`feeId`

path

Required

{"type":"string"}

## Request body

Optional request body.

application/json

```json
{
  "$ref": "#/components/schemas/CanonicalFeeCheckoutInput",
  "type": "object",
  "additionalProperties": false,
  "description": "The fee is selected by the resource path; caseId and feeRecordId in the body are refused.",
  "properties": {
    "restartOnly": {
      "type": "boolean",
      "default": false,
      "description": "Claimant account only. Check whether an expired unpaid initial filing can be reviewed as a new filing. Unresolved or non-expired payment attempts refuse recovery. Does not create a filing, accept terms, extend a deadline, or move money. Mutually exclusive with previewOnly."
    },
    "previewOnly": {
      "type": "boolean",
      "default": false,
      "description": "Validate the hosted price selection and return grossCents, discountCents and netCents without opening Checkout or reserving a credit. Availability is checked again when payment starts."
    },
    "promotionCode": {
      "type": "string"
    },
    "priceSelection": {
      "type": "string",
      "const": "full"
    }
  }
}
```

## Responses

### 200

Typed checkout descriptor for the selected provider.

application/json

```json
{
  "type": "object",
  "required": [
    "data",
    "requestId"
  ],
  "properties": {
    "data": {
      "$ref": "#/components/schemas/CanonicalFeeCheckout",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schemaVersion",
        "feeId",
        "caseId",
        "provider",
        "checkout"
      ],
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "fee-checkout-v1"
        },
        "feeId": {
          "type": "string"
        },
        "caseId": {
          "type": "string"
        },
        "provider": {
          "type": "string",
          "enum": [
            "stripe",
            "x402",
            "court_filing_credit"
          ]
        },
        "checkout": {
          "type": "object",
          "additionalProperties": true,
          "required": [
            "kind"
          ],
          "description": "Provider descriptor: a validated price preview, an expired-filing recovery check, a Stripe Checkout session, an applied court filing credit, or the committed x402 payment requirements.",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "filing_restart_allowed",
                "price_preview",
                "stripe_checkout",
                "credit_applied",
                "x402_payment_required"
              ]
            }
          }
        }
      }
    },
    "requestId": {
      "type": "string"
    }
  }
}
```

### 404

No fee is available for this caller to pay.

### default

RFC 9457 style problem response.

application/problem+json

```json
{
  "$ref": "#/components/schemas/Problem",
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "code",
    "detail",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "code": {
      "type": "string"
    },
    "detail": {
      "type": "string"
    },
    "requestId": {
      "type": "string"
    },
    "details": {
      "description": "Account-readiness refusals include a value-free checklist and exact account-page link. Other error codes may provide different details.",
      "anyOf": [
        {
          "$ref": "#/components/schemas/AccountReadinessDetails",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ready",
            "accountSetupUrl",
            "missing"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "accountSetupUrl": {
              "type": "string",
              "format": "uri"
            },
            "missing": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AccountReadinessRequirement",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "label",
                  "section",
                  "accountUrl"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "section": {
                    "type": "string",
                    "enum": [
                      "email",
                      "identity",
                      "legal_documents"
                    ]
                  },
                  "accountUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        {
          "$ref": "#/components/schemas/LegalDocumentsRequiredDetails",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "legalDocumentsUrl"
          ],
          "properties": {
            "legalDocumentsUrl": {
              "type": "string",
              "format": "uri",
              "description": "Absolute account-page URL where the person reviews and accepts the current Terms and Privacy Notice. Uses the configured public application origin. After accepting the documents, retry the original operation."
            },
            "ready": {
              "type": "boolean"
            },
            "accountSetupUrl": {
              "type": "string",
              "format": "uri"
            },
            "missing": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AccountReadinessRequirement",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "label",
                  "section",
                  "accountUrl"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "section": {
                    "type": "string",
                    "enum": [
                      "email",
                      "identity",
                      "legal_documents"
                    ]
                  },
                  "accountUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        {}
      ]
    }
  }
}
```

## Example response

### Successful response

```json
{
  "data": {
    "schemaVersion": "fee-checkout-v1",
    "feeId": "feeId_test",
    "caseId": "pcase_test_123",
    "provider": "stripe",
    "checkout": {
      "kind": "filing_restart_allowed"
    }
  },
  "requestId": "requestId_test"
}
```

## Errors

Read the response status and stable error code. See [errors](https://peoplescourt.ai/docs/api/errors.md) and [rate limits](https://peoplescourt.ai/docs/api/rate-limits.md) for recovery. Refresh the resource before resolving a state or digest conflict.

## Idempotency and retries

- For throttling, honor Retry-After when present. Back off on retryable server failures.
- The request is accepted only when its credential, authority, case state, and resource preconditions are satisfied.

## Request examples

Use `https://peoplescourt.ai` with the test credential issued for your integration.

```sh
curl --request POST \
  --url 'https://peoplescourt.ai/api/fees/feeId_test/checkout' \
  --header 'Cookie: arb_session=COPY_ACCOUNT_SESSION' \
  --header 'Origin: https://peoplescourt.ai' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

```ts
const input = {};

const response = await fetch("https://peoplescourt.ai/api/fees/feeId_test/checkout", {
  method: "POST",
  headers: {
    "Cookie": "arb_session=COPY_ACCOUNT_SESSION",
    "Origin": "https://peoplescourt.ai",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(input),
});
if (!response.ok) throw await response.json();
const result = await response.json();
```

```python
import requests

response = requests.post(
    "https://peoplescourt.ai/api/fees/feeId_test/checkout",
    headers={
      "Cookie": "arb_session=COPY_ACCOUNT_SESSION",
      "Origin": "https://peoplescourt.ai",
      "Content-Type": "application/json"
    },
    json={},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```
