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

# Create Print Order

> This endpoint allows users to place a Print order, with an optional builder code.

```http theme={null}
POST /api/v1/game/deposit
```

Locks your deposit in a new Print order. See [Placing & Managing Orders](https://docs.pacifica.fi/print/placing-and-managing-orders.md) for how Print orders work.

#### Operation Type (for Signing)

| Header Field | Type | Content |
| - | - | - |
| `"type"` | string | `"deposit_to_game"` |

#### Request Body

<table><thead><tr><th width="194">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>`"account"`</td><td>string</td><td>required</td><td>User's wallet address</td><td>`42trU9A5...`</td></tr><tr><td>`"signature"`</td><td>string</td><td>required</td><td>Cryptographic signature</td><td>`5j1Vy9Uq...`</td></tr><tr><td>`"timestamp"`</td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td>`1716200000000`</td></tr><tr><td>`"game"`</td><td>string</td><td>required</td><td>Print product, set by market and cycle length: `BTC_24H`, `BTC_7D`, `BTC_1M` (30 days), `ETH_24H`, and so on</td><td>`BTC_24H`</td></tr><tr><td>`"deposit_amount"`</td><td>string</td><td>required</td><td>Deposit in USDC, minimum 10</td><td>`1000.00`</td></tr><tr><td>`"direction"`</td><td>integer</td><td>required</td><td>`0` - long: the order opens a long if the price falls to the target\
`1` - short: the order opens a short if the price rises to the target</td><td>`1`</td></tr><tr><td>`"strike_price"`</td><td>string</td><td>required</td><td>Target price</td><td>`95000.00`</td></tr><tr><td>`"leverage"`</td><td>string</td><td>required</td><td>Leverage, up to the market's maximum</td><td>`2.0`</td></tr><tr><td>`"total_segments"`</td><td>integer</td><td>optional</td><td>Number of cycles the order runs, 1 to 1000. If omitted, the order rolls over until you end it</td><td>`7`</td></tr><tr><td>`"idempotency_key"`</td><td>string</td><td>optional</td><td>Full UUID string. Prevents duplicate orders</td><td>`550e8400-e29b-41d4-a716-446655440000`</td></tr><tr><td>`"agent_wallet"`</td><td>string</td><td>optional</td><td>Agent wallet address</td><td>`69trU9A5...`</td></tr><tr><td>`"expiry_window"`</td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td>`30000`</td></tr><tr><td>`"builder_code"`</td><td>string</td><td>optional</td><td>Builder program code (3-16 alphanumeric characters). See below</td><td>`MYCODE`</td></tr></tbody></table>

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "game": "BTC_24H",
  "deposit_amount": "1000.00",
  "direction": 1,
  "strike_price": "95000.00",
  "leverage": "2.0",
  "total_segments": 7,
  "idempotency_key": "550e8400-e29b-41d4-a716-446655440000",
  "agent_wallet": "69trU9A5...",
  "expiry_window": 30000,
  "builder_code": "MYCODE"
}
```

#### Builder codes

A builder code on a Print order earns its owner two things:

* **10% of each premium** of the order. The premium is the yield, and it is paid at the start of every cycle, so the reward applies to every roll-over. A later liquidation does not reverse it. The reward comes from Pacifica's revenue, and the user keeps the full premium.
* **The code's builder fee** on the perp position that the order delivers, charged like the fee on an order fill. The user pays this fee from the delivered margin.

Other rules:

* The user must have [approved](https://docs.pacifica.fi/programs/builder-program.md) the code with a `max_fee_rate` that covers the code's `fee_rate`, as for an order.
* The user's referrer earns nothing for an order that carries a builder code.
* A code that belongs to the user's own account or one of their subaccounts is ignored, and the order is placed without it.

See the [Builder Program](https://docs.pacifica.fi/programs/builder-program.md) for how to get a code.

#### Response

* Status 200: Order created successfully

```json theme={null}
{
  "success": true,
  "data": {
    "game_account_address": "Cdoykiss4V6kWydv7Q1EQghNqens9Hpte2iB7qjxNxc6"
  },
  "error": null,
  "code": null
}
```

`game_account_address` is the address of the new Print order.

* Status 400: Bad request

```json theme={null}
{
  "success": false,
  "data": null,
  "error": "total_segments must be between 1 and 1000",
  "code": 400
}
```

* Status 401: Unauthorized
* Status 409: Duplicate idempotency key
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "game": "BTC_24H",
    "deposit_amount": "1000.00",
    "direction": 1,
    "strike_price": "95000.00",
    "leverage": "2.0",
    "builder_code": "MYCODE"
}

response = requests.post(
    "/api/v1/game/deposit",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.