Stykite
  1. Usage
Stykite
  • Introduction
    • What is Stykite?
    • Who should use Stykite?
    • When Stykite isn't the right fit?
    • Key Concepts
    • Pre-requisites: Account & API Keys
  • Getting Started
    • Setup your Tracking & Billing
    • Integrate Subscription Plans & Payments
    • Setup Payments
      • Configuring Razorpay Webhooks for Stykite
  • API Reference
    • Customer Facing Widgets
      • Pricing Widget Integration Guide
      • My Account Widget Integration
      • Subscribe Button
    • API Reference
      • Webhooks
        • Customer Subscription Status Update
        • Add-on Purchase Success
      • Usage
        • Send Usage
          POST
      • Customer
        • Create Customer with Auto Subscribe
        • Get Customer and Subscription Details
        • Update Customer Meter Entitlements
      • Subscription
        • Create Subscription
        • Cancel Subscription
        • Update Subscription
      • Checkpoint
        • Track Checkpoint Usage API
  • Learning Stykite
    • Subscriptions & Plans
    • Add-ons
    • Pricing Versions
    • Manual Subscriptions & Exclusive Plans
    • Invoices
    • Payments
    • Sales Tax
    • Customers
    • Transactions & Refunds
    • Settings
  1. Usage

Send Usage

POST
/v1/company/{companyId}/country/{countryId}/customer/{customerIdentifier}/usage
This API endpoint allows you to send meter usage data for individual customers to the Stykite platform. The provided data will be used to generate invoices based on the recorded usage. This process ensures accurate billing and helps manage customer consumption effectively.

Request Parameters#

Path Parameters:
company_id (string, required): The unique identifier of the company.
country_id (string, required): The unique identifier of the country.
customer_identifier (string, required): A unique identifier for the customer.
Headers:
Authorization (string, required): The authorization token in the format Bearer .
Content-Type (string, required): The content type of the request, should be application/json.
Body Parameters:
An array of meter usage data objects.
timestamp (number, required): The timestamp of the meter reading.
meter_id (string, required): The unique identifier of the meter associated with the usage data.
qty (number, required): The quantity of usage recorded till timestamp.

Response#

Upon successful submission of the meter usage data, the API returns a response with status code 202 Accepted confirming the receipt of the data

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Header Params

Body Params application/json

Example
[
    {
        "timestamp": 1697363618832,
        "meter_id": "MTR-0DWBEZWHFSBBQ",
        "qty": 26
    }
]

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://sandbox.api.stykite.com/v1/company/COM-0FR3TQHKW0YBJ/country/CON-0AZZVPQHM475V/customer/c56164ad-3d54-4eaa-ae3d-46fe3969972b/usage' \
--header 'Authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data-raw '[
    {
        "timestamp": 1697363618832,
        "meter_id": "MTR-0DWBEZWHFSBBQ",
        "qty": 26
    }
]'

Responses

🟢200Success
application/json
Body

Example
{}
Modified at 2024-06-08 10:21:08
Previous
Add-on Purchase Success
Next
Create Customer with Auto Subscribe
Built with