# Spot - Trade - Place Order — Bitget

> Place a spot order on Bitget. See the documentation

- Key: `bitget-spot-trade-place-order`
- Type: Action (Write)
- Version: 0.0.3
- App: Bitget (`bitget`) — https://pipedream.com/apps/bitget.md
- This page (HTML): https://pipedream.com/apps/bitget/actions/spot-trade-place-order
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/bitget/actions/spot-trade-place-order/spot-trade-place-order.mjs

## Description

Place a spot order on Bitget. [See the documentation](https://www.bitget.com/api-doc/spot/trade/Place-Order)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `symbol` | `string` | Yes | Trading pair symbol Options are loaded from the connected account. |
| `side` | `string` | Yes | Order direction |
| `orderType` | `string` | Yes | Order type |
| `price` | `string` | No | The price at which the order is executed. The decimal places of price and the price step can be returned by the Get Symbol Info interface |
| `size` | `string` | Yes | For Limit and Market-Sell orders, it represents the number of base coins. For Market-Buy orders, it represents the number of quote coins. The decimal places of amount can be got trough Get Symbol Info interface |
| `clientOid` | `string` | No | Custom client order ID. It's invalid when Spot Order Type is SPOT TP/SL Order |
| `triggerPrice` | `string` | No | SPOT TP/SL trigger price, only requried in SPOT TP/SL order |
| `tpslType` | `string` | No | Spot order type |
| `requestTime` | `string` | No | Request Time, Unix millisecond timestamp |
| `receiveWindow` | `string` | No | Valid time window, Unix millisecond timestamp. If it's set, the request is valid only when the time range between the timestamp in the request and the time that server received the request is within receiveWindow |
| `stpMode` | `string` | No | STP Mode (Self Trade Prevention) |
| `presetTakeProfitPrice` | `string` | No | Take profit price. It's invalid when Order Type is SPOT TP/SL Order. The decimal places of price and the price step can be returned by the Get Symbol Info interface |
| `presetStopLossPrice` | `string` | No | Stop loss price. It's invalid when Order Type is SPOT TP/SL Order. The decimal places of price and the price step can be returned by the Get Symbol Info interface |
| `executeTakeProfitPrice` | `string` | No | Take profit execute price. It's invalid when Order Type is SPOT TP/SL Order. The decimal places of price and the price step can be returned by the Get Symbol Info interface |
| `executeStopLossPrice` | `string` | No | Stop loss execute price. It's invalid when Order Type is SPOT TP/SL Order. The decimal places of price and the price step can be returned by the Get Symbol Info interface |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "bitget",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "bitget-spot-trade-place-order",
  arguments: {
    symbol: "Symbol",
    side: "Side",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "bitget-spot-trade-place-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bitget: { authProvisionId: "apn_xxxxxxx" },
    symbol: "Symbol",
    side: "Side",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "bitget-spot-trade-place-order",
    "configured_props": {
      "bitget": { "authProvisionId": "apn_xxxxxxx" },
      "symbol": "Symbol",
      "side": "Side"
    }
  }'
```

---

- App: https://pipedream.com/apps/bitget.md · All apps: https://pipedream.com/apps
