Skip to content

Commit fe4c290

Browse files
committed
feat(fulfillment-order): add hold method
1 parent f798cce commit fe4c290

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

resources/fulfillment-order.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,26 @@ FulfillmentOrder.prototype.fulfillments = function fulfillments(id) {
131131
* Halts all fulfillment work on a fulfillment order with
132132
* status OPEN and changes the status of the fulfillment order to ON_HOLD.
133133
*
134-
* @param {Number} id Order ID
135-
* @return {Promise} Promise that resolves with the result
134+
* @param {Number} id Fulfillment Order id (fulfillment_order_id).
135+
* @param {Object} params
136+
* @param {String} params.reason 'awaiting_paymet' | 'high_risk_of_fraud'
137+
* | 'incorrect_address' | 'inventory_out_of_stock' | 'other'.
138+
* @param {String} params.reason_notes (optiona) Additional information about
139+
* the fulfillment hold reason.
140+
* @param {Boolean} params.notify_merchant (optional) Whether the merchant
141+
* should receive a notification about the fulfillment hold.
142+
* If set to true, then the merchant will be notified on the Shopify
143+
* mobile app (if they use it to manage their store).
144+
* The default value is false.
145+
* @param {Array} params.fulfillment_order_line_items (optional) array of
146+
* fulfillment order line item ids and the quantity of each to move.
147+
* @return {Promise} Promise that resolves with the result.
136148
* @public
137149
*/
138150
FulfillmentOrder.prototype.hold = function hold(id, params) {
139151
const url = this.buildUrl(`${id}/hold`);
140152
return this.shopify
141-
.request(url, 'POST', undefined, params)
153+
.request(url, 'POST', undefined, { fulfillment_hold: params })
142154
.then((body) => body[this.key]);
143155
};
144156

0 commit comments

Comments
 (0)