new module:api/OrdersApi(apiClient)
Constructs a new OrdersApi.
Parameters:
Name | Type | Description |
---|---|---|
apiClient |
module:ApiClient | Optional API client implementation to use, default to module:ApiClient#instance if unspecified. |
- Source:
Methods
deleteOrdersByIDNotesByID(orderNo, noteId) → {Promise}
Removes an order note.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the id of the order to be modified |
noteId |
String | the id of the note to be removed |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
deleteOrdersByIDNotesByIDWithHttpInfo(orderNo, noteId) → {Promise}
Removes an order note.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the id of the order to be modified |
noteId |
String | the id of the note to be removed |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
deleteOrdersByIDPaymentInstrumentsByID(orderNo, paymentInstrumentId) → {Promise}
Removes a payment instrument of an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
paymentInstrumentId |
String | the id of the payment instrument to be updated |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
deleteOrdersByIDPaymentInstrumentsByIDWithHttpInfo(orderNo, paymentInstrumentId) → {Promise}
Removes a payment instrument of an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
paymentInstrumentId |
String | the id of the payment instrument to be updated |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
getOrdersByID(orderNo) → {Promise}
Gets information for an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
getOrdersByIDNotes(orderNo) → {Promise}
Retrieves notes for an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The id of the order from which you want to retrieve notes. |
- Source:
Returns:
a Promise, with data of type module:models/NotesResult
- Type
- Promise
getOrdersByIDNotesWithHttpInfo(orderNo) → {Promise}
Retrieves notes for an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The id of the order from which you want to retrieve notes. |
- Source:
Returns:
a Promise, with an object containing data of type module:models/NotesResult and HTTP response
- Type
- Promise
getOrdersByIDPaymentMethods(orderNo) → {Promise}
Gets the applicable payment methods for an existing order considering the open payment amount only.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
- Source:
Returns:
a Promise, with data of type module:models/PaymentMethodResult
- Type
- Promise
getOrdersByIDPaymentMethodsWithHttpInfo(orderNo) → {Promise}
Gets the applicable payment methods for an existing order considering the open payment amount only.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
- Source:
Returns:
a Promise, with an object containing data of type module:models/PaymentMethodResult and HTTP response
- Type
- Promise
getOrdersByIDWithHttpInfo(orderNo) → {Promise}
Gets information for an order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
patchOrdersByID(orderNo, body) → {Promise}
Update an order. Considered fields for update are status (same status transitions are possible as for dw.order.Order.setStatus(int status) plus CREATED to FAILED) and custom properties. During the call the correct channel type will be assured to be set for the order in a successful call. Without agent context the channel type will be storefront otherwise callcenter.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
body |
module:models/Order |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
patchOrdersByIDPaymentInstrumentsByID(orderNo, paymentInstrumentId, body, opts) → {Promise}
Updates a payment instrument of an order and passes the order and updated payment instrument to the correct payment authorizeCreditcard or authorize hook. Details: The payment instrument is updated with the provided details. The payment method must be applicable for the order see GET /baskets/{basket_id}/payment_methods, if the payment method is 'CREDIT_CARD' a payment_card must be specified in the request. Order authorization: To authorize the order one of two possible customization hooks is called and an dw.order.OrderPaymentInstrument is passed as an input argument. Which hook is called? If the request includes a payment_card or the dw.order.OrderPaymentInstrument contains a creditCardType the customization hook dw.order.payment.authorizeCreditCard is called. See dw.order.hooks.PaymentHooks.authorizeCreditCard(order : Order, paymentDetails : OrderPaymentInstrument, cvn : String) : Status. Otherwise dw.order.payment.authorize is called. See dw.order.hooks.PaymentHooks.authorize(order : Order, paymentDetails : OrderPaymentInstrument) : Status. What is the dw.order.OrderPaymentInstrument input argument passed to the hook? If the request contains a customer_payment_instrument_id the dw.order.OrderPaymentInstrument is copied from the customer payment instrument (An exception is thrown if none was found). Otherwise the data from the request document is passed (payment_card or payment_bank_account etc. information). Note: the amount and the security_code (cvn) contained in the payment_card data will be propagated if available to dw.order.payment.authorizeCreditCard even if the dw.order.OrderPaymentInstrument is resolved from a customer payment instrument. Customization hook dw.ocapi.shop.order.afterPatchPaymentInstrument is called. The default implementation places the order if the order status is CREATED and the authorization amount equals or exceeds the order total. Placing the order (equivalent to calling dw.order.OrderMgr.placeOrder(order : Order) in the scripting API) results in the order being changed to status NEW and prepared for export.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
orderNo |
String | the order number |
||||||
paymentInstrumentId |
String | the id of the payment instrument to be updated |
||||||
body |
module:models/OrderPaymentInstrumentRequest | |||||||
opts |
Object | Optional parameters Properties
|
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
patchOrdersByIDPaymentInstrumentsByIDWithHttpInfo(orderNo, paymentInstrumentId, body, opts) → {Promise}
Updates a payment instrument of an order and passes the order and updated payment instrument to the correct payment authorizeCreditcard or authorize hook. Details: The payment instrument is updated with the provided details. The payment method must be applicable for the order see GET /baskets/{basket_id}/payment_methods, if the payment method is 'CREDIT_CARD' a payment_card must be specified in the request. Order authorization: To authorize the order one of two possible customization hooks is called and an dw.order.OrderPaymentInstrument is passed as an input argument. Which hook is called? If the request includes a payment_card or the dw.order.OrderPaymentInstrument contains a creditCardType the customization hook dw.order.payment.authorizeCreditCard is called. See dw.order.hooks.PaymentHooks.authorizeCreditCard(order : Order, paymentDetails : OrderPaymentInstrument, cvn : String) : Status. Otherwise dw.order.payment.authorize is called. See dw.order.hooks.PaymentHooks.authorize(order : Order, paymentDetails : OrderPaymentInstrument) : Status. What is the dw.order.OrderPaymentInstrument input argument passed to the hook? If the request contains a customer_payment_instrument_id the dw.order.OrderPaymentInstrument is copied from the customer payment instrument (An exception is thrown if none was found). Otherwise the data from the request document is passed (payment_card or payment_bank_account etc. information). Note: the amount and the security_code (cvn) contained in the payment_card data will be propagated if available to dw.order.payment.authorizeCreditCard even if the dw.order.OrderPaymentInstrument is resolved from a customer payment instrument. Customization hook dw.ocapi.shop.order.afterPatchPaymentInstrument is called. The default implementation places the order if the order status is CREATED and the authorization amount equals or exceeds the order total. Placing the order (equivalent to calling dw.order.OrderMgr.placeOrder(order : Order) in the scripting API) results in the order being changed to status NEW and prepared for export.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
orderNo |
String | the order number |
||||||
paymentInstrumentId |
String | the id of the payment instrument to be updated |
||||||
body |
module:models/OrderPaymentInstrumentRequest | |||||||
opts |
Object | Optional parameters Properties
|
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
patchOrdersByIDWithHttpInfo(orderNo, body) → {Promise}
Update an order. Considered fields for update are status (same status transitions are possible as for dw.order.Order.setStatus(int status) plus CREATED to FAILED) and custom properties. During the call the correct channel type will be assured to be set for the order in a successful call. Without agent context the channel type will be storefront otherwise callcenter.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | the order number |
body |
module:models/Order |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
postOrders(body) → {Promise}
Submits an order based on a prepared basket. Note: If the basket has been submitted using Order Center (considered by it's client id) the channel type will be set to "Call Center". In case another channel type was set by a script before submitting the basket, the channel type will be reset to "Call Center" and a warning will be logged. The only considered value from the request body is basket_id.
Parameters:
Name | Type | Description |
---|---|---|
body |
module:models/Basket |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
postOrdersByIDNotes(orderNo, body) → {Promise}
Adds a note to an existing order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The id of the order to be modified. |
body |
module:models/Note |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
postOrdersByIDNotesWithHttpInfo(orderNo, body) → {Promise}
Adds a note to an existing order.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The id of the order to be modified. |
body |
module:models/Note |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
postOrdersByIDPaymentInstruments(orderNo, body, opts) → {Promise}
Adds a payment instrument to an order. It is possible either to supply the full payment information or only a customer payment instrument id and amount. In case the customer payment instrument id was set all the other properties (except amount) are ignored and the payment data is resolved from the stored customer payment information. An attempt is made to authorize the order by passing it to the authorize or authorizeCreditCard hook. Details: The payment instrument is added with the provided details or the details from the customer payment instrument. The payment method must be applicable for the order see GET /baskets/{basket_id}/payment_methods, if the payment method is 'CREDIT_CARD' a payment_card must be specified in the request. Order authorization: To authorize the order one of two possible customization hooks is called and an dw.order.OrderPaymentInstrument is passed as an input argument. Which hook is called? If the request includes a payment_card or the dw.order.OrderPaymentInstrument contains a creditCardType the customization hook dw.order.payment.authorizeCreditCard is called. See dw.order.hooks.PaymentHooks.authorizeCreditCard(order : Order, paymentDetails : OrderPaymentInstrument, cvn : String) : Status. Otherwise dw.order.payment.authorize is called. See dw.order.hooks.PaymentHooks.authorize(order : Order, paymentDetails : OrderPaymentInstrument) : Status. What is the dw.order.OrderPaymentInstrument input argument passed to the hook? If the request contains a customer_payment_instrument_id the dw.order.OrderPaymentInstrument is copied from the customer payment instrument (An exception is thrown if none was found). Otherwise the data from the request document is passed (payment_card or payment_bank_account etc. information). Note: the amount and the security_code (cvn) contained in the payment_card data will be propagated if available to dw.order.payment.authorizeCreditCard even if the dw.order.OrderPaymentInstrument is resolved from a customer payment instrument. Customization hook dw.ocapi.shop.order.afterPostPaymentInstrument is called. The default implementation places the order if the order status is CREATED and the authorization amount equals or exceeds the order total. Placing the order (equivalent to calling dw.order.OrderMgr.placeOrder(order : Order) in the scripting API) results in the order being changed to status NEW and prepared for export.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
orderNo |
String | the order number |
||||||
body |
module:models/OrderPaymentInstrumentRequest | |||||||
opts |
Object | Optional parameters Properties
|
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
postOrdersByIDPaymentInstrumentsWithHttpInfo(orderNo, body, opts) → {Promise}
Adds a payment instrument to an order. It is possible either to supply the full payment information or only a customer payment instrument id and amount. In case the customer payment instrument id was set all the other properties (except amount) are ignored and the payment data is resolved from the stored customer payment information. An attempt is made to authorize the order by passing it to the authorize or authorizeCreditCard hook. Details: The payment instrument is added with the provided details or the details from the customer payment instrument. The payment method must be applicable for the order see GET /baskets/{basket_id}/payment_methods, if the payment method is 'CREDIT_CARD' a payment_card must be specified in the request. Order authorization: To authorize the order one of two possible customization hooks is called and an dw.order.OrderPaymentInstrument is passed as an input argument. Which hook is called? If the request includes a payment_card or the dw.order.OrderPaymentInstrument contains a creditCardType the customization hook dw.order.payment.authorizeCreditCard is called. See dw.order.hooks.PaymentHooks.authorizeCreditCard(order : Order, paymentDetails : OrderPaymentInstrument, cvn : String) : Status. Otherwise dw.order.payment.authorize is called. See dw.order.hooks.PaymentHooks.authorize(order : Order, paymentDetails : OrderPaymentInstrument) : Status. What is the dw.order.OrderPaymentInstrument input argument passed to the hook? If the request contains a customer_payment_instrument_id the dw.order.OrderPaymentInstrument is copied from the customer payment instrument (An exception is thrown if none was found). Otherwise the data from the request document is passed (payment_card or payment_bank_account etc. information). Note: the amount and the security_code (cvn) contained in the payment_card data will be propagated if available to dw.order.payment.authorizeCreditCard even if the dw.order.OrderPaymentInstrument is resolved from a customer payment instrument. Customization hook dw.ocapi.shop.order.afterPostPaymentInstrument is called. The default implementation places the order if the order status is CREATED and the authorization amount equals or exceeds the order total. Placing the order (equivalent to calling dw.order.OrderMgr.placeOrder(order : Order) in the scripting API) results in the order being changed to status NEW and prepared for export.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
orderNo |
String | the order number |
||||||
body |
module:models/OrderPaymentInstrumentRequest | |||||||
opts |
Object | Optional parameters Properties
|
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
postOrdersWithHttpInfo(body) → {Promise}
Submits an order based on a prepared basket. Note: If the basket has been submitted using Order Center (considered by it's client id) the channel type will be set to "Call Center". In case another channel type was set by a script before submitting the basket, the channel type will be reset to "Call Center" and a warning will be logged. The only considered value from the request body is basket_id.
Parameters:
Name | Type | Description |
---|---|---|
body |
module:models/Basket |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise
putOrdersByID(orderNo, body) → {Promise}
Submits an order with a given order number, based on a prepared basket. The only considered value from the request body is basket_id. This resource is available for OAuth authentication and requires no user i.e. it supports server-server communication with client grant authentication and no user is specified.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The order number to assign to the new order. |
body |
module:models/Basket |
- Source:
Returns:
a Promise, with data of type module:models/Order
- Type
- Promise
putOrdersByIDWithHttpInfo(orderNo, body) → {Promise}
Submits an order with a given order number, based on a prepared basket. The only considered value from the request body is basket_id. This resource is available for OAuth authentication and requires no user i.e. it supports server-server communication with client grant authentication and no user is specified.
Parameters:
Name | Type | Description |
---|---|---|
orderNo |
String | The order number to assign to the new order. |
body |
module:models/Basket |
- Source:
Returns:
a Promise, with an object containing data of type module:models/Order and HTTP response
- Type
- Promise