API Docs

Global settings

Supply orders invoices

Gets all Supply Order Invoices for a selected team within a specified date range

POST/https://api-get-supply-orders-invoices-kigtdz23uq-ew.a.run.app

Headers

Content-Type
application/json
string
x-api-key
<API_KEY>
string

Body Parameters

team_id
Required, not empty.
selected-team-id
string
status
Required. Must be 0, 1, or null.
0
0 | 1 | null
start_date
Required date in strict YYYY-MM-DD format.
2025-01-01
string
end_date
Required date in strict YYYY-MM-DD format. The end date is exclusive.
2026-01-01
string

cURL

curl -i \
  -X POST \
  -H "Content-Type: application/json" \
  -H "x-api-key: <API_KEY>" \
  -d '{
    "team_id": "selected-team-id",
    "status": null,
    "start_date": "2025-01-01",
    "end_date": "2026-01-01"
  }' \
  https://api-get-supply-orders-invoices-kigtdz23uq-ew.a.run.app

Response

200 Success

{
  "team": {
    "id": "selected-team-id",
    "name": "Team name"
  },
  "count": 1,
  "supply_orders": [
    {
      "id": "supplyDocumentId",
      "currency": "CHF",
      "total": 490,
      "invoices": [
        {
          "name": "Invoice name",
          "url": "https://example.com/invoice.pdf",
          "date": "2026-08-05T23:00:00Z"
        }
      ],
      "payments": [
        {
          "id": "paymentId",
          "amount": 200,
          "currency": "CHF",
          "date": "2026-08-06T10:00:00Z"
        }
      ]
    }
  ]
}

200 Success - No matching supply orders

The team exists, but no Supply Orders match the provided filters.

{
  "team": {
    "id": "selected-team-id",
    "name": "Team name"
  },
  "count": 0,
  "supply_orders": []
}

204 Successful preflight

Returned for a valid OPTIONS CORS preflight request. The response has no body.

400 Invalid payload

{
  "success": false,
  "message": "Invalid payload",
  "errors": [
    {
      "path": "start_date",
      "message": "date must use YYYY-MM-DD format"
    }
  ]
}

401 Unauthorized

{
  "error": "Unauthorized"
}

403 Origin not allowed

Only applies to OPTIONS preflight requests sent from a disallowed browser origin.

{
  "error": "Origin not allowed"
}

404 Team not found

The supplied team_id does not match an existing document in the teams collection.

{
  "error": "Team not found"
}

405 Method not allowed

The response includes the following header: Allow: POST.

{
  "error": "Method not allowed"
}

500 API key is not configured

{
  "error": "API key is not configured"
}