Constructor
new Orders(api)
Main constructor
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
api |
MkmApi
|
Parent api to make the calls |
Methods
(async) acceptCancellation(idOrder, relistItemsopt) → {Promise}
Accept cancellation of a single order.
It is just a shorthand to modifyOrder(idOrder, 'acceptCancellation', '', relistItems)
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
idOrder |
Number
|
Order to be cancelled |
||
relistItems |
Boolean
|
<optional> |
false |
Relist items of the order after the cancellation |
Returns:
- Type:
-
Promise
Operation result
(async) cancel(idOrder) → {Promise}
Cancel an order.
It is just a shorthand to modifyOrder(idOrder, 'cancel')
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
idOrder |
Number
|
Order to be cancelled |
Returns:
- Type:
-
Promise
Operation result
(async) confirmReception(idOrder) → {Promise}
Confirm reception of an order.
It is just a shorthand to modifyOrder(idOrder, 'confirmReception')
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
idOrder |
Number
|
Order to be marked as received |
Returns:
- Type:
-
Promise
Operation result
(async) evaluate(idOrder, evaluation) → {Promise}
Evaluate an order. Grading values are:
- 1: very good
- 2: good
- 3: neutral
- 4: bad
- 10: n/a
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
idOrder |
Number
|
Order to evaluate |
|
evaluation |
Object
|
Evaluation information |
|
searchParams.evaluationGrade |
1
|
2
|
3
|
4
|
10
|
<optional> |
General grade |
searchParams.itemDescription |
1
|
2
|
3
|
4
|
10
|
<optional> |
Description grading |
searchParams.packaging |
1
|
2
|
3
|
4
|
10
|
<optional> |
Packaging grading |
searchParams.speed |
1
|
2
|
3
|
4
|
10
|
<optional> |
Speed grading |
searchParams.comment |
String
|
<optional> |
Comment |
searchParams.complaint |
Array.<String>
|
<optional> |
List of complaints. Posible values are:
|
Returns:
- Type:
-
Promise
Operation result
(async) getOrderById(idOrder) → {Promise}
Get all the information fo a single order
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
idOrder |
Number
|
id of the order |
Returns:
- Type:
-
Promise
Order information
(async) getOrders(isBuyer, state, startopt) → {Promise}
Get all orders done as a buyer or seller in a specific state
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
isBuyer |
Boolean
|
Return order done as buyer, is set to false it will return orders done as seller) |
||
state |
'bought'
|
'paid'
|
'sent'
|
'received'
|
'lost'
|
'cancelled'
|
Number
|
Return orders in the specified state, if sent as a number possible values are:
|
||
start |
Number
|
<optional> |
null |
Paginate results starting with this element, only 100 elements will be returned |
Returns:
- Type:
-
Promise
List of all Orders matching the filters
(async) markAsSent(idOrder) → {Promise}
Mark as sent an order.
It is just a shorthand to modifyOrder(idOrder, 'send')
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
idOrder |
Number
|
Order to be marked as sent |
Returns:
- Type:
-
Promise
Operation result
(async) modifyOrder(idOrder, action, reasonopt, relistItemsopt) → {Promise}
Modify an order (mark as sent, mark received, request cancel, aceept cancel or cancel)
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
idOrder |
Number
|
id of the order to be modified |
||
action |
'send'
|
'confirmReception'
|
'cancel'
|
'requestCancellation'
|
'acceptCancellation'
|
Action to perform on the order, possible values for action:
|
||
reason |
String
|
<optional> |
'' |
Reason of the cancellation (only needed if
|
relistItems |
Boolean
|
<optional> |
false |
Relist items after the cancellation is resolved
(only used if |
Returns:
- Type:
-
Promise
Operation result
(async) requestCancellation(idOrder, reasonopt, relistItemsopt) → {Promise}
Accept cancellation of a single order.
It is just a shorthand to
modifyOrder(idOrder, 'requestCancellation', reason, relistItems)
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
idOrder |
Number
|
Order to be cancelled |
||
reason |
String
|
<optional> |
'' |
Reason for the cancellation |
relistItems |
Boolean
|
<optional> |
false |
Relist item after the cancellation have been resolved |
Returns:
- Type:
-
Promise
operation result
(async) setTrackingNumber(idOrder, trackingNumber) → {Promise}
Sets the tracking number for an order as a seller
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
idOrder |
Number
|
Order to modify |
trackingNumber |
String
|
Tracking number |
Returns:
- Type:
-
Promise
Operation result