Permalink
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (93 sloc) 3.38 KB
#%RAML 1.0
title: Orders
baseUri: https://github.com/folio-org/mod-orders
version: v1
protocols: [ HTTP, HTTPS ]
documentation:
- title: Orders Business Logic API
content: <b>API for managing purchase orders</b>
types:
composite_purchase_orders: !include acq-models/composite_purchase_orders.json
composite_purchase_order: !include acq-models/composite_purchase_order.json
po_line: !include acq-models/composite_po_line.json
errors: !include raml-util/schemas/errors.schema
UUID:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
traits:
pageable: !include raml-util/traits/pageable.raml
searchable: !include raml-util/traits/searchable.raml
language: !include raml-util/traits/language.raml
validate: !include raml-util/traits/validation.raml
auth:
responses:
401:
description: "Not authorized to perform requested action"
body:
text/plain:
example: "unable to create <<resourcePathName|!singularize>> -- unauthorized"
resourceTypes:
collection-item: !include raml-util/rtypes/item-collection.raml
# The post-empty-body.raml does not declare request body but it can be defined when this resource type is used
post-item: !include raml-util/rtypes/post-empty-body.raml
/orders:
displayName: Orders
type:
post-item:
exampleItem: !include acq-models/examples/composite_purchase_order.sample
schema: composite_purchase_order
post:
description: Post a purchase order (PO) and a number of PO lines; record fund transactions corresponding to the order
is: [validate, auth]
body:
application/json:
type: composite_purchase_order
example:
strict: false
value: !include acq-models/examples/composite_purchase_order.sample
/{id}:
uriParameters:
id:
description: The UUID of a purchase order
type: UUID
type:
collection-item:
exampleItem: !include acq-models/examples/composite_purchase_order.sample
schema: composite_purchase_order
put:
description: Update an order by id
is: [validate]
/lines:
displayName: Purchace Order Lines
description: Manage purchase order (PO) lines
type:
# Using `post-item` resource type because at the moment only POST is required. In case GET becomes also required, the `collection` resource type should be used instead
post-item:
exampleItem: !include acq-models/examples/composite_po_line.sample
schema: po_line
post:
displayName: Create a new purchace order line
description: Post a purchase order (PO) line
is: [validate, auth]
body:
application/json:
type: po_line
example:
strict: false
value: !include acq-models/examples/composite_po_line.sample
/{lineId}:
displayName: Purchase Order Line
description: Manage purchase order line (PO line) by id
uriParameters:
lineId:
description: The UUID of a purchase order line
type: UUID
type:
collection-item:
exampleItem: !include acq-models/examples/composite_po_line.sample
schema: po_line
get:
description: Return a purchase order line
is: [validate]
delete:
is: [validate]