Skip to content

Commit eee7574

Browse files
committed
Fixes to examples and orderQuantity
1 parent 65e294d commit eee7574

File tree

3 files changed

+1205
-57
lines changed

3 files changed

+1205
-57
lines changed

EditorsDraft/edit.html

+38-16
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@
411411
<dl class="typography">
412412
<dt><dfn>Customer</dfn></dt>
413413
<dd>The user who places a booking using an application provided by
414-
a <a>Broker</a>.</dd>
414+
a <a>Broker</a>. The <a>Customers</a> is not necessarily the attendee,
415+
so e.g. a parent may book on behalf of their child.</dd>
415416
<dt><dfn>Broker</dfn></dt>
416417
<dd>The organisation or developer providing an application that
417418
allows <a>Customers</a> to make bookings. Those applications will be
@@ -548,11 +549,11 @@
548549

549550
- The <a>Broker</a> MUST store the `Order` request with an internal status of `https://openactive/PaymentAuthorized` at this point.
550551

551-
vii) **B** - <a>Broker</a> call with `Order` including UUID with a Person object to check viability and with a Payment object for the total amount pre-authed (call is idempotent, can be retried if 500 returned), <a>Booking System</a> responds with an `Order`.
552+
vii) **B** - <a>Broker</a> call with `Order` including UUID with a Person object to check viability, with a Payment object, and `totalPaymentDue` including the total amount pre-authed (call is idempotent, can be retried if 500 returned), <a>Booking System</a> responds with an `Order`.
552553

553554
- The `identifier` of the `Payment` is taken from the payment pre-authorization.
554555

555-
- If the `totalPaymentDue` in the `Order` object is different to the current `totalPaymentDue` (which might have changed since **C2**, e.g. if the headline price is changed in the booking system between these two steps), the booking fails but the lease is sustained so that the user can be prompted whether they want to continue with the new amount.
556+
- If the `totalPaymentDue` included in the `Order` object is different to the current `totalPaymentDue` (which might have changed since **C2**, e.g. if the headline price is changed in the booking system between these two steps), the booking fails but the lease is sustained so that the user can be prompted whether they want to continue with the new amount.
556557

557558
- If some of the leases have expired, or if leases are not supported, then the booking system attempts to make the booking anyway. If there are no spaces available the booking fails.
558559

@@ -781,14 +782,16 @@
781782

782783
The `taxMode` (`https://openactive/TaxNet` or `https://openactive/TaxGross`) is REQUIRED to be specified at the <a>Seller</a> level, and MUST be reflected within the `Organization` that is included in the REQUIRED `organizer` or `provider` properties within opportunity data specified in [[Modelling-Opportunity-Data]]. It MUST also be consistent for all `Order`s originating from that <a>Seller</a>.
783784

784-
| `taxMode` | `https://openactive/TaxNet` | `https://openactive/TaxGross` |
785-
|---------------------------------------------|-----------------------------|-------------------------------|
786-
| Price displayed | Excludes tax | Includes all applicable taxes assuming a `Person` as a `customer` |
787-
| Currencies usually associated | USD | EUR, AUD, GBP |
788-
| Example price of opportunity before tax | 10.00 | 10.00 |
789-
| Example tax rate | 0.2 | 0.2 |
790-
| Price displayed to Customer during browsing | 10.00 | 12.00 |
791-
| Total paid by Customer | 12.00 | 12.00 |
785+
Note that `taxMode` only effects the interpretation of the `price` of the `Offer`. `totalPaymentDue` is always Gross (tax inclusive), and `unitTaxSpecification` and `totalTaxSpecification` include only the taxes themselves so are uneffected.
786+
787+
| `taxMode` | `https://openactive/TaxNet` | `https://openactive/TaxGross` |
788+
|--------------------------------------------------------|-----------------------------|-------------------------------|
789+
| Price displayed | Excludes tax | Includes all applicable taxes assuming a `Person` as a `customer` |
790+
| Currencies usually associated | USD | EUR, AUD, GBP |
791+
| Example price of opportunity before tax | 10.00 | 10.00 |
792+
| Example tax rate | 0.2 | 0.2 |
793+
| Price displayed to Customer during browsing (`Offer`) | 10.00 | 12.00 |
794+
| Total paid by Customer (`totalPaymentDue`) | 12.00 | 12.00 |
792795

