v38

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-192793126.4 KB
Invoices

Searches invoices.

post/invoices/search

Request body

Example request

{
  "filter": {
    "status": "open",
    "tags": {
      "any": [
        {
          "key": "department",
          "value": "eng*"
        }
      ],
      "all": [
        {
          "key": "department",
          "value": "engineering"
        }
      ]
    },
    "users": {
      "any": [
        {
          "id": "user_abc123"
        }
      ],
      "all": [
        {
          "id": "user_abc123"
        }
      ]
    },
    "transaction_tags": {
      "any": [
        {
          "key": "department",
          "value": "eng*"
        }
      ],
      "all": [
        {
          "key": "department",
          "value": "engineering"
        }
      ]
    },
    "user_tag_and_balance": {
      "user_tags": {
        "any": [
          {
            "key": "department",
            "value": "eng*"
          }
        ],
        "all": [
          {
            "key": "department",
            "value": "engineering"
          }
        ],
        "not_any": [
          {
            "key": "department",
            "value": "eng*"
          }
        ]
      },
      "net_remaining_balance": {
        "gt": "0"
      }
    },
    "created": {
      "after": "2026-01-01T00:00:00Z",
      "before": "2026-02-01T00:00:00Z"
    },
    "modified": {
      "after": "2026-01-01T00:00:00Z",
      "before": "2026-02-01T00:00:00Z"
    }
  },
  "page_info": {
    "limit": 20
  }
}

Response

Success

Example response

{
  "data": {
    "invoices": [
      {
        "id": "inv_1234567890",
        "workspace_id": "ws_1234567890",
        "status": "active",
        "line_items": [
          {
            "id": "item_1234567890",
            "type": "payout",
            "product_id": "prod_1234567890",
            "amount": "1000",
            "price": {
              "amount": "1000",
              "unit_price": "1000",
              "quantity": 1
            },
            "currency_code": "USD",
            "description": "Professional services for January 2026",
            "user_id": "user_ext_456",
            "tags": [
              {
                "key": "department",
                "value": "engineering"
              }
            ]
          }
        ],
        "created": "2024-01-13T00:00:00Z",
        "modified": "2024-01-13T00:00:00Z",
        "version": 1,
        "tags": [
          {
            "key": "department",
            "value": "engineering"
          }
        ],
        "users": [
          {
            "id": "user_ext_789",
            "external_id": "user_ext_789",
            "balances": [
              {
                "payins": {
                  "expected": "10000",
                  "actual": "5000",
                  "remaining": "5000"
                },
                "payouts": {
                  "expected": "10000",
                  "actual": "5000",
                  "remaining": "5000"
                },
                "net": {
                  "expected": "10000",
                  "actual": "5000",
                  "remaining": "5000"
                },
                "currency": "USD"
              }
            ]
          }
        ],
        "balances": [
          {
            "payins": {
              "expected": "10000",
              "actual": "5000",
              "remaining": "5000"
            },
            "payouts": {
              "expected": "10000",
              "actual": "5000",
              "remaining": "5000"
            },
            "net": {
              "expected": "10000",
              "actual": "5000",
              "remaining": "5000"
            },
            "currency": "USD"
          }
        ],
        "payments": [
          {
            "amount": "150",
            "currency": "USD",
            "transaction": {
              "id": "txn_dHhuX2ZyYWdfMDAx",
              "external_id": "bank_txn_123",
              "tags": [
                {
                  "key": "department",
                  "value": "engineering"
                }
              ]
            },
            "type": "payin",
            "posted": "2024-01-13T00:00:00Z",
            "user": {
              "id": "user_abc123",
              "external_id": "user_ext_001"
            }
          }
        ]
      }
    ]
  }
}