SEO.JSONLD.Order (SEO v0.3.0-rc.0)

View Source

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.

Helper for building a Schema.org Order JSON-LD structure.

Summary

Types

t()

A JSON-LD map ready to be nested or rendered. String-keyed, always includes "@type" set to "Order", plus any camelCased field keys the caller provided (see build/1). "@context" is added at render time by SEO.JSONLD.meta/1 on the top-level node only.

Functions

Build a Order JSON-LD map.

Types

attrs()

@type attrs() ::
  %{
    optional(:accepted_offer) => SEO.JSONLD.Offer.t() | map(),
    optional(:billing_address) => SEO.JSONLD.PostalAddress.t() | map(),
    optional(:broker) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:confirmation_number) => String.t(),
    optional(:customer) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:discount) => String.t() | number(),
    optional(:discount_code) => String.t(),
    optional(:discount_currency) => String.t(),
    optional(:is_gift) => boolean(),
    optional(:merchant) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:order_date) =>
      Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
    optional(:order_delivery) => SEO.JSONLD.ParcelDelivery.t() | map(),
    optional(:order_number) => String.t(),
    optional(:order_status) =>
      :order_cancelled
      | :order_delivered
      | :order_in_transit
      | :order_payment_due
      | :order_pickup_available
      | :order_problem
      | :order_processing
      | :order_returned,
    optional(:ordered_item) =>
      SEO.JSONLD.Product.t()
      | map()
      | SEO.JSONLD.Service.t()
      | SEO.JSONLD.OrderItem.t(),
    optional(:part_of_invoice) => SEO.JSONLD.Invoice.t() | map(),
    optional(:payment_due) => DateTime.t() | NaiveDateTime.t() | String.t(),
    optional(:payment_due_date) =>
      DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
    optional(:payment_method) =>
      String.t() | SEO.JSONLD.PaymentMethod.t() | map(),
    optional(:payment_method_id) => String.t(),
    optional(:payment_url) => URI.t() | String.t(),
    optional(:seller) =>
      SEO.JSONLD.Person.t() | map() | SEO.JSONLD.Organization.t(),
    optional(:additional_type) => String.t() | URI.t(),
    optional(:alternate_name) => String.t(),
    optional(:description) => SEO.JSONLD.TextObject.t() | map() | String.t(),
    optional(:disambiguating_description) => String.t(),
    optional(:identifier) =>
      String.t() | URI.t() | SEO.JSONLD.PropertyValue.t() | map(),
    optional(:image) =>
      URI.t() | String.t() | SEO.JSONLD.ImageObject.t() | map(),
    optional(:main_entity_of_page) =>
      SEO.JSONLD.CreativeWork.t() | map() | URI.t() | String.t(),
    optional(:name) => String.t(),
    optional(:owner) =>
      SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
    optional(:potential_action) => SEO.JSONLD.Action.t() | map(),
    optional(:same_as) => URI.t() | String.t(),
    optional(:subject_of) =>
      SEO.JSONLD.Event.t() | map() | SEO.JSONLD.CreativeWork.t(),
    optional(:url) => URI.t() | String.t()
  }
  | [
      accepted_offer: SEO.JSONLD.Offer.t() | map(),
      billing_address: SEO.JSONLD.PostalAddress.t() | map(),
      broker: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      confirmation_number: String.t(),
      customer: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      discount: String.t() | number(),
      discount_code: String.t(),
      discount_currency: String.t(),
      is_gift: boolean(),
      merchant: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      order_date: Date.t() | String.t() | DateTime.t() | NaiveDateTime.t(),
      order_delivery: SEO.JSONLD.ParcelDelivery.t() | map(),
      order_number: String.t(),
      order_status:
        :order_cancelled
        | :order_delivered
        | :order_in_transit
        | :order_payment_due
        | :order_pickup_available
        | :order_problem
        | :order_processing
        | :order_returned,
      ordered_item:
        SEO.JSONLD.Product.t()
        | map()
        | SEO.JSONLD.Service.t()
        | SEO.JSONLD.OrderItem.t(),
      part_of_invoice: SEO.JSONLD.Invoice.t() | map(),
      payment_due: DateTime.t() | NaiveDateTime.t() | String.t(),
      payment_due_date:
        DateTime.t() | NaiveDateTime.t() | String.t() | Date.t(),
      payment_method: String.t() | SEO.JSONLD.PaymentMethod.t() | map(),
      payment_method_id: String.t(),
      payment_url: URI.t() | String.t(),
      seller: SEO.JSONLD.Person.t() | map() | SEO.JSONLD.Organization.t(),
      additional_type: String.t() | URI.t(),
      alternate_name: String.t(),
      description: SEO.JSONLD.TextObject.t() | map() | String.t(),
      disambiguating_description: String.t(),
      identifier: String.t() | URI.t() | SEO.JSONLD.PropertyValue.t() | map(),
      image: URI.t() | String.t() | SEO.JSONLD.ImageObject.t() | map(),
      main_entity_of_page:
        SEO.JSONLD.CreativeWork.t() | map() | URI.t() | String.t(),
      name: String.t(),
      owner: SEO.JSONLD.Organization.t() | map() | SEO.JSONLD.Person.t(),
      potential_action: SEO.JSONLD.Action.t() | map(),
      same_as: URI.t() | String.t(),
      subject_of: SEO.JSONLD.Event.t() | map() | SEO.JSONLD.CreativeWork.t(),
      url: URI.t() | String.t()
    ]

t()

@type t() :: %{required(String.t()) => term()}

A JSON-LD map ready to be nested or rendered. String-keyed, always includes "@type" set to "Order", plus any camelCased field keys the caller provided (see build/1). "@context" is added at render time by SEO.JSONLD.meta/1 on the top-level node only.

Functions

build(attrs)

@spec build(attrs()) :: t()

Build a Order JSON-LD map.

Fields

  • :accepted_offer - The offer(s) -- e.g., product, quantity and price combinations -- included in the order.
  • :billing_address - The billing address for the order.
  • :broker - 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.
  • :confirmation_number - A number that confirms the given order or payment has been received.
  • :customer - Party placing the order or paying the invoice.
  • :discount - Any discount applied (to an Order).
  • :discount_code - Code used to redeem a discount.
  • :discount_currency - The currency of the discount.

Use standard formats: ISO 4217 currency format, e.g. "USD"; Ticker symbol for cryptocurrencies, e.g. "BTC"; well known names for Local Exchange Trading Systems (LETS) and other currency types, e.g. "Ithaca HOUR".

  • :is_gift - Indicates whether the offer was accepted as a gift for someone other than the buyer.
  • :merchant - 'merchant' is an out-dated term for 'seller'.
  • :order_date - Date order was placed.
  • :order_delivery - The delivery of the parcel related to this order or order item.
  • :order_number - The identifier of the transaction.
  • :order_status - The current status of the order. One of: :order_cancelled, :order_delivered, :order_in_transit, :order_payment_due, :order_pickup_available, :order_problem, :order_processing, :order_returned.
  • :ordered_item - The item ordered.
  • :part_of_invoice - The order is being paid as part of the referenced Invoice.
  • :payment_due - The date that payment is due.
  • :payment_due_date - The date that payment is due.
  • :payment_method - The name of the credit card or other method of payment for the order.
  • :payment_method_id - An identifier for the method of payment used (e.g. the last 4 digits of the credit card).
  • :payment_url - The URL for sending a payment.
  • :seller - An entity which offers (sells / leases / lends / loans) the services / goods. A seller may also be a provider.

Inherited properties

Additional properties are available through the inheritance chain. See each ancestor's docs for its properties: