Skip to content

Commit 7bd4696

Browse files
fix customer endpoint, add get started to landing page
Signed-off-by: Diana <[email protected]>
1 parent 222a96f commit 7bd4696

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed

app/_landing_pages/metering-and-billing.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ rows:
2424
2525
You can meter {{site.base_gateway}} requests, LLM tokens, or any custom event.
2626
You can create and publish pricing plans, manage subscriptions, and automate revenue collection with payment providers like Stripe and ERPs.
27+
- type: button
28+
config:
29+
text: "Start metering and billing API Gateway requests &rarr;"
30+
url: /metering-and-billing/get-started/
2731

2832
- blocks:
2933
- type: image

app/metering-and-billing/customer.md

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -133,40 +133,23 @@ To create a customer in {{site.konnect_short_name}}, do the following:
133133
{:.warning}
134134
> **Important:** During the billing beta, customers are limited to **one subject**. Support for multiple subjects will be available in the future.
135135
136-
Subjects are created when you create the customer. To create a customer associated with a subject, send a `POST` request to the `/api/v1/customers` endpoint:
137-
138-
```
139-
curl https://openmeter.cloud/api/v1/customers \
140-
--request POST \
141-
--header 'Content-Type: application/json' \
142-
--header 'Authorization: Bearer $KONNECT_TOKEN' \
143-
--data '{
144-
"name": "",
145-
"description": "",
146-
"metadata": {
147-
"externalId": "019142cc-a016-796a-8113-1a942fecd26d"
148-
},
149-
"key": "",
150-
"usageAttribution": {
151-
"subjectKeys": [
152-
"$YOUR-SUBJECT"
153-
]
154-
},
155-
"primaryEmail": "",
156-
"currency": "USD",
157-
"billingAddress": {
158-
"country": "US",
159-
"postalCode": "",
160-
"state": "",
161-
"city": "",
162-
"line1": "",
163-
"line2": "",
164-
"phoneNumber": ""
165-
}
166-
}'
167-
```
168-
169-
Replace `$KONNECT_TOKEN` with your [{{site.konnect_short_name}} personal or system access token](/konnect-api/#system-accounts-and-access-tokens).
136+
Subjects are created when you create the customer. To create a customer associated with a subject, send a `POST` request to the `/openmeter/customers` endpoint:
137+
138+
<!--vale off-->
139+
{% konnect_api_request %}
140+
url: /v3/openmeter/customers
141+
status_code: 201
142+
method: POST
143+
body:
144+
name: "ACME Inc."
145+
key: "019ae40f-4258-7f15-9491-842f42a7d6ac"
146+
usageAttribution:
147+
subjectKeys:
148+
- "YOUR-SUBJECT-KEY"
149+
{% endkonnect_api_request %}
150+
<!--vale on-->
151+
152+
Replace `$KONNECT_TOKEN` with your [{{site.konnect_short_name}} personal or system access token](/konnect-api/#system-accounts-and-access-tokens) and `YOUR-SUBJECT-KEY` with the subject key from events that are associated with the customer.
170153

171154
{:.info}
172155
> {{site.konnect_short_name}} {{site.metering_and_billing}} will also automatically create a subject for you when you ingest an usage event for a new subject.

0 commit comments

Comments
 (0)