# Spot - Trade - Get Order Info — Bitget

> Retrieve detailed information about a specific order on Bitget. You can query by orderId or clientOid. See the documentation

- Key: `bitget-spot-trade-get-order-info`
- Type: Action (Read-only)
- Version: 0.0.4
- App: Bitget (`bitget`) — https://pipedream.com/apps/bitget.md
- This page (HTML): https://pipedream.com/apps/bitget/actions/spot-trade-get-order-info
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/bitget/actions/spot-trade-get-order-info/spot-trade-get-order-info.mjs

## Description

Retrieve detailed information about a specific order on Bitget. You can query by orderId or clientOid. [See the documentation](https://www.bitget.com/api-doc/spot/trade/Get-Order-Info)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderId` | `string` | No | Order ID to query (either Order ID or Client Order ID is required) Options are loaded from the connected account. |
| `clientOid` | `string` | No | Client Order ID to query (either Order ID or Client Order ID is required) |
| `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 |

## 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-get-order-info",
  arguments: {
    orderId: "Order ID",
    clientOid: "Client Order ID",
  },
})
```

**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-get-order-info",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    bitget: { authProvisionId: "apn_xxxxxxx" },
    orderId: "Order ID",
    clientOid: "Client Order ID",
  },
})

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-get-order-info",
    "configured_props": {
      "bitget": { "authProvisionId": "apn_xxxxxxx" },
      "orderId": "Order ID",
      "clientOid": "Client Order ID"
    }
  }'
```

---

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