793796

794797
## Free opportunities
@@ -899,11 +902,11 @@
899902

900903
1. Use the latest state of the `Order` from the <a>Orders feed</a> to determine which `OrderItem`s may be cancelled. If `allowSimpleCancellation` is `true` and `latestCancellationBeforeStartDate` subtracted from the opportunity `startDate` is in the future, a PATCH against the `OrderItem` `id` with a body of `{ "orderItemStatus": "https://openactive.io/CustomerCancelled" }` MUST succeed.
901904

902-
2. The <a>Customer</a> MUST be informed of the expected refund before they commit to cancellation, where the value of the refund for each `OrderItem` MUST be equal to:
905+
2. Inform the <a>Customer</a> of the expected refund before they commit to cancellation, where the value of the refund for each `OrderItem` MUST be equal to:
903906
- For `taxMode` of `https://openactive/TaxNet`: the sum of the `price` in the `acceptedOffer` and all the prices in `unitTaxSpecification`.
904907
- For `taxMode` of `https://openactive/TaxGross`: the `price` in the `acceptedOffer`.
905908

906-
3. For each `OrderItem` to be cancelled, a PATCH must be submitted using the URI `id` of the `OrderItem` from the feed with a body of `{ "orderItemStatus": "https://openactive.io/CustomerCancelled" }`. On success, a 204 response will be received, without any body. On failure a 5xx response will be received with an error message.
909+
3. Submit a PATCH for each `OrderItem` to be cancelled using the URL `id` of the `OrderItem` from the feed with a body of `{ "orderItemStatus": "https://openactive.io/CustomerCancelled" }`. On success, a 204 response will be received, without any body. On failure a 5xx response will be received with an error message.
907910

908911
4. Process any refunds based on the resulting updates to the <a>Orders feed</a>. Successfully cancelled `OrderItems` will have `orderItemStatus` set to `https://openactive.io/CustomerCancelled`. Note refunds MUST NOT be processed except in response to updates in the <a>Orders feed</a>.
909912

@@ -1121,6 +1124,24 @@
11211124
In the situation where a middleware is used for various <a>Brokers</a>, independently of API key provisioning at the <a>Booking System</a> level (which in some systems is a lengthly and time-consuming process), the `broker` property SHOULD contain the details of the end-user <a>Broker</a> rather than the middleware.
11221125

11231126

1127+
#### `orderQuantity` expansion
1128+
1129+
`orderQuantity` within `OrderItem` is only used during Order Creation, and is not persisted, as follows:
1130+
1131+
- For `OrderQuote` request, `OrderQuote` response, and `Order` request the `OrderItem`s MUST be unique based on the `id` of their `acceptedOffer` and the `id` of their `orderedItem`, and `orderQuantity` MUST be used to specify more than one is desired.
1132+
- For `Order` response, and the <a>Orders feed</a>, the `OrderItems` MUST NOT include `orderQuantity`, and instead `OrderItem`s must be duplicated according to their original `orderQuanity`, with a unique `id` provided for each resulting `OrderItem`.
1133+
1134+
This allows `OrderItem`s to be cancelled individually once the `Order` has been created, and errors regarding capacity to be attributed appropriately during Order Creation.
1135+
1136+
| Scenario | `orderQuantity` status | Unique `OrderItem` key |
1137+
|-----------------------|------------------------|------------------------------------------------|
1138+
| `OrderQuote` request | REQUIRED | Composite of `acceptedOffer` and `orderedItem` |
1139+
| `OrderQuote` response | REQUIRED | Composite of `acceptedOffer` and `orderedItem` |
1140+
| `Order` request | REQUIRED | Composite of `acceptedOffer` and `orderedItem` |
1141+
| `Order` response | - | `id` of `OrderItem` |
1142+
| <a>Orders feed</a> | - | `id` of `OrderItem` |
1143+
1144+
11241145
#### `OrderQuote`
11251146

