# Market

Your Algrow Market orders, deliveries and verification codes. Read-only.

Your Algrow Market orders — YouTube accounts and phone numbers — and the verification codes their numbers receive. Read-only: nothing here buys, renews or spends. The one write is your own note on an order. Every call is scoped to the orders of the account the API key belongs to.

### `GET /api/market/orders`

The authenticated user's Algrow Market orders (YouTube accounts and phone numbers), newest first, with the phone numbers each one delivered. Login details are not on the list — fetch one order for those. Read-only: nothing on this API buys or renews.

**Response 200 200**

```
{
  "success": true,
  "count": 1,
  "orders": [
    {
      "id": 2137,
      "product": "Phone number",
      "product_slug": "phone-number",
      "category": "phone-number",
      "quantity": 1,
      "status": "fulfilled",
      "amount_cents": 500,
      "created_at": "2026-09-22T09:57:19+02:00",
      "note": "cooking channel",
      "numbers": [
        {
          "index": 0,
          "phone": "4423995070",
          "live_until": "2026-10-22T09:57:19+00:00",
          "days_left": 30,
          "expired": false,
          "renews": false,
          "verified_with": true
        }
      ],
      "url": "https://algrow.online/market/order/..."
    }
  ]
}
```

**Example**

```
curl https://api.algrow.online/api/market/orders \
-H "Authorization: Bearer YOUR_API_KEY"
```

### `GET /api/market/orders/:id`

One order with its delivery: the login lines exactly as the order page shows them (email, password, recovery, 2FA link), the numbers on it, and your note. `delivery` is empty and `numbers_only` is true for a phone-number-only order. Verification codes are not in the delivery — use the code endpoint.

**Response 200 200**

```
{
  "success": true,
  "order": {
    "id": 1220,
    "product": "1-100 impressions",
    "numbers_only": false,
    "delivery": [
      "email = ... | password = ... | recovery email = ... | 2fa link = https://api2fa.com/... | 6626213410"
    ],
    "numbers": [ { "index": 0, "phone": "6626213410", "days_left": 12, "expired": false } ],
    "note": null,
    "url": "https://algrow.online/market/order/..."
  }
}
```

**Example**

```
curl https://api.algrow.online/api/market/orders/1220 \
-H "Authorization: Bearer YOUR_API_KEY"
```

404 Not on this account

### `GET /api/market/orders/:id/code`

The latest SMS verification code on one of the order's numbers, read live from the provider. `status` is `waiting` until a text arrives, `received` once `code` is set, `expired` when the number no longer takes texts. Texts from before the order was delivered are never returned. Poll every few seconds while verifying, not in a loop.

**Query Parameters**

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| index | integer | Optional | 0 | Which number on the order, 0-based, from the order's `numbers` list. Most orders have one. |

**Response 200 200**

```
{
  "success": true,
  "order_id": 2137,
  "index": 0,
  "phone": "4423995070",
  "code": "483920",
  "status": "received",
  "expiry": "2026-10-22",
  "received_at": "2026-09-22T10:02:11+00:00"
}
```

**Example**

```
curl "https://api.algrow.online/api/market/orders/2137/code?index=0" \
-H "Authorization: Bearer YOUR_API_KEY"
```

404 Not on this account 429 More than 40 reads a minute on one number

### `PATCH /api/market/orders/:id`

Set or clear your own note on an order — which channel it's used for. Shown on your order list and order page; only you see it. Content-Type `application/json`. Returns the updated order.

**Body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| note | string \| null | Required | Up to 120 characters. `null` or an empty string clears the note. |

**Example**

```
curl -X PATCH https://api.algrow.online/api/market/orders/2137 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"note": "cooking channel"}'
```

400 Missing or non-string note 404 Not on this account

### `GET /api/market/stock`

Every product on the Algrow Market with the units you can buy right now. `stock` is the exact count; `band` is `ok`, `low` (3 or fewer left) or `out`. To watch for a restock, read this about once a minute and compare with your last reading: a product is restocked when its `stock` goes from 0 to above 0. On a `503` keep your last reading. It means the count could not be read, not that the shelf is empty. Read-only: nothing here buys or reserves.

**Response 200 200**

```
{
  "success": true,
  "count": 2,
  "products": [
      {
        "slug": "1k-impressions",
        "name": "1K Impressions",
        "category": "accounts",
        "price": "$51.92",
        "price_cents": 5192,
        "stock": 0,
        "in_stock": false,
        "band": "out",
        "url": "https://algrow.online/market/1k-impressions"
      },
      {
        "slug": "2k-impressions",
        "name": "2K Impressions",
        "category": "accounts",
        "price": "$60.72",
        "price_cents": 6072,
        "stock": 14,
        "in_stock": true,
        "band": "ok",
        "url": "https://algrow.online/market/2k-impressions"
      }
  ]
}
```

**Example**

```
curl https://api.algrow.online/api/market/stock \
-H "Authorization: Bearer YOUR_API_KEY"
```

503 Stock could not be read
