Skip to main content
GET
/
v1
/
customer-meters
/
{id}
PHP (SDK)
declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->customerMeters->get(
    id: '<value>'
);

if ($response->customerMeter !== null) {
    // handle response
}
{
  "id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "modified_at": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "meter_id": "<string>",
  "consumed_units": 123,
  "credited_units": 123,
  "balance": 123,
  "customer": {
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "metadata": {},
    "email": "<string>",
    "email_verified": true,
    "type": "<string>",
    "name": "John Doe",
    "billing_address": {
      "line1": "<string>",
      "line2": "<string>",
      "postal_code": "<string>",
      "city": "<string>",
      "state": "<string>"
    },
    "tax_id": {
      "[0]": "<string>"
    },
    "organization_id": "<string>",
    "deleted_at": "2023-11-07T05:31:56Z",
    "avatar_url": "<string>",
    "external_id": "usr_1337",
    "locale": "<string>",
    "default_payment_method_id": "<string>"
  },
  "meter": {
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "modified_at": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "name": "<string>",
    "filter": {
      "clauses": [
        {
          "property": "<string>",
          "value": "<string>"
        }
      ]
    },
    "aggregation": {
      "func": "count"
    },
    "organization_id": "<string>",
    "custom_label": "<string>",
    "custom_multiplier": 123,
    "archived_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

You can generate an Organization Access Token from your organization's settings.

Path Parameters

id
string<uuid4>
required

The customer meter ID.

Response

Successful Response

An active customer meter, with current consumed and credited units.

id
string<uuid4>
required

The ID of the object.

created_at
string<date-time>
required

Creation timestamp of the object.

modified_at
string<date-time> | null
required

Last modification timestamp of the object.

customer_id
string<uuid4>
required

The ID of the customer.

Example:

"992fae2a-2a17-4b7a-8d9e-e287cf90131b"

meter_id
string<uuid4>
required

The ID of the meter.

Example:

"d498a884-e2cd-4d3e-8002-f536468a8b22"

consumed_units
number
required

The number of consumed units.

Example:

25

credited_units
integer
required

The number of credited units.

Example:

100

balance
number
required

The balance of the meter, i.e. the difference between credited and consumed units.

Example:

75

customer
CustomerIndividual · object
required

The customer associated with this meter.

meter
Meter · object
required

The meter associated with this customer.