{
	"id": "Order.json",
	"title": "Order",
	"description": "An order is a confirmation of a transaction (a receipt), which can contain multiple line items, each represented by an Offer that has been accepted by the customer.",
	"media": {"type": "application/json;profile=http://schema.org/Order"},
	"allOf": [{"$ref": "Thing.json"}, {"$ref": "Intangible.json"}],
	"type": "object",
	"properties": {
		"acceptedOffer": {"$ref": "Offer.json#/definitions/possibleRefArray"},
		"billingAddress": {"$ref": "PostalAddress.json#/definitions/possibleRef"},
		"broker": {
			"oneOf": [
				{
					"type": "array",
					"items": {"$ref": "#/definitions/broker"}
				},
				{"$ref": "#/definitions/broker"}
			]
		},
		"confirmationNumber": {"$ref": "#/definitions/confirmationNumber"},
		"customer": {"$ref": "#/definitions/customer"},
		"discount": {"$ref": "#/definitions/discount"},
		"discountCode": {"$ref": "#/definitions/discountCode"},
		"discountCurrency": {"$ref": "#/definitions/discountCurrency"},
		"isGift": {"$ref": "#/definitions/isGift"},
		"orderDate": {"$ref": "#/definitions/orderDate"},
		"orderDelivery": {"$ref": "ParcelDelivery.json#/definitions/possibleRef"},
		"orderNumber": {"$ref": "#/definitions/orderNumber"},
		"orderStatus": {"$ref": "OrderStatus.json#/definitions/possibleRef"},
		"orderedItem": {
			"oneOf": [
				{
					"type": "array",
					"items": {"$ref": "#/definitions/orderedItem"}
				},
				{"$ref": "#/definitions/orderedItem"}
			]
		},
		"partOfInvoice": {"$ref": "Invoice.json#/definitions/possibleRef"},
		"paymentDueDate": {"$ref": "#/definitions/paymentDueDate"},
		"paymentMethod": {"$ref": "PaymentMethod.json#/definitions/possibleRef"},
		"paymentMethodId": {
			"oneOf": [
				{
					"type": "array",
					"items": {"$ref": "#/definitions/paymentMethodId"}
				},
				{"$ref": "#/definitions/paymentMethodId"}
			]
		},
		"paymentUrl": {
			"type": "string",
			"format": "uri"
		},
		"seller": {"$ref": "#/definitions/seller"}
	},
	"links": [{
		"rel": "http://schema.org/paymentUrl",
		"href": "{+paymentUrl}"
	}],
	"definitions": {
		"array": {
			"type": "array",
			"items": {"$ref": "#"}
		},
		"broker": {
			"title": "Broker",
			"description": "An entity that arranges for an exchange between a buyer and a seller.  In most cases a broker never acquires or releases ownership of a product or service involved in an exchange.  If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms are preferred. Supersedes bookingAgent.",
			"anyOf": [{"$ref": "Organization.json#/definitions/possibleRef"}, {"$ref": "Person.json#/definitions/possibleRef"}]
		},
		"confirmationNumber": {
			"title": "Confirmation Number",
			"description": "A number that confirms the given order or payment has been received.",
			"type": "string"
		},
		"customer": {
			"title": "Customer",
			"description": "Party placing the order or paying the invoice.",
			"anyOf": [{"$ref": "Organization.json#/definitions/possibleRef"}, {"$ref": "Person.json#/definitions/possibleRef"}]
		},
		"discount": {
			"title": "Discount",
			"description": "Any discount applied (to an Order).",
			"anyOf": [{"type": "number"}, {"type": "string"}]
		},
		"discountCode": {
			"title": "Discount Code",
			"description": "Code used to redeem a discount.",
			"type": "string"
		},
		"discountCurrency": {
			"title": "Discount Currency",
			"description": "The currency of the discount.\n\nUse standard formats: ISO 4217 currency format e.g. \"USD\"; Ticker symbol for cryptocurrencies e.g. \"BTC\"; well known names for Local Exchange Tradings Systems (LETS) and other currency types e.g. \"Ithaca HOUR\".",
			"type": "string"
		},
		"isGift": {
			"title": "Is Gift",
			"description": "Was the offer accepted as a gift for someone other than the buyer.",
			"type": "boolean"
		},
		"orderDate": {
			"title": "Order Date",
			"description": "Date order was placed.",
			"anyOf": [
				{
					"type": "string",
					"format": "date"
				},
				{
					"type": "string",
					"format": "date-time"
				}
			]
		},
		"orderNumber": {
			"title": "Order Number",
			"description": "The identifier of the transaction.",
			"type": "string"
		},
		"orderedItem": {
			"title": "Ordered Item",
			"description": "The item ordered.",
			"anyOf": [{"$ref": "Product.json#/definitions/possibleRef"}, {"$ref": "OrderItem.json#/definitions/possibleRef"}, {"$ref": "Service.json#/definitions/possibleRef"}]
		},
		"paymentDueDate": {
			"title": "Payment Due Date",
			"description": "The date that payment is due. Supersedes paymentDue.",
			"anyOf": [
				{
					"type": "string",
					"format": "date"
				},
				{
					"type": "string",
					"format": "date-time"
				}
			]
		},
		"paymentMethodId": {
			"title": "Payment Method Id",
			"description": "An identifier for the method of payment used (e.g. the last 4 digits of the credit card).",
			"type": "string"
		},
		"possibleRef": {
			"oneOf": [
				{"$ref": "#"},
				{
					"type": "string",
					"format": "uri",
					"links": [{
						"rel": "full",
						"href": "{+$}"
					}]
				}
			]
		},
		"possibleRefArray": {
			"oneOf": [
				{
					"type": "array",
					"items": {"$ref": "#/definitions/possibleRef"}
				},
				{
					"type": "string",
					"format": "uri",
					"links": [{
						"rel": "full",
						"href": "{+$}"
					}]
				}
			]
		},
		"seller": {
			"title": "Seller",
			"description": "An entity which offers (sells / leases / lends / loans) the services / goods.  A seller may also be a provider. Supersedes merchant, vendor.",
			"anyOf": [{"$ref": "Organization.json#/definitions/possibleRef"}, {"$ref": "Person.json#/definitions/possibleRef"}]
		}
	}
}