Contents

POST [/instances/$INSTANCES]/templates/$TEMPLATE_ID#

This using template can be modified by everyone and will be used to create order.

Request:

The request must be a UsingTemplateDetailsRequest and we accept JSON application and URL encoded.

Response:

The response is exactly the same type of response as when creating an order using POST /private/orders.

Details:

type UsingTemplateDetailsRequest = (UsingTemplateFixedOrderRequest | UsingTemplateInventoryCartRequest | UsingTemplatePaivanaRequest) & UsingTemplateCommonRequest;
interface UsingTemplateCommonRequest {

  // Type of the template being instantiated.
  // Possible values include "fixed-order",
  // "inventory-cart" and "paivana".
  // Since protocol **v25**.
  // Defaults to "fixed-order" while supporting previous
  // protocol versions.
  template_type: string;

  // Summary to use in the contract. Only if
  // not already specified by the template.
  summary?: string;

  // The amount to be paid, including tip.
  amount?: Amount;

  // Optional tip amount. Must match the currency of amount or the
  // fixed template currency.
  // Since protocol **v25**.
  tip?: Amount;

}
interface UsingTemplateFixedOrderRequest {
   template_type: "fixed-order";

}
interface UsingTemplateInventoryCartRequest {
  template_type: "inventory-cart";

  // Inventory-cart: selected products and quantities.
  // Since protocol **v25**.
  inventory_selection?: InventorySelectionEntry[];
}
interface InventorySelectionEntry {
  // Inventory product to add.
  product_id: string;

  // Quantity in "<integer>[.<fraction>]" form using the product unit rules.
  quantity: DecimalQuantity;
}
interface UsingTemplatePaivanaRequest {
  template_type: "paivana";

  // URL of the Paivana-protected website to be
  // accessed. Will become the fulfillment URL in
  // the contract.
  website: string;

  // Client Paivana ID to grant access to.
  // This becomes the "session_id" for session-based
  // access control.
  paivana_id: string;

}