GET

/user/v1/invoices

List invoices

Lists invoices.

query parameters

  • organizationId

    string

    Show results for specified organization.

    If this is not provided the user's individual subscription(s) will be returned.

  • pageSize

    int32

    The maximum number of invoices to return. The API may return fewer than this value.

    If unspecified, at most 20 invoices will be returned. The maximum value is 100; values above 100 will be coerced to 100.

  • pageToken

    string

    A page token, received from a previous list invoices call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to list invoices must match the call that provided the page token.

  • orderBy

    string

    A comma-separated list of fields to order by.

    Supports:

    • createTime asc
    • createTime desc

Returns

  • invoices

    Invoice[]

    The list of invoices.

  • nextPageToken

    string

    A token, which can be sent as pageToken to retrieve the next page. If this field is omitted, there are no subsequent pages.

  • previousPageToken

    string

    A token, which can be sent as pageToken to retrieve the previous page. If this field is absent, there are no preceding pages. If this field is an empty string then the previous page is the first result.

curl https://api.userhub.com/user/v1/invoices?organizationId=org_28seyVGVL1got6 \
  -H "UserHub-Api-Key: $USER_API_KEY" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
Response bodyJSON
{
  "invoices": [
    {
      "id": "in_4QPqKvtqkpJzP7",
      "state": "OPEN",
      "stateTime": null,
      "number": "ACME-123",
      "currencyCode": "USD",
      "description": "This is a test.",
      "account": {
        "fullName": "Jane Doe",
        "email": "[email protected]",
        "phoneNumber": "+12125550123",
        "address": {
          "lines": [
            "42 West St"
          ],
          "city": "Brooklyn",
          "state": "NY",
          "postalCode": "11222",
          "country": "US"
        }
      },
      "effectiveTime": "2024-06-15T13:00:00Z",
      "period": {
        "startTime": "2024-06-15T13:00:00Z",
        "endTime": "2024-06-15T13:00:00Z"
      },
      "subtotalAmount": "9",
      "discountAmount": "1",
      "balance": {
        "startAmount": "100",
        "endAmount": "200",
        "appliedAmount": "-100"
      },
      "taxAmount": "2",
      "dueAmount": "10",
      "dueTime": "2024-06-15T13:00:00Z",
      "paidAmount": "0",
      "paymentIntent": null,
      "items": [
        {
          "id": "ii_35kH3awC",
          "product": null,
          "price": null,
          "quantity": 2,
          "subtotalAmount": "10",
          "discountAmount": "1",
          "description": "This is a test item.",
          "period": null
        }
      ],
      "changes": [],
      "createTime": "2024-06-15T13:00:00Z",
      "updateTime": "2024-06-15T13:00:00Z"
    }
  ],
  "nextPageToken": ""
}
PreviousThe invoice object
NextGet an invoice

Turn users intorevenue
$

Subscribe to monthly product updates

© 2024 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & Custom Auth