Skip to content

Latest commit

 

History

History
91 lines (86 loc) · 17.2 KB

ordercreaterequest.md

File metadata and controls

91 lines (86 loc) · 17.2 KB

OrderCreateRequest

Example Usage

import { OrderCreateRequest } from "shippo/models/components";

let value: OrderCreateRequest = {
  currency: "USD",
  notes: "This customer is a VIP",
  orderNumber: "#1068",
  orderStatus: "PAID",
  placedAt: "2016-09-23T01:28:12Z",
  shippingCost: "12.83",
  shippingCostCurrency: "USD",
  shippingMethod: "USPS First Class Package",
  subtotalPrice: "12.1",
  totalPrice: "24.93",
  totalTax: "0.0",
  weight: "0.4",
  weightUnit: "lb",
  fromAddress: {
    name: "Shwan Ippotle",
    company: "Shippo",
    street1: "215 Clayton St.",
    street3: "",
    streetNo: "",
    city: "San Francisco",
    state: "CA",
    zip: "94117",
    country: "US",
    phone: "+1 555 341 9393",
    email: "[email protected]",
    isResidential: true,
    metadata: "Customer ID 123456",
    validate: true,
  },
  toAddress: {
    name: "Shwan Ippotle",
    company: "Shippo",
    street1: "215 Clayton St.",
    street3: "",
    streetNo: "",
    city: "San Francisco",
    state: "CA",
    zip: "94117",
    country: "US",
    phone: "+1 555 341 9393",
    email: "[email protected]",
    isResidential: true,
    metadata: "Customer ID 123456",
    validate: true,
  },
  lineItems: [
    {
      currency: "USD",
      manufactureCountry: "US",
      maxDeliveryTime: new Date("2016-07-23T00:00:00Z"),
      maxShipTime: new Date("2016-07-23T00:00:00Z"),
      quantity: 20,
      sku: "HM-123",
      title: "Hippo Magazines",
      totalPrice: "12.1",
      variantTitle: "June Edition",
      weight: "0.4",
      weightUnit: "lb",
    },
  ],
};

Fields

Field Type Required Description Example
currency string Required if total_price is provided

Currency of the total_price and total_tax amounts.
USD
notes string Custom buyer- or seller-provided notes about the order. This customer is a VIP
orderNumber string An alphanumeric identifier for the order used by the seller/buyer. This identifier doesn't need to be unique. #1068
orderStatus components.OrderStatusEnum Current state of the order. See the orders tutorial
for the logic of how the status is handled.
PAID
placedAt string ✔️ Date and time when the order was placed. This datetime can be different from the datetime of the order object creation on Shippo. 2016-09-23T01:28:12Z
shippingCost string Amount paid by the buyer for shipping. This amount can be different from the price the seller will actually pay for shipping. 12.83
shippingCostCurrency string Required if shipping_cost is provided

Currency of the shipping_cost amount.
USD
shippingMethod string Shipping method (carrier + service or other free text description) chosen by the buyer.
This value can be different from the shipping method the seller will actually choose.
USPS First Class Package
subtotalPrice string N/A 12.1
totalPrice string Total amount paid by the buyer for this order. 24.93
totalTax string Total tax amount paid by the buyer for this order. 0.0
weight string Total weight of the order. 0.4
weightUnit components.WeightUnitEnum The unit used for weight. lb
fromAddress components.AddressCreateRequest Address object of the sender / seller. Will be returned expanded by default..
toAddress components.AddressCreateRequest ✔️ Address object of the recipient / buyer. Will be returned expanded by default.
lineItems components.LineItemBase[] Array of line item objects representing the items in this order.
All objects will be returned expanded by default.