Home Identifier Source Repository
public class | source

Order

Extends:

Base → Order

The Order resource

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public get

Method Summary

Public Methods
public

Cancel an order

public

Close an open order

public

Open a closed order

Inherited Summary

From class Base
public get

Returns an object that supplies the clear, count and merge actions for this resource

public get

An array of methods to be exposed via APIProxy

public

clear()

Dispatches the clear action for this resource.

public

create(resource: object, options: object): RequestPromise

Performs a POST request, sending the resource along as the request body

public

Destroys the resource

public

Performs a GET request for the specified query.

public

Performs a GET request for the resource's count endpoint

public

update(id: number | string, resource: object, options: object): RequestPromise

Updates the given resource

protected

Public Constructors

public constructor source

Override:

Base#constructor

Public Members

public get apiMethods: * source

Override:

Base#apiMethods

Public Methods

public cancel(id: number | string, options: object): RequestPromise source

Cancel an order

Params:

NameTypeAttributeDescription
id number | string

The id of the order

options object
  • optional

Options for the cancel operation

options.amount number
  • optional

The (decimal) amount to refund

options.restock boolean
  • optional
  • default: false

Whether or not to restock inventory

options.reason string
  • optional
  • default: other

One of customer, inventory, fraud or other

options.email boolean
  • optional
  • default: false

Whether or not to send the customer an email regarding the cancellation

Return:

RequestPromise

public close(id: number | string): RequestPromise source

Close an open order

Params:

NameTypeAttributeDescription
id number | string

The id of the order

Return:

RequestPromise

public open(id: number | string): RequestPromise source

Open a closed order

Params:

NameTypeAttributeDescription
id number | string

The id of the order

Return:

RequestPromise