Our App is in the alpha stage, the beta is coming soon.

Icon
Welcome to Costs to Expect

Documentation


Docs and examples

The documentation for the Costs to Expects API is available as a Postman collection.

Our documentation is available at https://postman.costs-to-expect.com.

We will ensure that all our docs are always be up to date; the docs will always refer to the released live version of the API.

In addition to the published documentation, we include some documentation within our API, in the form of OPTIONS requests.

The root collection of the API details all the available routes and the endpoints for each route. An OPTIONS endpoint exists for each route; in addition to the supported routes, the OPTIONS response shows the supported fields and parameters.

Structure

In the Costs to Expect API, we have three base levels of hierarchy, resource type, resource, and item.

  • Items are the individual expense or items we a tracking.
  • Resources are the names for the buckets, lists or trackers.
  • Resource types are for grouping and where we define the kind of thing we are tracking or forecasting.

The resources in a resource type all use the same tracking or forecasting method. The categories and subcategories defined for a resource type belong to all the resources.

Examples

We have included a couple of examples below to give you an idea of the typical responses the API will return.

Resource types

Request
curl --location --request GET 'https://api.costs-to-expect.com/v2/resource-types?limit=25&offset=0'
Response
[
  {
    "id": "d185Q15grY",
    "name": "Blackborough boys",
    "description": "The Blackborough children, Jack and Niall",
    "created": "2018-09-06 22:04:23",
    "public": true,
    "item_type": {
      "id": "OqZwKX16bW",
      "name": "allocated-expense",
      "description": "Expenses with an allocation rate"
    },
    "resources": {
      "count": 2
    }
  }
]
Headers
Cache-Control: max-age=604800, public
Content-Length: 335
Content-Type: application/json
Content-Encoding: gzip
Content-Language: en
ETag: "2a03c7fc4044c27aa801410c050fadb4"
Vary: Accept-Encoding
X-Powered-By: PHP/7.4.5
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000;
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Count: 1
X-Total-Count: 1
X-Offset: 0
X-Limit: 10
X-Link-Previous:
X-Link-Next:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
Date: Mon, 22 Jun 2020 14:40:57 GMT

Items for a resource

Request
curl --location --request GET 'https://api.costs-to-expect.com/v2/resource-types/d185Q15grY/resources/kw8gLq31VB/items?limit=25&offset=0'
Response
[
  {
    "id": "K13qM2K3OV",
    "name": "Pocket money",
    "description": null,
    "total": "3.90",
    "percentage": 100,
    "actualised_total": "3.90",
    "effective_date": "2020-05-25",
    "created": "2020-05-25 18:01:00",
    "updated": "2020-05-25 18:01:00"
  },
  {
    "id": "akzpAXBD8g",
    "name": "Share of shopping",
    "description": null,
    "total": "156.91",
    "percentage": 20,
    "actualised_total": "31.38",
    "effective_date": "2020-05-24",
    "created": "2020-05-24 12:52:00",
    "updated": "2020-05-24 12:52:00"
  }
]
Headers
Cache-Control: max-age=604800, private
Content-Length: 790
Content-Type: application/json
Content-Encoding: gzip
Content-Language: en
ETag: "c3b0623f7dc47c6a48bd18c8fcbf3618"
Vary: Accept-Encoding
X-Powered-By: PHP/7.4.5
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000;
Referrer-Policy: strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Count: 10
X-Total-Count: 1694
X-Offset: 0
X-Limit: 10
X-Link-Previous:
X-Link-Next: /v2/resource-types/d185Q15grY/resources/kw8gLq31VB/items?offset=10&limit=10
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
Date: Sun, Mon, 22 Jun 2020 14:46:03 GMT

Copyright © Dean Blackborough 2018 - 2020
Our App | Our Website | Our Blog | Status

Latest release: v2.11.6 (1st Jul 2020)

All code maintained by Dean Blackborough and released under the MIT license.