> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3iq.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a local receipt to the configured control plane.

` POST /v1/receipts/submit `

Submit a local receipt to the configured control plane.

## Servers

- ` http://127.0.0.1:8831 ` — Default local host-agent listener.

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` SetupBearer `: ` http `

  - HTTP scheme: ` bearer `

  - Setup token before operator configuration, or an authenticated operator session outside this spec.

## Request body (optional)

Content type: ` application/json `

- ` value `: type ` object `

  - ` receipt_hash `: type ` string ` — Omit to submit the most recent local receipt.

  - ` control_plane_url `: type ` string `; format ` uri ` — Optional override for the control-plane URL.

## Responses

### ` 200 ` — Local receipt submission result.

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` status `, ` receipt `, ` remote `

  - ` status `: type ` string `

    - enum: ` ["submitted"] `

  - ` receipt `: type ` object `

    - ` receipt_hash `: type ` string `

    - ` receipt `: type ` object `

    - ` submitted_at `: type ` string `; format ` date-time `

    - ` control_plane_url `: type ` string `

    - ` batch_id `: type ` string `

    - ` created_at `: type ` string `; format ` date-time `

  - ` remote `: type ` object `

### ` default ` — B3IQ-native problem response.

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` object `

    - Required fields: ` status `, ` title `, ` detail `

    - ` status `: type ` integer `

    - ` title `: type ` string `

    - ` detail `: type ` string `

    - ` code `: type ` string ` — Stable B3IQ code when present. See docs/error-codes.md.

## Request examples

### cURL

```curl
curl -X POST 'http://127.0.0.1:8831/v1/receipts/submit' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "receipt_hash": "string",
  "control_plane_url": "https://example.com"
}'
```

### JavaScript

```javascript
const response = await fetch('http://127.0.0.1:8831/v1/receipts/submit', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "receipt_hash": "string",
    "control_plane_url": "https://example.com"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.post('http://127.0.0.1:8831/v1/receipts/submit', headers=headers, json={
  "receipt_hash": "string",
  "control_plane_url": "https://example.com"
})
print(response.json())
```