redguava / cliniko-api

The API for Cliniko
74 stars 39 forks source link

Concession pricing not returned with billable items #201

Open hagen opened 6 years ago

hagen commented 6 years ago

Can concession prices for a billable_item be returned with the billable_item? This information cannot be sourced via. the API other than after being applied to an invoice_item.

JohnColvin commented 6 years ago

We have a table that's the concession prices of billable items. I think the only thing here would be to figure out how we want to expose that info on the API. I'll have to check with some folks that are more familiar with this area.

hagen commented 6 years ago

Brilliant! Halfway there ;) Considering that info is displayed at the Billable Items screen, my vote is to bundle them with. A billable_item would return its default price, and then an array of concession prices (with our without name?):

{
  "id": 1,
  "item_code": "0001",
  "item_type": "Service",
  "name": "Initial Consultation",
  "price": 80,
  "tax": {
    "links": {"self": "https://api.cliniko.com/v1/taxes/1"}
  },
  "concession_prices": [
    {
      "price": 70,
      "name": "Student",
      "links": {
        "self": "https://api.cliniko.com/v1/concession_types/221"
      }
    },
    {
      "price": 60,
      "name": "Senior",
      "links": {
        "self": "https://api.cliniko.com/v1/concession_types/227"
      }
     },
    {
      "price": null,
      "name": "Other",
      "links": {
        "self": "https://api.cliniko.com/v1/concession_types/228"
      }
     }
  ],
  "created_at": "2014-03-04T19:11:30Z",
  "updated_at": "2014-03-04T19:11:30Z",
  "links": {"self": "https://api.cliniko.com/v1/billable_items/1"}
}
JohnColvin commented 6 years ago

👌 We were thinking something similar without the name.

hagen commented 6 years ago

So Monday then?!?! ;)

JohnColvin commented 6 years ago

sure, we can make it a Monday 😏

hagen commented 6 years ago

Nice