List Billing

Copied
Arrow

                https://api.ocamba.com/v2/ocamba/usage
            

Retrieves Billing details


Name
Description
fieldsstring
The client can request more efficient filtered representation of the resource showing only specific field(s), using the “fields” query parameter. Note that the “fields” parameter has precedence over the “view” parameter.

Example GET /v2/ocamba/RESOURCE_NAME?fields=id,name

See "Tips" for the list of filterable parameters.


Example: fields=field1,field2,field3

viewstring
Ocamba API returns full representation of the resource using the “view=full” query parameter. If not specified, the default view will be used.

Note that the “fields” parameter has precedence over the “view” parameter.


Example: view=full/default

pagestring
The page number indicates which set of items will be returned in the response. The format of request is "page=N,M" where 'N' (required) represents page number and 'M' (optional) is number of items per page.

Examples:
N=1, M=20 → returns page 1 with 20 items
N=2, M=20 → returns page 2 with 20 items (items 21-40)
N=3 → returns page 3. The number of objects returned depends on the resource settings.


Example: page=1,10

sortstring
Sorts the response by specified field(s) with the option to specify sorting order (ascending by default, add prefix "-" for descending).

Examples:
GET /v2/ocamba/RESOURCE_NAME?sort=name → sorts per name, ascending
GET /v2/ocamba/RESOURCE_NAME?sort=-id → sorts per id descending
GET /v2/ocamba/RESOURCE_NAME?sort=id,-name → sorts per id ascending, then name descending

See tips for the list of sortable fields.


Example: sort=-field1,filed2

q_fieldsstring
Use the q_fields parameter to list all fields you want to include in the search using q parameter. Note that not all fields are searchable on a specific object. If parameter q_fields is not specified, search is performed on a default search field.

Examples:
GET /v2/ocamba/members?q=sou&q_fields=lname → API retuns members whose lname contains string 'sou'.
GET /v2/ocamba/members?q=sou&q_fields=fname,lname,email → API returns members that contain string 'sou' in any of the specified fields.

See tips for the list of searchable parameters.


qstring
Set the q parameter value to search for a keyword or search term.

Example:
GET /v2/ocamba/members?q=sou → returns members that contain string 'sou'

See tips for the list of searchable parameters.

idinteger
Unique identifier for the object defined as a query parameter.


Example: id=12346

create_timestring
Timezone: GMT.


Example: create_time=2021-09-14

update_timestring
Timezone: GMT.


Example: update_time=2021-09-14

pricenumber
App total price.


Example: price=1

discountnumber
App total discount.


Example: discount=1.1

amountnumber
App total amount.


Example: amount=1.2

currency_codestring
Three-letter, uppercase currency code.


Example: currency_code=USD

limit_statusstring
Describe a limit status.


Example: limit_status=0

usage_percentinteger
App usage percent.


Example: usage_percent=100

start_timestring
Timezone: GMT.


Example: start_time=2021-04-01

end_timestring
Timezone: GMT.


Example: end_time=2021-04-01

Name
Description
app_idstringrequired
A unique company identifier generated by the Ocamba platform.


Example: app_id=12345


200 - OK
Arrow
Name
Description
items[ usage ]
An array of all created items.
Usage
Name
Description
amountfloat
App total amount.


Example: 1.2

appobject
App object.
Name
Description
create_timedateTime
Timezone: GMT.


Example: 2021-11-25 13:45:03

descriptionstring
Additional information about an app.


Example: here goes description

idstring
A unique identifier generated by the Ocamba platform.


Example: 123456789

logostring (uri)
Represent the logo of app.


Example: https://logo-uri-example.com

namestring
Represent name of the app.


Example: adex

planstring
Represent the pricing plan.


Example: '{ "features" : ["billing"] }'

titlestring
Represent the title of the app.


Example: AdExchange

typestring
Describe app type.


Example: application

Possible values: application | spa

Default: application

update_timedateTime
Timezone: GMT.


Example: 2021-11-26 11:37:25

app-idstring
A unique app identifier generated by the Ocamba platform.