11261147
A PUT request to the Order Creation endpoint of the <a>Booking System</a> with an object of type `OrderQuote` will return a `OrderQuote` which represents a "dry run" of the booking, with the state of the `Order` identical to if request of type `Order` be made, without any side effects (with the exception of optional leasing).
@@ -1285,7 +1306,7 @@
12851306
| [`schema:customer`](http://schema.org/customer) | REQUIRED | - | - | [`schema:Organization`](https://schema.org/Organization) or a [`schema:Person`](https://schema.org/Person) | The person or organization purchasing the Order. MUST be either an . |
12861307
| [`oa:bookingService`](https://openactive.io/bookingService) | - | REQUIRED | - | [`oa:BookingService`](https://openactive.io/BookingService) | Details about the <a>Booking System</a> |
12871308
| [`schema:orderedItem`](http://schema.org/orderedItem) | REQUIRED | REQUIRED | REQUIRED | Array of [`schema:OrderItem`](http://schema.org/OrderItem) | The items that constitute the `Order` |
1288-
| [`schema:totalPaymentDue`](http://schema.org/totalPaymentDue) | - | REQUIRED | REQUIRED | [`schema:PriceSpecification`](http://schema.org/PriceSpecification) | The total price of the `Order`, which includes or excludes tax depending on the `taxMode`. |
1309+
| [`schema:totalPaymentDue`](http://schema.org/totalPaymentDue) | REQUIRED | REQUIRED | REQUIRED | [`schema:PriceSpecification`](http://schema.org/PriceSpecification) | The total price of the `Order`, which includes or excludes tax depending on the `taxMode`. |
12891310
| [`oa:totalTaxSpecification`](https://openactive.io/totalTaxSpecification) | - | REQUIRED | REQUIRED | Array of [`oa:TaxChargeSpecification`](https://openactive.io/TaxChargeSpecification) | Breakdown of tax payable for the Order. |
12901311
| [`oa:payment`](https://openactive.io/payment) | REQUIRED | OPTIONAL | - | [`oa:Payment`](https://openactive.io/Payment) | The payment associated with the Order by the Broker |
12911312

@@ -1294,13 +1315,14 @@
12941315

12951316
### `oa:OrderQuote`
12961317

1297-
`OrderQuote` subclasses `Order`, and includes of the above properties as specified for `Order` with the addition of `oa:lease` and without `oa:payment`:
1318+
`OrderQuote` subclasses `Order`, and includes of the above properties as specified for `Order` with the addition of `oa:lease`, without `oa:payment`, and with `totalPaymentDue` only required in the response:
12981319

12991320
| Property | Broker Request | Booking System Response | Type | Notes |
13001321
|--------------------------------------------------------------------|----------|----------|-|------|
13011322
| `@type` | REQUIRED | REQUIRED | [`schema:Text`](https://schema.org/Text) | `OrderQuote` |
13021323
| [`oa:lease`](https://openactive.io/lease) | - | OPTIONAL | [`oa:Lease`](https://openactive.io/Lease) | The lease on the OrderItems which lasts for the duration specified by the booking system. |
13031324
| [`oa:payment`](https://openactive.io/payment) | - | - | [`oa:Payment`](https://openactive.io/Payment) | Payment is not expected for `OrderQuote` |
1325+
| [`schema:totalPaymentDue`](http://schema.org/totalPaymentDue) | - | REQUIRED | REQUIRED | [`schema:PriceSpecification`](http://schema.org/PriceSpecification) | The total price of the `Order`, which includes or excludes tax depending on the `taxMode`. |
13041326

13051327

13061328
### `schema:Organization` for `seller`
@@ -1357,7 +1379,7 @@
13571379
| [`oa:error`](https://openactive.io/error) | - | REQUIRED | Array of [`oa:Error`](https://openactive.io/Error) | Array of errors related to the OrderItem being included in the Order, only applicable for an `OrderQuote`. |
13581380
| [`oa:cancellationMessage`](https://openactive.io/cancellationMessage) | - | OPTIONAL | [`schema:Text`](https://schema.org/Text) | A message set by the Seller in the event of opportunity cancellation, only applicable for an `Order` and where the `OrderItem` has `orderItemStatus` set to `https://openactive.io/SellerCancelled` |
13591381

1360-
Note that [`schema:orderQuantity`](http://schema.org/orderQuantity) is not supported in this version of the specification.
1382+
Note that [`schema:orderQuantity`](http://schema.org/orderQuantity) is only used during the booking flow, and MUST NOT be used within the completed `Order`.
13611383

13621384

13631385
### `schema:Offer`

EditorsDraft/examples.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
4747

4848
//TODO: Allow multiple errors only for order creation
4949

50+
//TODO: Should we have a separate type for OrderRequest to better define the required params?
51+
5052
//TODO: Include identifier in OrderItem and include logic to specify that it is reflected back.
5153
//TODO: Force OrderQuote to reflect back everything, so that it can be passed back and forth, same for Order, noting that it doesn't actually need to be stored anywhere.
5254

@@ -60,7 +62,6 @@ function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
6062

6163
//TODO: Clarify **B** vs Order Creation terms throughout
6264

63-
//TODO: Question: should OrderQuote have an id and location, as it doesn't actually conceptually exist?
6465
//TODO: Should we have ID in the request PUT?
6566
//TODO: Do we force properties to be (i) reflected back and (ii) stored as part of the Orders feed by the booking system? Cons: This would limit any extension mechanism, Pros: The complete item is being passed back and forth
6667
//TODO: Ensure somewhere it says for the Orders feed items are a "PATCH" of a subset of the properties from the original Order, and that GET is not REQUIRED so that the other properties do not need to be stored.
@@ -74,11 +75,11 @@ function dataExampleOrderQuoteCreationErrorResponse(utils, content) {
7475

7576
//TODO: Can we simplify the Orders feed requirement by having the "patch" payload not full sessions, and instead reference the open data.
7677

77-
//TODO: It is the Broker's responsibility to monitor the open feeds to ensure that any updates to the events logistics (e.g. date/time) trigger notifications for the Customer.
78+
//TODO: Open issue on this: It is the Broker's responsibility to monitor the open feeds to ensure that any updates to the events logistics (e.g. date/time) trigger notifications for the Customer.
7879

7980
//TODO: Errors for specific OrderItems, and how they are returned. Suggest that errors are returned against the OrderQuote items, so they can be displayed to the users, rather than the OrderQuote failing.
8081

81-
//TODO: Include a section on child booking!
82+
//TODO: Include a section on child booking?
8283

8384
//TODO: Error if customer cancels bofore the cancellation windows
8485
//TODO: Ensure customer checks for cancellation window before attempting cancellation
@@ -440,12 +441,12 @@ var fullOrderExampleContent = {
440441
var fullOrderItemExampleContent = { //broker
441442
"type": "OrderItem",
442443
"id": "https://example.com/api/orders/123e4567-e89b-12d3-a456-426655440000/order-items/1234",
443-
"identifier": "22"
444444
"orderItemStatus": { //booking system
445445
OrderConfirmed: "https://openactive.io/OrderConfirmed",
446446
CustomerCancelled: "https://openactive.io/CustomerCancelled",
447447
SellerCancelled: "https://openactive.io/SellerCancelled",
448448
},
449+
"orderQuantity": 1,
449450
"allowSimpleCancellation": true,
450451
"accessToken": [
451452
{
@@ -577,15 +578,14 @@ var feedOrderItem = {
577578

578579
var requestOrderItem = {
579580
"type": "OrderItem",
580-
"id": fullOrderItemExampleContent.id,
581-
"identifier": fullOrderItemExampleContent.identifier,
581+
"orderQuantity": fullOrderItemExampleContent.orderQuantity,
582582
"acceptedOffer": fullOrderItemExampleContent.acceptedOffer.request,
583583
"orderedItem": fullOrderItemExampleContent.orderedItem.request
584584
}
585585

586586
var responseOrderQuoteOrderItem = {
587587
"type": "OrderItem",
588-
"identifier": fullOrderItemExampleContent.identifier,
588+
"orderQuantity": fullOrderItemExampleContent.orderQuantity,
589589
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
590590
"allowSimpleCancellation": true,
591591
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,
@@ -595,7 +595,7 @@ var responseOrderQuoteOrderItem = {
595595

596596
var responseOrderQuoteErrorOrderItem = {
597597
"type": "OrderItem",
598-
"identifier": fullOrderItemExampleContent.identifier,
598+
"orderQuantity": fullOrderItemExampleContent.orderQuantity,
599599
"orderItemStatus": fullOrderItemExampleContent.orderItemStatus.OrderConfirmed,
600600
"allowSimpleCancellation": true,
601601
"unitTaxSpecification": fullOrderItemExampleContent.unitTaxSpecification,

0 commit comments

Comments
 (0)