Orders/Methods

Orders/Methods

Methods

(static) orders/approvePayment(orderId, paymentId) → {Object}

Approve payment and apply any adjustments

Source:
Parameters:
Name Type Description
orderId String

The order ID

paymentId String

The payment ID

Returns:

The updated order document

Type
Object

(static) orders/cancelOrder(order, returnToStock) → {Object}

Start the cancel order process

Source:
Parameters:
Name Type Description
order Object

order object

returnToStock Boolean

condition to return product to stock

Returns:

ret

Type
Object

(static) orders/makeAdjustmentsToInvoice(order) → {Object}

Update the status of an invoice to allow adjustments to be made

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

Mongo update

Type
Object

(static) orders/processPayment(order) → {Object}

trigger processPayment and workflow update

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

return this.processPayment result

Type
Object

(static) orders/refund/list(order) → {Array}

loop through order's payments and find existing refunds. Get a list of refunds for a particular payment method.

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

Array contains refund records

Type
Array

(static) orders/refunds/create(orderId, paymentId, amount) → {null}

Apply a refund to an already captured order

Source:
Parameters:
Name Type Description
orderId String

order object

paymentId String

ID of payment to refund

amount Number

Amount of the refund, as a positive number. If this is more than the remaining amount to be refunded for this payment, the rest of the payment will be refunded, making it fully refunded.

Returns:

no return value

Type
null

(static) orders/refunds/refundItems(orderId, paymentId, refundItemsInfo) → {Object}

Apply a refund to line items

Source:
Parameters:
Name Type Description
orderId String

order object

paymentId String

ID of payment to refund

refundItemsInfo Object

info about refund items

Returns:

refund boolean and result/error value

Type
Object

(static) orders/sendNotification(orderId, action) → {Boolean}

send order notification email

Source:
Parameters:
Name Type Description
orderId String

The order ID

action String

send notification action

Returns:

email sent or not

Type
Boolean

(static) orders/shipmentDelivered(order) → {Object}

trigger shipmentShipped status and workflow update

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

return workflow result

Type
Object

(static) orders/shipmentLabeled(order, fulfillmentGroup) → {Object}

update labeling status

Source:
Parameters:
Name Type Description
order Object

order object

fulfillmentGroup Object

fulfillmentGroup object

Returns:

return workflow result

Type
Object

(static) orders/shipmentPacked(order, fulfillmentGroup) → {Object}

update packing status

Source:
Parameters:
Name Type Description
order Object

order object

fulfillmentGroup Object

fulfillmentGroup object

Returns:

return workflow result

Type
Object

(static) orders/shipmentPicked(order, fulfillmentGroup) → {Object}

update picking status

Source:
Parameters:
Name Type Description
order Object

order object

fulfillmentGroup Object

fulfillmentGroup object

Returns:

return workflow result

Type
Object

(static) orders/shipmentShipped(order, fulfillmentGroup) → {Object}

trigger shipmentShipped status and workflow update

Source:
Parameters:
Name Type Description
order Object

order object

fulfillmentGroup Object

fulfillmentGroup object

Returns:

return results of several operations

Type
Object

(static) orders/updateHistory(orderId, event, value) → {String}

adds order history item for tracking and logging order updates

Source:
Parameters:
Name Type Description
orderId String

add tracking to orderId

event String

workflow event

value String

event value

Returns:

returns order update result

Type
String