# Partner API

Place Group Payout orders from your own server. Orders are paid from your wallet at the same prices as the website and go through the same checks (group membership, days in group, group funds).

Base URL: https://neurobux.shop

## Getting access

- Open Account → Partner API and send a request. An admin reviews every request.
- Once approved, create a key there. The key is shown only once: store it on your server. Up to 3 keys can be active.
- Never put the key in a browser, an app or a public repository. Anyone with the key can spend your wallet. Revoke a leaked key at once.

## Authentication

Send the key in the Authorization header of every request. Request and response bodies are JSON.

```bash
curl https://neurobux.shop/api/partner/v1/balance \
  -H "Authorization: Bearer nbx_your_key"
```

## Rate limits

Limits are per account (all your keys together), per minute. Over a limit you get 429 with a Retry-After header in seconds; wait that long before trying again.

- All endpoints together: 90 requests per minute.
- Each endpoint has its own limit, listed below.
- One order per account per minute, as on the website (ORDER_COOLDOWN).
- Per IP address: 60 requests per minute. 10 wrong or revoked keys from one IP block that IP for 15 minutes.

## Currency

Your wallet is in VND. Send currency "vnd" (default) or "usd". With "usd", a group that has a fixed USD price is priced in USD and charged in VND at the live rate (priceUsd and priceVnd are both returned). A group without a USD price is priced in VND, and currency comes back as "vnd".

## Endpoints

### GET /api/partner/v1/balance

Wallet balance. (20 / min)

Response:

```json
{ "balanceVnd": 1250000, "balanceUsd": 47.5, "usdVnd": 26300 }
```

### GET /api/partner/v1/groups

Groups open for orders: prices per 1,000 R$, optional quantity tiers, minimum order, days in group required and Robux still free for new orders. (10 / min)

Response:

```json
{
  "ordersOpen": true,
  "defaultGroupId": "123456",
  "usdVnd": 26300,
  "groups": [{
    "groupId": "123456",
    "name": "Neurobux Group",
    "url": "https://www.roblox.com/communities/123456",
    "minDays": 14,
    "minRobux": 100,
    "remainingRobux": 250000,
    "rateVndPer1000": 120000,
    "rateUsdPer1000": 4.6,
    "priceTiers": [{ "minRobux": 10000, "rateVndPer1000": 115000, "rateUsdPer1000": 4.4 }]
  }]
}
```

### POST /api/partner/v1/quote

Price and eligibility for one order. Nothing is charged. Asks Roblox, so call it only when you need it. (10 / min)

Request:

```json
{ "username": "Builderman", "groupId": "123456", "robuxAmount": 1000, "currency": "usd" }
```

Response:

```json
{
  "groupId": "123456",
  "robuxAmount": 1000,
  "eligible": true,
  "memberStatus": "MEMBER",
  "robloxUser": { "id": 156, "username": "builderman", "displayName": "Builderman" },
  "membership": { "joinedAt": "2026-10-01T08:00:00.000Z", "eligibleAt": "2026-10-15T08:00:00.000Z",
                  "daysInGroup": 54, "minimumDays": 14, "daysRemaining": 0 },
  "currency": "usd",
  "priceVnd": 120980,
  "priceUsd": 4.6,
  "usdVnd": 26300,
  "balanceVnd": 1250000,
  "enoughBalance": true,
  "remainingRobux": 250000,
  "enoughFunds": true
}
```

### POST /api/partner/v1/orders

Place an order. externalId is your own id for the order (1–64 characters: letters, digits, _ . : -) and is required. Sending the same externalId again returns the first order with "duplicate": true and never charges twice, so a timed-out request can be retried safely. expectedPriceVnd / expectedPriceUsd are optional: the order is refused (409 PRICE_CHANGED) when the price is no longer that one. (5 / min)

Request:

```json
{
  "externalId": "shop-order-10045",
  "username": "Builderman",
  "groupId": "123456",
  "robuxAmount": 1000,
  "currency": "usd",
  "expectedPriceUsd": 4.6
}
```

Response:

```http
HTTP/1.1 201 Created

{
  "duplicate": false,
  "order": {
    "orderId": "GRP-1795423385748-1BC5AE94",
    "externalId": "shop-order-10045",
    "status": "processing",
    "refunded": false,
    "robloxUsername": "builderman",
    "robloxUserId": 156,
    "robuxAmount": 1000,
    "groupId": "123456",
    "groupName": "Neurobux Group",
    "currency": "usd",
    "priceVnd": 120980,
    "priceUsd": 4.6,
    "createdAt": "2026-11-24T09:00:00.000Z",
    "updatedAt": "2026-11-24T09:00:02.000Z"
  }
}
```

### GET /api/partner/v1/orders/{orderId}

One order by orderId. Poll this for the status. (60 / min)

Response:

```json
{
  "order": {
    "orderId": "GRP-1795423385748-1BC5AE94",
    "externalId": "shop-order-10045",
    "status": "processing",
    "refunded": false,
    "robloxUsername": "builderman",
    "robloxUserId": 156,
    "robuxAmount": 1000,
    "groupId": "123456",
    "groupName": "Neurobux Group",
    "currency": "usd",
    "priceVnd": 120980,
    "priceUsd": 4.6,
    "createdAt": "2026-11-24T09:00:00.000Z",
    "updatedAt": "2026-11-24T09:00:02.000Z"
  }
}
```

### GET /api/partner/v1/orders?externalId=…  |  ?limit=20&before=…

Find an order by your externalId, or page through your orders, newest first (pass nextBefore as before for the next page). (60 / min)

Response:

```json
{
  "orders": [ ... ],
  "nextBefore": "2026-11-20T03:12:44.000Z"
}
```

## Order status

Orders are usually completed within a few minutes. Poll GET /orders/{orderId} every 15–30 seconds while an order is pending or processing.

- pending: placed and paid, waiting to be sent.
- processing: being sent from the group.
- completed: Robux sent.
- failed: not sent. The price is back in your wallet (refunded: true).

## Errors

Errors are JSON with a stable code, an English message and sometimes extra fields. Act on the code, not the message.

Common codes: PARTNER_INVALID_KEY (401), PARTNER_NOT_APPROVED (403), RATE_LIMITED / ORDER_COOLDOWN (429), INSUFFICIENT_BALANCE, INVALID_GROUP, BELOW_MIN_ROBUX (minRobux), MEMBER_NOT_MEMBER, MEMBER_NOT_ENOUGH_DAYS (minDays), GROUP_INSUFFICIENT_ROBUX (available), USER_NOT_FOUND (404), PRICE_CHANGED (409), ORDER_IN_PROGRESS (409), ORDER_NOT_FOUND (404), MAINTENANCE_MODE / GROUP_PAYOUT_DISABLED (orders are paused), INTERNAL_ERROR (500).

When an order request fails with an error, nothing was charged.

```http
HTTP/1.1 429 Too Many Requests
Retry-After: 42

{
  "error": {
    "code": "ORDER_COOLDOWN",
    "message": "Wait 42s before placing another order",
    "seconds": 42
  }
}
```
