Saaslogic
  1. Usage Reporting
Saaslogic
  • Introduction
  • Authentication
  • Enum Reference
  • Authentication
    • saaslogic token
      • Get the saaslogic access token
    • login Url
      • Gives the login URL
    • logout Url
      • Gives the logout URL
  • Countries
    • Get list of countries
  • Plans
    • List all plans for a product
  • Subscriptions
    • Create a product subscription
    • Retrieve a subscription
    • Create Customer and Subscription
    • Subscription with details permissions, menus and features
    • The Saaslogic URL for creating subscription
  • Usage Reporting
    • Report the resource usages in subscription for invoicing
      POST
    • Retrieves the resource usages of a subscription in the current billing cycle
      GET
  • Customers
    • addresses
      • Create an address
      • List all addresses
      • Update an address
      • Retrieve an address
      • Delete an address
    • contacts
      • Create a contact
      • List all contacts
      • Update a contact
      • Retrieve a contact
      • Delete a contact
    • Create a customer
    • List all customers
    • Update a customer
    • Retrieve a customer
    • Delete a customer
  • Vendors
    • vendor addresses
      • Create a vendor address.
      • List all vendor addresses.
      • Update a vendor address.
      • Retrieve a vendor address..
      • Delete a vendor address.
    • vendor contacts
      • Create a vendor contact.
      • List all vendor contacts.
      • Update a vendor contact.
      • Retrieve a vendor contact.
      • Delete a vendor contact.
    • vendor bills
      • Create a vendor bill
      • Cancel a vendor bill.
    • vendor bills payout
      • Update payment details to vendor bills.
    • Create a vendor
    • Update a vendor.
    • Activate a vendor.
    • Dectivate a vendor.
  • Attributes
    • Create a organization attribute and set the value
    • Retrieve a organization attribute
    • Create a user attribute
    • Update a user attribute
    • Get a user attribute
  • Invoices
    • subscriptions
      • Get the invoices
      • Get the invoices by subscription
    • payments
      • Mark the invoice payment status
    • Get the invoice details .
    • cancel the invoices
    • Send invoice as pdf with payment link.
    • Create an on-demand invoice
  1. Usage Reporting

Report the resource usages in subscription for invoicing

POST
/subscriptions/{subscriptionId}/resources
Resource Usage
Report the resource usage for the given subscription for metered or pay as you go billing.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-sandbox.saaslogic.io/v1/subscriptions/6e023839c6104389aa3946a0b4ef9A/resources' \
--header 'Accept: application/json' \
--header 'Accept;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "usageDate": "2024-07-25T15:00:00",
    "reportingType": "Add",
    "usageDetails": [
        {
            "resourceId": "550e8400-e29b-41d4-a716-446655440000",
            "value": 123.45,
            "uomId": "550e8400-e29b-41d4-a716-446655440001"
        }
    ]
}'
Response Response Example
{
  "message": "UN_AUTHORIZED"
}

Request

Path Params
subscriptionId
string 
required
(Required) The subscription ID.
Example:
6e023839c6104389aa3946a0b4ef9A
Header Params
Content-Type
string 
required
Example:
application/json
Accept
string 
required
Example:
application/json
Authorization
string 
required
Saaslogic authorization token
Default:
Bearer {{bearerToken}}
Body Params application/json
usageDate
string 
optional
The date and time when the usage was recorded.
Example:
2024-07-25T15:00:00
reportingType
string 
optional
The type of reporting action, e.g., 'Add' for adding usage data.
Example:
Add
usageDetails
array [object {3}] 
optional
A list of usage details specifying resources and their usage values.
resourceId
string 
optional
The ID of the resource being consumed.
Example:
550e8400-e29b-41d4-a716-446655440000
value
number 
optional
The amount of the resource used.
Example:
123.45
uomId
string 
optional
The unit of measurement ID associated with the resource usage.
Example:
550e8400-e29b-41d4-a716-446655440001
Examples

Responses

🟢200Resource usage reported successfully
This response does not have a body.
🔴500ErrorResponse
Previous
The Saaslogic URL for creating subscription
Next
Retrieves the resource usages of a subscription in the current billing cycle
Built with