Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions api_calls/reference/fees/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"fees": [
{
"name_en": "Fee",
"kind": "other",
"rate": "12.0",
"rate_kind": "fixed",
"downpayment_percentage": "0.0"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"rate": "12.0",
"rate_kind": "fixed",
"archived_at": null,
"created_at": "2015-03-18T09:33:45Z",
"updated_at": "2015-03-18T09:33:45Z",
"downpayment_percentage": "0.0"
Expand Down
11 changes: 11 additions & 0 deletions api_calls/reference/fees/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"fees": [
{
"name_en": "Fee",
"kind": "other",
"rate": "12.0",
"rate_kind": "fixed",
"downpayment_percentage": "0.0"
}
]
}
10 changes: 10 additions & 0 deletions api_calls/reference/rentals_fees/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"rentals_fees": [
{
"fee_id": 9,
"always_applied": true,
"maximum_bookable": 12,
"status": "public"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{
"links": {
"rentals_fees.fee": "http://www.bookingsync.com/api/v3/fees/{rentals_fees.fee}",
"rentals_fees.rental": "http://www.bookingsync.com/api/v3/rentals/{rentals_fees.rental}"
"rentals_fees.rental": "http://www.bookingsync.com/api/v3/rentals/{rentals_fees.rental}",
"rentals_fees.seasons": "http://www.bookingsync.com/api/v3/seasons/{rentals_fees.seasons}"
},
"rentals_fees": [
{
"links": {
"fee": 9,
"rental": 1
"rental": 1,
"seasons": []
},
"id": 6,
"always_applied": true,
"end_date": null,
"maximum_bookable": 12,
"public": false,
"name": {
"en": "NAME"
},
"public": true,
"rate": 10,
"rate_kind": "fixed",
"required": false,
"start_date": null,
"archived_at": null,
"created_at": "2015-03-18T09:34:01Z",
"updated_at": "2015-03-18T09:34:01Z"
}
Expand Down
9 changes: 9 additions & 0 deletions api_calls/reference/rentals_fees/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rentals_fees": [
{
"always_applied": "true",
"maximum_bookable": 12,
"status": "public"
}
]
}
4 changes: 4 additions & 0 deletions content/reference/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2017-02-09

* [doc update] Update `fees` and `rentals_fees` endpoints with new actions and attributes.

## 2017-02-07

* [doc fix] Rentals' `price_public_notes` should be written from RatesTables.
Expand Down
60 changes: 58 additions & 2 deletions content/reference/endpoints/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ul class="nav nav-pills" role="tablist">
<li class="disabled"><a>OAuth Scopes:</a></li>
<li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li>
<li><a href="#rates_write" role="tab" data-toggle="pill">rates_write</a></li>
</ul>
<div class="tab-content" markdown="1">
<div class="tab-pane active" id="public" markdown="1">
Expand All @@ -20,6 +21,23 @@ kind | String | Read | Fee's kind, list of fee's kinds descri
rate | [Decimal](/reference/enums#formats) | Read | Fee's rate.
rate_kind | String | Read | Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
-----------------|---------|------------|------------
archived_at | [Time](/reference/enums#formats) | Read | Fee's archive time.
created_at | [Time](/reference/enums#formats) | Read | Fee's create time.
updated_at | [Time](/reference/enums#formats) | Read | Fee's update time.
{: class="table table-bordered"}
</div>
<div class="tab-pane" id="rates_write" markdown="1">
Name | Type | Read/Write | Description
-----------------|---------|------------|------------
id | Integer | Read | Fee's id.
-----------------|---------|------------|------------
downpayment_percentage | [Decimal](/reference/enums#formats) | Read/Write | Fee's downpayment percentage.
name | [Object](/reference/enums#formats) | Read/Write | Fee's name, list of locales described in [enums section](/reference/enums#locales).
kind | String | Read/Write | Fee's kind, list of fee's kinds described in [enums section](/reference/enums#fee-kinds)
rate | [Decimal](/reference/enums#formats) | Read/Write | Fee's rate.
rate_kind | String | Read/Write | Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
-----------------|---------|------------|------------
archived_at | [Time](/reference/enums#formats) | Read | Fee's archive time.
created_at | [Time](/reference/enums#formats) | Read | Fee's create time.
updated_at | [Time](/reference/enums#formats) | Read | Fee's update time.
{: class="table table-bordered"}
Expand All @@ -34,7 +52,7 @@ List all fees for given account(s).
GET /fees
~~~

<%= render 'json_response', endpoint: "fees", scopes: %w(public) %>
<%= render 'json_response', endpoint: "fees", scopes: [{ public: "public-rates_write" }] %>

## Get a single fee

Expand All @@ -44,4 +62,42 @@ Returns a single fee identified by ID.
GET /fees/:fee_id
~~~

<%= render 'json_response', endpoint: "fees", scopes: %w(public) %>
<%= render 'json_response', endpoint: "fees", scopes: [{ public: "public-rates_write" }] %>

## Create a new fee

Returns a newly created fee.

~~~
POST /fees
~~~

<%= render 'json_response', endpoint: "fees", request: "create",
scopes: [{ rates_write: "public-rates_write" }] %>

## Update a fee

Returns an updated fee identified by ID.

~~~
PUT /fees/:fee_id
~~~

<%= render 'json_response', endpoint: "fees", request: "update",
scopes: [{ rates_write: "public-rates_write" }] %>

## Archive a fee

<div class="callout callout-info" markdown="1">
<h4>Archived fees</h4>
Fees that were archived are no longer considered valid, but will be present on `index` and `show` actions.
They can be identified by presence of `archived_at` timestamp.
</div>

Required OAuth scope: `:rates_write`

Returns empty response with '204 No Content' status code on success.

~~~~~~
DELETE /fees/:fee_id
~~~~~~
64 changes: 62 additions & 2 deletions content/reference/endpoints/rentals_fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ul class="nav nav-pills" role="tablist">
<li class="disabled"><a>OAuth Scopes:</a></li>
<li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li>
<li><a href="#rentals_write" role="tab" data-toggle="pill">rentals_write</a></li>
</ul>
<div class="tab-content" markdown="1">
<div class="tab-pane active" id="public" markdown="1">
Expand All @@ -16,13 +17,40 @@ id | Integer | Read | Rentals Fee's id.
-----------------|---------|------------|------------
always_applied | Boolean | Read | Available to all seasons and periods if set to true.
maximum_bookable | Integer | Read | Rentals Fee's maximum booked count.
name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales).
public | Boolean | Read | Publicly bookable by client if set to true.
rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate.
rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
required | Boolean | Read | Always included for new bookings, also public if set to true.
-----------------|---------|------------|------------
archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time.
created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time.
updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time.
start_date | [Date](/reference/enums#formats) | Read | Rentals Fee's start date.
end_date | [Date](/reference/enums#formats) | Read | Rentals Fee's end date.
{: class="table table-bordered"}
</div>
<div class="tab-pane" id="rentals_write" markdown="1">
Name | Type | Read/Write | Description
-----------------|---------|------------|------------
id | Integer | Read | Rentals Fee's id.
fee_id | Integer | Write | Fee id related to the Rentals Fee.
season_ids | Array | Write | Season ids related to the Rentals Fee.
-----------------|---------|------------|------------
always_applied | Boolean | Read/Write | Available to all seasons and periods if set to true.
maximum_bookable | Integer | Read/Write | Rentals Fee's maximum booked count.
name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales).
public | Boolean | Read | Publicly bookable by client if set to true.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be writtable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not on core

Copy link
Member

@ZenCocoon ZenCocoon Feb 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, on admin v2 it's using status, should be here as well then. Needed to set this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status added

rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate.
rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
required | Boolean | Read | Always included for new bookings, also public if set to true.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be writtable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not on core

status | Boolean | Write | Possible values are `public`, `required` or `private`.
-----------------|---------|------------|------------
archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time.
created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time.
updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time.
start_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's start date.
end_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's end date.
{: class="table table-bordered"}
</div>
</div>
Expand All @@ -35,7 +63,7 @@ List all rentals fees for given account(s).
GET /rentals_fees
~~~

<%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %>
<%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %>

## Get a single rentals fee

Expand All @@ -45,4 +73,36 @@ Returns a single rentals fee identified by ID.
GET /rentals_fees/:rentals_fee_id
~~~

<%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %>
<%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %>

## Create a new rentals fee

Creates a rentals fee for given rental.

~~~
POST /rentals/:rental_id/rentals_fees
~~~

<%= render 'json_response', endpoint: "rentals_fees", request: "create",
scopes: [{ rentals_write: "public-rentals_write" }] %>

## Update a rentals fee

Returns an updated rentals fee identified by ID.

~~~
PUT /rentals_fees/:rentals_fee_id
~~~

<%= render 'json_response', endpoint: "rentals_fees", request: "update",
scopes: [{ rentals_write: "public-rentals_write" }] %>

## Archive a rentals fee

Required OAuth scope: `:rentals_write`

Returns empty response with '204 No Content' status code on success.

~~~~~~
DELETE /rentals_fees/:rentals_fee_id
~~~~~~