Accounts

Overview

Accounts are only used for billing. You cannot create new accounts yourself. Instead, you'll need to ask an administrator to do this for you, if you'd like to have separate billing for your subscriptions.

List Accounts

GET /api/v1/accounts

Returns all accounts that the current authentication token has access to.

Parameters

All parameters are optional.

Name
Type
Description

name

string

Will filter the results by account name, there is nothing by default

per

integer

Will limit the results to NN entries per page, defaults to 50

page

integer

Will return the results from passed page, defaults to 1

Request

Example requests with page filtering, number of accounts per page and filtering by name.

curl 'https://customers.triton.one/api/v1/accounts' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json"
curl 'https://customers.triton.one/api/v1/accounts?name=Account-123' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" 
curl 'https://customers.triton.one/api/v1/accounts?per=10&page=2' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" 

Response

Returns a hash with the accounts key containing an array of account objects and the meta containing pagination data.

{
   "accounts": [
      { account_object_1 },
      { account_object_2 },
      { account_object_3 },
      ...
   ],
   "meta": {
      "current_page": 1,
      "next_page": null,
      "per_page": 50,
      "prev_page": null,
      "total_pages": 1,
      "total_count": 3
   }
}

Get Account

GET /api/v1/accounts/:account-uuid

Get Account that the current authentication token has access to.

Parameters

account-uuid is the only parameter that needs to be provided.

Request

Example request containing account-uuid

curl 'https://customers.triton.one/api/v1/accounts/c92a9cea-47cc-494b-b1b0-4230a2316ee5' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" 

Response

Returns a hash with the account key containing an account object. The response data for the account object is the same as for GET /api/v1/accounts. Below is the sample response.

{
   "account": {
      "uuid": "c92a9cea-47cc-494b-b1b0-4230a2316ee5",
      "name": "John Doe",
      "billing_address1": "1645 S Telegraph Rd",
      "billing_address2": null,
      "billing_address3": null,
      "billing_city": "Bloomfield Hills",
      "billing_state_or_province": "Michigan",
      "billing_postal_code": "48302",
      "billing_country_code": "US",
      "telephone_country_code": "US",
      "telephone": "(248) 858-2300",
      "last_time_activated":"28/06/2023",
      "is_active": true,
      "created_at": "2023-06-22T09:11:11Z",
      "updated_at": "2023-06-28T11:26:52Z",
      "users_count": 1,
      "tokens_count": 6,
      "endpoints_count": 4,
      "subscriptions_count": 2,
      "is_helio_pay_stream_active": true,
      "pay_stream_id": "639cbc90a989eacb2574a055",
      "metrics_enabled": false,
      "payment_method": "manual",
      "maximum_tokens": -1,
      "address_watch_lists": false,
      "allow_ip_ranges": false,
      "subscriptions": [
         {
            "uuid": "74ea9d9a-4b2a-4f01-af47-1c175f8a2af6",
            "name": "Mainnet Shared Subscription",
            "account_uuid": "c92a9cea-47cc-494b-b1b0-4230a2316ee5",
            "subscription_type": "mainnet-shared",
            "starts_at": null,
            "ends_at": null,
            "is_active": true,
            "endpoints_count": 2,
            "tokens_count": 4
            "supported_rate_tiers": [
               {
                  "uuid": "ca141949-a46f-446a-abee-a031e501fea0",
                  "name": "developer",
                  "active_tokens_count": 5,
                  "active_endpoints_count": 4,
                  "supported_subscription_type_uuids": [
                     "413defdd-b011-4dda-8145-fa782524284c"
                  ]
               }
            ]
         }
      ],
      "deactivation_reasons": [
         {
            "description": "Deactivation reason description",
            "created_at": "2023-06-26T20:16:05Z"
         }
      ]
   }
}

Create Account

This API is only limited to account management API tokens created with the admin role.

Update Account

PUT /api/v1/accounts/:account-uuid

Update account that the current authentication token has access to.

Parameters

All parameters are optional unless marked as required.

Name
Type
Description

name *required

string

A human readable display name to describe the subscription.

billing_address1

string

billing_address2

string

billing_address3

string

billing_city

string

billing_state_or_province

string

billing_postal_code

string

billing_country_code

string

telephone_country_code

string

telephone

string

Request

Request JSON (-d command line parameter) must contain account key for account object. All parameters should be placed inside.

curl -X PUT 'https://customers.triton.one/api/v1/accounts/c6b8c375-27ab-4531-94f4-d8d08250fcfa' -H "Authorization: secret-api-token" -H "Content-Type: application/json" -H "Accept:application/json" -d '
{
    "account": {
        "name": "John Doe",
        "billing_address1": "1645 S Telegraph Rd",
        "billing_address2": "line 2",
        "billing_address3": "line 3",
        "billing_city": "Bloomfield Hills",
        "billing_state_or_province": "Michigan",
        "billing_postal_code": "48302",
        "billing_country_code": "US",
        "telephone_country_code": "US",
        "telephone": "(248) 858-2300"
    }
}'

Response

Returns a hash with the account key containing an account object. The response data for account object is the same as for GET /api/v1/accounts/:account-uuid nad GET /api/v1/accounts

{
   "account": {
      "uuid": "c92a9cea-47cc-494b-b1b0-4230a2316ee5",
      "name": "John Doe",
      "billing_address1": "1645 S Telegraph Rd",
      "billing_address2": null,
      "billing_address3": null,
      "billing_city": "Bloomfield Hills",
      "billing_state_or_province": "Michigan",
      "billing_postal_code": "48302",
      "billing_country_code": "US",
      "telephone_country_code": "US",
      "telephone": "(248) 858-2300",
      ...
      "subscriptions": [
         { subscription_object_1 },
         { subscription_object_2 },
         { subscription_object_3 },
         ...
      ],
      "deactivation_reasons": [
         { deactivation_reason_object_1 },
         { deactivation_reason_object_2 },
         { deactivation_reason_object_3 },
         ...
      ]
   }
}

Last updated