|
1160 | 1160 | <pre class="example" title="Order Creation: OrderQuote example success response" data-transform="dataExampleOrderQuoteCreationResponse">
|
1161 | 1161 | </pre>
|
1162 | 1162 |
|
1163 |
| -If there are any issues with the `orderedItem`s provided in the `OrderQuote`, the <a>Booking System</a> MUST respond with a `409 Conflict` response, with `error` details provided against each offending `OrderItem`. Note that `totalPaymentDue` and `totalTaxSpecification` MUST be calculated excluding any `OrderItem`s that include `error`s. |
| 1163 | +If there are any issues with the `orderedItem`s provided in the `OrderQuote`, the <a>Booking System</a> MUST respond with a `409 Conflict` response (as the error is expected to be resolved, and the request resubmitted, as per [[RFC2616]]), with `error` details provided against each offending `OrderItem`. Note that `totalPaymentDue` and `totalTaxSpecification` MUST be calculated excluding any `OrderItem`s that include `error`s. |
1164 | 1164 |
|
1165 | 1165 | <pre class="example" title="Order Creation: OrderQuote example OrderItem error response" data-transform="dataExampleOrderQuoteCreationOrderItemErrorResponse">
|
1166 | 1166 | </pre>
|
|
1171 | 1171 | </pre>
|
1172 | 1172 |
|
1173 | 1173 |
|
1174 |
| - |
1175 | 1174 | #### `Order`
|
1176 | 1175 |
|
1177 | 1176 | A PUT request to the Order Creation endpoint of the <a>Booking System</a> with an object of type `Order` will create the `Order` and complete the booking from the point of the view of the <a>Booking System</a>.
|
|
1605 | 1604 | | `IncompleteCustomerDetailsError` | 400 | If the `email` address of the customer is not supplied within a `schema:Person` object; or if the `customer` property supplied is not a valid `schema:Person` or `schema:Organization` object. |
|
1606 | 1605 | | `IncompleteBrokerDetailsError` | 400 | If there is insufficient detail in the `schema:Organisation` object describing the <a>Broker</a>; or if the `broker` property supplied is not a valid schema:Organisation object. |
|
1607 | 1606 | | `IncompletePaymentDetailsError` | 400 | If the `payment` property of the `Order` is missing or does not include an `identifier` or `paymentMethod`. |
|
| 1607 | +| `OrderAlreadyExistsError` | 400 | If the UUID used for an `OrderQuote` already represents a completed Order. | |
1608 | 1608 |
|
1609 | 1609 |
|
1610 | 1610 | #### Order Creation - `OrderItem` errors
|
1611 | 1611 |
|
| 1612 | +Note that all `OrderItem` errors for an `OrderQuote` request result in a `409 Conflict` response, as the error is expected to be resolved, and the request resubmitted, as per [[RFC2616]] section 10.4.10. |
| 1613 | + |
1612 | 1614 | | Error Type | Status Code | Use Case |
|
1613 | 1615 | |---------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
1614 | 1616 | | `IncompleteOrderItemError` | 409 | If there is a missing `acceptedOffer` or `orderedItem` property on the `schema:OrderItem`. |
|
|
1634 | 1636 |
|
1635 | 1637 | | Error Type | Status Code | Use Case |
|
1636 | 1638 | |---------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 1639 | +| `TemporarilyUnableToProduceOrderQuoteError` | 500 | If the <a>Booking System</a> is unable for technical reasons to produce an `OrderQuote` where the data provided to it is sufficient to allow it to do so. | |
1637 | 1640 | | `TemporarilyUnableToCreateOrderError` | 500 | If the <a>Booking System</a> is unable for technical reasons to create an `Order` where the data provided to it is sufficient to allow it to do so. |
|
1638 | 1641 | | `TemporarilyUnableToUpdateOrderError` | 500 | If the <a>Booking System</a> is unable for technical reasons to update an `Order` (which includes attempting to PATCH for cancellation) where the data provided to it is sufficient to allow it to do so. |
|
1639 | 1642 | | `TemporarilyUnableToDeleteOrderError` | 500 | If the <a>Booking System</a> is unable for technical reasons to delete an `Order` where the data provided to it is sufficient to allow it to do so |
|
|
1648 | 1651 | | `NotFoundError` | 404 | Where a <a>Booking System</a> does not have the generic resource specified. |
|
1649 | 1652 | | `MethodNotAllowed` | 405 | Where a <a>Booking System</a> does not recognise a specific HTTP method for the endpoint requested with that specific HTTP verb. |
|
1650 | 1653 | | `GoneError` | 410 | Where an `Order` has been soft-deleted by an Order Deletion request. |
|
| 1654 | +| `TooManyRequestsError` | 429 | Where the <a>Booking System</a> is rate-limiting the <a>Broker</a>. | |
| 1655 | + |
| 1656 | + |
1651 | 1657 |
|
1652 | 1658 |
|
1653 | 1659 | </section>
|
|
1719 | 1725 |
|
1720 | 1726 | ## Errors
|
1721 | 1727 |
|
1722 |
| -Error responses MUST be served using an appropriate HTTP 4XX status code or HTTP |
1723 |
| -5XX status code specified in the model. |
| 1728 | +Error responses MUST be served using an appropriate HTTP 4XX status code or HTTP 5XX status code specified in the model. |
1724 | 1729 |
|
1725 |
| -All error responses from this API MUST be returned in a JSON-LD format using a |
1726 |
| -content type of `application/vnd.openactive+json`, and optionally any version |
1727 |
| -parameters, and include at least one `OpenBookingError` object. |
| 1730 | +All error responses from this API MUST be returned in a JSON-LD format subclass of the `OpenBookingError` using a content type of `application/vnd.openactive+json` (optionally including any version parameters). |
1728 | 1731 |
|
1729 |
| -<pre class="example" title="Error response format"> |
1730 |
| -{ |
1731 |
| - "@context": "https://openactive.io/", |
1732 |
| - "type": "IncompleteCustomerDetailsError", |
1733 |
| - "description": "No customer details supplied" |
1734 |
| -} |
| 1732 | +<pre class="example" title="Error response example" data-transform="dataExampleErrorResponse"> |
| 1733 | +</pre> |
| 1734 | + |
| 1735 | + |
| 1736 | +## Rate Limiting |
| 1737 | + |
| 1738 | +The <a>Booking System</a> MAY choose to apply rate limiting for each unique set of authentication credentials, in which case they MUST adhere to the following. |
| 1739 | + |
| 1740 | +All rate-limited responses from this API MUST return a JSON-LD format `TooManyRequestsError` object using a content type of `application/vnd.openactive+json` (optionally including any version parameters). |
| 1741 | + |
| 1742 | +The response MUST also include the `Retry-After` HTTP Header with a value set to the number of seconds after which the <a>Broker</a> SHOULD retry as per [[RFC2616]] section 14.37. |
| 1743 | + |
| 1744 | +<pre class="example" title="Rate limited response example" data-transform="dataExampleRateLimitResponse"> |
1735 | 1745 | </pre>
|
1736 | 1746 |
|
1737 | 1747 |
|
|
0 commit comments