# Orders

### 1. Get all orders by platform Id

You will need to know how to get all orders by `platformId`, you will need to make a POST request to the `/orders/{platformId}` endpoint with your `platformId`. Make sure to fill in the required fields in the request body.

```http
POST /api/solanaplay/orders/platformId
```

Request body:

```json
{
  "platformId": "unique-platform-id"
}
```

\
Response examples:\
You will receive response 200(success) :

```json
[
  {
    "platformId": "platform-id",
    "itemId": "item-id",
    "playerId": "player-id",
    "quantity": 1,
    "payToken": "So11111111111111111111111111111111111111112",
    "tokenName": "token-name",
    "qrRefId": "qr-reference-id",
    "playerRefId": "player-reference-id",
    "itemRefId": "item-reference-id",
    "itemPlatId": "item-platform-id",
    "playerPlatformId": "player-platform-id",
    "platCustPub": "platform-customer-public-key",
    "payAmount": 0,
    "price": 0,
    "label": "label-text",
    "description": "item-description",
    "icon": "http://example.com",
    "link": "http://example.com",
    "createdUTC": 0,
    "account": "account-id",
    "orderUTC": 0,
    "blockheight": 0,
    "encodedWt": "encoded-wt",
    "originalReference": "original-reference",
    "lastModified": "2019-08-24T14:15:22Z",
    "tx": "transaction-data",
    "txUTC": 0,
    "txSignature": "transaction-signature",
    "txLookupUTC": 0
  }
]

```

Or a default message error:

```json
{
  "error": {
    "code": 0,
    "message": "error-message"
  }
}
```

If successful you will receive a `platformId`, `itemId`, and `playerId` in the response. If in the event of an error a default message will occur.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://moonshine-labs.gitbook.io/solanaplay/orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