Example: 1000163

company_idstring
A unique company identifier generated by the Ocamba platform.


Example: 10013213

create_timedateTime
Timezone: GMT.


Example: 2021-07-30 12:50:13

currency_codestring
Three-letter, uppercase currency code.


Example: USD

discountfloat
App total discount.

end_datedateTime
Timezone: GMT.


Example: 2021-07-30

idstring
A unique identifier generated by the Ocamba platform.


Example: 1998

items[ object ]
Array of usage items objects.

limit_statusstring
Describe a limit status.


Example: 0

Possible values: 0 | 1

Default: 0

pricefloat
App total price.


Example: 10.99

start_datedateTime
Timezone: GMT.


Example: 2021-07-20

update_timedateTime
Timezone: GMT.


Example: 2021-07-30 12:50:13

usage_percentinteger
App usage percent.


Example: 100

totalinteger
A total number of items.


Example: 3
tip
1 Searchable field is items.

2 Sortable fields are: price, discount, amount, currency_code, limit_status, usage_percent, start_date, end_date, create_time and update_time.
200 Arrow
{
    "total": 3,
    "items": [
        {
            "id": "1971",
            "company_id": "6197120",
            "app_id": "1001",
            "items": [
                {
                    "name": "adex requests",
                    "quantity": 5938,
                    "unit_price": 0,
                    "price": 0,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 0,
                    "amount": 0,
                    "description": "Adex Requests",
                    "unit": 1
                }
            ],
            "currency_code": "USD",
            "limit_status": "0",
            "usage_percent": 0.59,
            "start_time": "2021-11-01T00:00:00Z",
            "end_time": "2021-11-30T00:00:00Z"
        },
        {
            "id": "1969",
            "company_id": "6197120",
            "app_id": "1007",
            "items": [
                {
                    "name": "enterprise",
                    "quantity": 1,
                    "unit_price": 1,
                    "price": 1,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 0.2,
                    "amount": 1.2,
                    "description": "Ocamba MST Enterprise Plan (Annually)",
                    "unit": 1
                }
            ],
            "price": 1,
            "amount": 1.2,
            "currency_code": "USD",
            "limit_status": "0",
            "start_time": "2021-10-30T00:00:00Z",
            "end_time": "2021-11-29T00:00:00Z"
        },
        {
            "id": "1982",
            "company_id": "6197120",
            "app_id": "1003",
            "items": [
                {
                    "name": "subscribers",
                    "quantity": 98985,
                    "unit_price": 0,
                    "price": 0,
                    "discount_rate": 0,
                    "discount": 0,
                    "tax_rate": 20,
                    "tax": 0,
                    "amount": 0,
                    "description": "Subscribers included in plan",
                    "unit": 1
                }
            ],
            "currency_code": "USD",
            "limit_status": "0",
            "usage_percent": 100,
            "start_time": "2021-11-10T00:00:00Z",
            "end_time": "2021-12-09T00:00:00Z"
        }
    ]
}
{
  "total": 3,
  "items": [
    {
      "id": "1998",
      "company_id": "10013213",
      "app-id": "1000163",
      "app": {
        "id": "123456789",
        "type": "application",
        "title": "AdExchange",
        "name": "adex",
        "description": "here goes description",
        "logo": "https://logo-uri-example.com",
        "plan": "'{ \n   \"features\" : [\"billing\"]\n }'",
        "create_time": "2021-11-25 13:45:03",
        "update_time": "2021-11-26 11:37:25"
      },
      "items": [
        {
          "invoice_item": {
            "name": "Ocamba Push Startup Plan (Monthly)"
          },
          "description": "Subscribers included in plan",
          "unit": 1
        }
      ],
      "amount": 1.2,
      "price": 10.99,
      "currency_code": "USD",
      "limit_status": "0",
      "usage_percent": 100,
      "start_date": "2021-07-20",
      "end_date": "2021-07-30",
      "create_time": "2021-07-30 12:50:13",
      "update_time": "2021-07-30 12:50:13"
    }
  ]
}