Orders/Methods

Orders/Methods

Methods

(static) orderCreditMethod(order) → {Object}

Helper to return the order credit object. Credit paymentMethod on the order as per current active shop

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

returns entire payment method

Type
Object

(static) orders/addOrderEmail(cartId, email) → {String}

Adds email to order, used for guest users

Source:
Parameters:
Name Type Description
cartId String

add tracking to orderId

email String

valid email address

Returns:

returns order update result

Type
String

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

Approve payment and apply any adjustments

Source:
Parameters:
Name Type Description
order Object

order object

Returns:

return this.processPayment result

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/capturePayments(orderId) → {null}

Finalize any payment where mode is "authorize" and status is "approved", reprocess as "capture"

Source:
Parameters:
Name Type Description
orderId String

add tracking to orderId

Returns:

no return value

Type
null

(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, sendEmail) → {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

sendEmail Bool

Send email confirmation

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

(static) orders/updateShipmentTracking(order, shipment, tracking) → {String}

Adds tracking information to order without workflow update. Call after any tracking code is generated

Source:
Parameters:
Name Type Description
order Object

An Order object

shipment Object

A Shipment object

tracking String

tracking id

Returns:

returns order update result

Type
String