{
  "info": {
    "name": "FX-Port Account API",
    "_postman_id": "fxport-api-account-sandbox-v2",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "FX-Port Account API: Postman collection of the documentation at https://fx-port.com/docs (generated 2026-11-01).\n\n**Setup.** Set the collection variable (or an environment) `api_key` to your own key: `fxp_test_...` for the sandbox, `fxp_live_...` for live. The base URL is the same for both, the key decides. The collection holds no key: add yours, and never commit it.\n\n**Names.** Requests use snake_case names. Previous camelCase spellings still work; the response then carries a `warnings` array and `X-FX-Deprecated-Fields` header that name the spelling to use. Add `?naming=snake` to any request for snake_case keys in the response.\n\n**Errors.** Every failure has the same body: `errors[].code`, `errors[].type`, `errors[].message`, and a `request_id` to quote to support.\n\nAccount endpoints: balances, financial ledger, and booking history. Auth: Bearer token in Authorization header.\n\nQuestions: dev@fx-port.com"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.fx-port.com",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "fxp_test_YOUR_KEY",
      "type": "string",
      "description": "Your FX-Port API key (fxp_live_... or fxp_test_...). Get it at https://fx-port.com/dashboard/api"
    },
    {
      "key": "balance_id",
      "value": "",
      "type": "string"
    },
    {
      "key": "booking_id",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Get Balances",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{base_url}}/api/v1/balances",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "balances"
          ]
        },
        "description": "Returns current balance for each currency. Capture the uid=502(mez) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),703(com.apple.sharepoint.group.3),33(_appstore),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae),702(com.apple.sharepoint.group.2),701(com.apple.sharepoint.group.1) field as  for the history endpoint. Sandbox returns empty array.\n\n<!-- fx-generated -->\n**Permission:** Read (a read-only key is enough)\n\n**Docs:** [API reference](https://fx-port.com/docs/api/list-balances) · [List balances](https://fx-port.com/docs/account/balances)"
      },
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "try { const d=pm.response.json(); const b=(d.data||[])[0]; if(b&&b.id) pm.collectionVariables.set(\"balance_id\",b.id); } catch(e){}"
            ]
          }
        }
      ]
    },
    {
      "name": "Get Balance History",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{base_url}}/api/v1/balances/{{balance_id}}/history?from=2026-01-01&limit=50",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "balances",
            "{{balance_id}}",
            "history"
          ],
          "query": [
            {
              "key": "from",
              "value": "2026-01-01"
            },
            {
              "key": "limit",
              "value": "50"
            }
          ]
        },
        "description": "Full financial ledger for a specific currency balance. Use transactions rows for reconciliation totals; use *_balance_operations rows to trace individual booking history.\n\n<!-- fx-generated -->\n**Permission:** Read (a read-only key is enough)\n\n**Docs:** [API reference](https://fx-port.com/docs/api/get-balance-history) · [Balance history](https://fx-port.com/docs/account/balance-history)"
      }
    },
    {
      "name": "Get Booking History",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{base_url}}/api/v1/history?product=all&limit=20",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "history"
          ],
          "query": [
            {
              "key": "product",
              "value": "all"
            },
            {
              "key": "limit",
              "value": "20"
            }
          ]
        },
        "description": "Booking summaries across all products, sorted newest first.\n\n<!-- fx-generated -->\n**Permission:** Read (a read-only key is enough)\n\n**Docs:** [API reference](https://fx-port.com/docs/api/list-booking-history) · [Booking history](https://fx-port.com/docs/account/history)"
      }
    },
    {
      "name": "Get Single Booking",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{base_url}}/api/v1/bookings/{{booking_id}}?product=flights",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "api",
            "v1",
            "bookings",
            "{{booking_id}}"
          ],
          "query": [
            {
              "key": "product",
              "value": "flights"
            }
          ]
        },
        "description": "Detail record for a single booking. For flights: includes pricing breakdown, traveler pricing, and balance operations.\n\n<!-- fx-generated -->\n**Permission:** Read (a read-only key is enough)\n\n**Docs:** [API reference](https://fx-port.com/docs/api/get-account-booking) · [Booking detail](https://fx-port.com/docs/account/booking-detail)"
      }
    }
  ]
}
