Usages

Create a usage

POST https://api.piriod.com/usages/

Creates a new Usage object.

Request Body

NameTypeDescription

subscription_line

string

ID of a Subscription Line object.

date_time

string

Datetime of usage record. Format YYYY-MM-DD HH:mm:ss

quantity

number

The usage quantity for the specified datetime.

{
    "id": "usa_JeIrC8AL7W4hg2ch5No886fHWKTm",
    "subscription_line": "sub_CYtwWa8sL88VE3grCS",
    "quantity": 7.0,
    "date_time": "2020-08-31T12:00:00-04:00",
    "created": "2020-09-31T21:10:57.456633-04:00"
}

List usages

GET https://api.piriod.com/usages/

Retrieves a list of Usages objects.

Query Parameters

NameTypeDescription

date_time

string

Datetime to filter usage records.

subscription_line

string

ID to filter usage records by Subscription Line object.

{
    "count": 28,
    "next": "https://api.simpledte.com/usages/?page=2",
    "previous": null,
    "results": [
        {
            "id": "usa_JeIrC8AL7W4hg2ch5No886fHWKTm",
            "subscription_line": "sub_CYtwWa8sL88VE3grCS",
            "quantity": 7.0,
            "date_time": "2020-08-31T12:00:00-04:00",
            "created": "2020-09-31T21:10:57.456633-04:00"
        },
        ...
    ]
}

Destroy a usage

DELETE https://api.piriod.com/usages/{{id}}/

Destroy a Usage object.

Path Parameters

NameTypeDescription

id

string

ID of the Usage object.

Last updated