An order.
Orders cannot be placed through the REST API.
Shopify allows order creation on the condition that it's for archival purposes, like if you're migrating from somewhere. Only finalized orders can be created, whether that finalization happened through fulfillment or cancellation.
Open orders cannot be created through the API. Consider using a DraftOrder instead.
Orders are mostly immutable except for a few things, which are documented here.
Public Properties | |
const | DIR = 'orders' |
const | FULFILLMENT_COMPLETE = 'fulfilled' |
const | FULFILLMENT_NONE = null |
const | FULFILLMENT_PARTIAL = 'partial' |
const | FULFILLMENT_RESTOCKED = 'restocked' |
const | INVENTORY_BYPASS = 'bypass' |
const | INVENTORY_DECREMENT_IGNORE = 'decrement_ignoring_policy' |
const | INVENTORY_DECREMENT_OBEY = 'decrement_obeying_policy' |
const | MAP |
const | PAYMENT_AUTHORIZED = 'authorized' |
const | PAYMENT_COMPLETE = 'paid' |
const | PAYMENT_PARTIAL = 'partially_paid' |
const | PAYMENT_PARTIAL_REFUND = 'partially_refunded' |
const | PAYMENT_PENDING = 'pending' |
const | PAYMENT_REFUNDED = 'refunded' |
const | PAYMENT_VOIDED = 'voided' |
const | SEARCH_FULFILLMENT_ANY = 'any' |
const | SEARCH_FULFILLMENT_PARTIAL = 'partial' |
const | SEARCH_FULFILLMENT_SHIPPED = 'shipped' |
const | SEARCH_FULFILLMENT_UNSHIPPED = 'unshipped' |
const | SEARCH_PAYMENT_ANY = 'any' |
const | SEARCH_PAYMENT_AUTHORIZED = 'authorized' |
const | SEARCH_PAYMENT_COMPLETE = 'paid' |
const | SEARCH_PAYMENT_INCOMPLETE = 'unpaid' |
const | SEARCH_PAYMENT_PARTIAL = 'partially_paid' |
const | SEARCH_PAYMENT_PARTIAL_REFUND = 'partially_refunded' |
const | SEARCH_PAYMENT_PENDING = 'pending' |
const | SEARCH_PAYMENT_REFUNDED = 'refunded' |
const | SEARCH_PAYMENT_VOIDED = 'voided' |
const | SEARCH_STATUS_ANY = 'any' |
const | SEARCH_STATUS_CANCELLED = 'cancelled' |
const | SEARCH_STATUS_CLOSED = 'closed' |
const | SEARCH_STATUS_OPEN = 'open' |
const | TYPE = 'order' |
Public Properties inherited from AbstractOrder | |
const | MAP |
Public Properties inherited from AbstractEntity | |
const | DIR = '' |
All subclasses must redeclare this to match their REST directory (without container). More... | |
const | TYPE = '' |
All subclasses must redeclare this to match their types. More... | |
Public Properties inherited from Data | |
const | MAP = [] |
const | PATCH = [] |
Public Methods | |
$this | cancel () |
Cancels the order. More... | |
$this | close () |
Closes the order. More... | |
magic string | getAppId () |
magic string | getBrowserIp () |
magic bool | getBuyerAcceptsMarketing () |
magic string | getCancelledAt () |
magic string | getCancelReason () |
magic string | getCartToken () |
magic string | getClientDetails () |
magic string | getClosedAt () |
magic string | getCurrentTotalDutiesSet () |
magic string | getCustomerLocale () |
magic AppliedDiscount[] | getDiscountApplications () |
magic Discount[] | getDiscountCodes () |
magic string | getFinancialStatus () |
magic Fulfillment[] | getFulfillments () |
magic string | getFulfillmentStatus () |
magic string | getLandingSite () |
magic string | getLocationId () |
magic string | getNumber () |
magic string | getOrderNumber () |
magic string | getOrderStatusUrl () |
magic string | getOriginalTotalDutiesSet () |
magic string[] | getPaymentGatewayNames () |
magic string | getPhone () |
magic string | getPresentmentCurrency () |
magic string | getProcessedAt () |
magic string | getProcessingMethod () |
magic string | getReferringSite () |
magic Refund[] | getRefunds () |
magic Shipping[] | getShippingLines () |
magic string | getSourceName () |
magic string | getSubtotalPriceSet () |
magic string | getTaxesIncluded () |
magic string | getToken () |
magic string | getTotalDiscounts () |
magic string | getTotalDiscountsSet () |
magic number | getTotalLineItemsPrice () |
magic string | getTotalLineItemsPriceSet () |
magic string | getTotalPriceSet () |
magic string | getTotalTaxSet () |
magic string | getTotalTipReceived () |
magic string | getTotalWeight () |
magic string | getUserId () |
staff account id More... | |
magic bool | hasDiscountApplications () |
magic bool | hasDiscountCodes () |
magic bool | hasFulfillments () |
magic bool | hasNoteAttributes () |
magic bool | hasPaymentGatewayNames () |
magic bool | hasRefunds () |
magic bool | hasShippingLines () |
magic bool | hasTaxLines () |
magic bool | isTest () |
Discount | newDiscount () |
Fulfillment | newFulfillment () |
Refund | newRefund () |
Shipping | newShipping () |
$this | reopen () |
Reopens a closed order. More... | |
magic $this | setBuyerAcceptsMarketing (bool $marketing) |
magic $this | setCancelReason (string $reason) |
magic $this | setDiscountCodes (Discount[] $codes) |
magic $this | setFinancialStatus (string $status) |
magic $this | setFulfillments (string[] $fulfillments) |
magic $this | setFulfillmentStatus (string $status) |
magic $this | setInventoryBehavior (string $behavior) |
magic $this | setLocationId (string $id) |
magic $this | setPhone (string $phone) |
magic $this | setPresentmentCurrency (string $currency) |
magic $this | setProcessedAt (string $iso8601) |
magic $this | setReferringSite (string $site) |
magic $this | setSendFulfillmentReceipt (bool $receipt) |
magic $this | setSendReceipt (bool $receipt) |
magic $this | setShippingLines (Shipping[] $lines) |
magic $this | setSourceName (string $name) |
magic $this | setSubtotalPriceSet (string $set) |
magic $this | setTaxLines (Tax[] $taxes) |
magic $this | setTest (bool $test) |
magic $this | setTotalDiscounts (string $discounts) |
magic $this | setTotalDiscountsSet (string $set) |
magic $this | setTotalLineItemsPrice (number $price) |
magic $this | setTotalLineItemsPriceSet (string $set) |
magic $this | setTotalPriceSet (string $set) |
magic $this | setTotalTaxSet (string $set) |
magic $this | setTotalTipReceived (string $received) |
magic $this | setTotalWeight (string $weight) |
Public Methods inherited from AbstractOrder | |
magic null Address | getBillingAddress () |
magic string | getCreatedAt () |
magic string | getCurrency () |
magic null Customer | getCustomer () |
magic string | getEmail () |
magic OrderItem[] | getLineItems () |
magic string | getName () |
magic string | getNote () |
magic array[] | getNoteAttributes () |
name-value "hash" More... | |
magic null Address | getShippingAddress () |
magic string | getSubtotalPrice () |
magic string | getTags () |
magic Tax[] | getTaxLines () |
magic string | getTotalPrice () |
magic string | getTotalTax () |
magic string | getUpdatedAt () |
magic bool | hasTaxesIncluded () |
magic $this | setBillingAddress (?Address $address) |
magic $this | setCurrency (string $iso4217) |
magic $this | setCustomer (?Customer $customer) |
magic $this | setEmail (string $email) |
magic $this | setName (string $name) |
magic $this | setNote (string $note) |
magic $this | setNoteAttributes (array[] $hash) |
magic $this | setShippingAddress (?Address $address) |
magic $this | setSubtotalPrice (string $price) |
magic $this | setTags (string $csv) |
magic $this | setTaxesIncluded (bool $included) |
magic $this | setTotalPrice (string $price) |
magic $this | setTotalTax (string $amount) |
Public Methods inherited from AbstractEntity | |
string | __toString () |
null string | getId () |
string[] | getPoolKeys () |
bool | hasId () |
$this | reload () |
Fully reloads the entity from Shopify. More... | |
Public Methods inherited from Data | |
mixed | __call (string $method, array $args) |
__construct ($caller, array $data=[]) | |
string | serialize () |
Dehydrated JSON encode. More... | |
array | toArray () |
void | unserialize ($serialized) |
Public Methods inherited from MetafieldTrait | |
Metafield[] | getMetafields () |
Metafield | newMetafield () |
Factory. More... | |
Public Methods inherited from CreateTrait | |
$this | create () |
Public Methods inherited from DeleteTrait | |
void | delete () |
Public Methods inherited from UpdateTrait | |
$this | update () |
Additional Inherited Members | |
Protected Properties inherited from Data | |
Api | $api |
Pool | $pool |
Public Static Methods inherited from AbstractEntity | |
static null self | load ($caller, string $id, array $query=[]) |
static self[] | loadAll ($caller, string $path, array $query=[]) |
Protected Methods inherited from AbstractEntity | |
null AbstractEntity | _container () |
The container/owner object, if any. More... | |
mixed | _get (string $field) |
Lazy-loads missing fields. More... | |
void | _onDelete () |
void | _onSave () |
void | _reload (string $field) |
Protected Methods inherited from Data | |
mixed | _hydrate (string $class, $item) |
A factory that also hydrates / caches entities. More... | |
array | _select ($subject, callable $filter,... $args) |
Magic method: selectField(callable $filter) More... | |
$this | _setData (array $data) |
Clears all diffs and sets all data, hydrating mapped fields. More... | |
$this | _setField (string $field, $value) |
Sets a value, hydrating if mapped, and clears the diff. More... | |
Protected Methods inherited from MetafieldTrait | |
string | _metafieldType () |
Protected Methods inherited from CreateTrait | |
string | _dir () |
The POST directory. More... | |
const MAP |
$this cancel | ( | ) |
$this close | ( | ) |
Closes the order.
magic string getAppId | ( | ) |
magic string getBrowserIp | ( | ) |
magic bool getBuyerAcceptsMarketing | ( | ) |
magic string getCancelledAt | ( | ) |
magic string getCancelReason | ( | ) |
magic string getCartToken | ( | ) |
magic string getClientDetails | ( | ) |
magic string getClosedAt | ( | ) |
magic string getCurrentTotalDutiesSet | ( | ) |
magic string getCustomerLocale | ( | ) |
magic AppliedDiscount [] getDiscountApplications | ( | ) |
magic string getFinancialStatus | ( | ) |
magic Fulfillment [] getFulfillments | ( | ) |
magic string getFulfillmentStatus | ( | ) |
magic string getLandingSite | ( | ) |
magic string getLocationId | ( | ) |
magic string getNumber | ( | ) |
magic string getOrderNumber | ( | ) |
magic string getOrderStatusUrl | ( | ) |
magic string getOriginalTotalDutiesSet | ( | ) |
magic string [] getPaymentGatewayNames | ( | ) |
magic string getPhone | ( | ) |
magic string getPresentmentCurrency | ( | ) |
magic string getProcessedAt | ( | ) |
magic string getProcessingMethod | ( | ) |
magic string getReferringSite | ( | ) |
magic string getSourceName | ( | ) |
magic string getSubtotalPriceSet | ( | ) |
magic string getTaxesIncluded | ( | ) |
magic string getToken | ( | ) |
magic string getTotalDiscounts | ( | ) |
magic string getTotalDiscountsSet | ( | ) |
magic number getTotalLineItemsPrice | ( | ) |
magic string getTotalLineItemsPriceSet | ( | ) |
magic string getTotalPriceSet | ( | ) |
magic string getTotalTaxSet | ( | ) |
magic string getTotalTipReceived | ( | ) |
magic string getTotalWeight | ( | ) |
magic string getUserId | ( | ) |
staff account id
magic bool hasDiscountApplications | ( | ) |
magic bool hasDiscountCodes | ( | ) |
magic bool hasFulfillments | ( | ) |
magic bool hasNoteAttributes | ( | ) |
magic bool hasPaymentGatewayNames | ( | ) |
magic bool hasRefunds | ( | ) |
magic bool hasShippingLines | ( | ) |
magic bool hasTaxLines | ( | ) |
magic bool isTest | ( | ) |
Fulfillment newFulfillment | ( | ) |
$this reopen | ( | ) |
Reopens a closed order.
magic $this setBuyerAcceptsMarketing | ( | bool | $marketing | ) |
magic $this setPhone | ( | string | $phone | ) |
magic $this setProcessedAt | ( | string | $iso8601 | ) |
magic $this setReferringSite | ( | string | $site | ) |
magic $this setTaxLines | ( | Tax[] | $taxes | ) |