Billing Charges API

Charges attributes

Please refer to the definition of the Charge data type in our OpenAPI documentation.

List charges

This endpoint is currently in Public Preview. During the Preview period changes may occur at any time.

Consider using our official clients to reduce the likelihood of breaking changes. If you are using or planning to use this endpoint we'd like to hear your feedback.

Lists the billing charges for the account.

GET /:account/billing/charges

Parameters

Name Type Description
:account integer The account ID

Filters

Name Description
:start_date Only include results after the given date. Format is ISO8601 (YYYY-MM-DD).
:end_date Only include results before the given date. Format is ISO8601 (YYYY-MM-DD).

The default period is the last 1 year.

Sorting

For general information about sorting, please refer to the main guide.

Name Description
invoiced Sort charges by their invoiced date-time.

The default sorting policy is by ascending invoiced.

Examples

List all billing charges in the account 1385:

curl  -H 'Authorization: Bearer <token>' \
        -H 'Accept: application/json' \
        https://api.dnsimple.com/v2/1385/billing/charges

List all billing charges in the account 1385 that have been invoiced since 2023-01-01:

curl  -H 'Authorization: Bearer <token>' \
        -H 'Accept: application/json' \
        https://api.dnsimple.com/v2/1385/billing/charges?start_date=2023-01-01

List all billing charges in the account 1385 that have been invoiced between 2023-01-01 and 2023-02-01:

curl  -H 'Authorization: Bearer <token>' \
        -H 'Accept: application/json' \
        https://api.dnsimple.com/v2/1385/billing/charges?start_date=2023-01-01&end_date=2023-02-01

Response

Responds with HTTP 200.

{
  "data": [
    {
      "invoiced_at": "2023-08-17T05:53:36Z",
      "total_amount": "14.50",
      "balance_amount": "0.00",
      "reference": "1-2",
      "state": "collected",
      "items": [
        {
          "description": "Register bubble-registered.com",
          "amount": "14.50",
          "product_id": 1,
          "product_type": "domain-registration",
          "product_reference": "bubble-registered.com"
        }
      ]
    },
    {
      "invoiced_at": "2023-08-17T05:57:53Z",
      "total_amount": "14.50",
      "balance_amount": "0.00",
      "reference": "2-2",
      "state": "refunded",
      "items": [
        {
          "description": "Register example.com",
          "amount": "14.50",
          "product_id": 2,
          "product_type": "domain-registration",
          "product_reference": "example.com"
        }
      ]
    },
    {
      "invoiced_at": "2023-10-24T07:49:05Z",
      "total_amount": "1099999.99",
      "balance_amount": "0.00",
      "reference": "4-2",
      "state": "collected",
      "items": [
        {
          "description": "Test Line Item 1",
          "amount": "99999.99",
          "product_id": null,
          "product_type": "manual",
          "product_reference": null
        },
        {
          "description": "Test Line Item 2",
          "amount": "1000000.00",
          "product_id": null,
          "product_type": "manual",
          "product_reference": null
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 30,
    "total_entries": 3,
    "total_pages": 1
  }
}

Errors

Responds with HTTP 400 if the certificate cannot be ordered.

Responds with HTTP 401 in case of authentication issues.