Skip to content

Commit

Permalink
#292 Add documentation on ManageOrderLines endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Jan 27, 2023
1 parent b091cf5 commit 47701ba
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,37 @@ OrderLineUpdateRequest updateRequest = new OrderLineUpdateRequest() {
OrderResponse updatedOrder = await orderClient.UpdateOrderLinesAsync({orderId}, createdOrder.Lines.First().Id, updateRequest);
```

### Manage order lines
Use this endpoint to update, cancel, or add one or more order lines. This endpoint sends a single authorisation request that contains the final order lines and amount to the supplier.
```c#
IOrderClient orderClient = new OrderClient("{yourApiKey}");
ManageOrderLinesRequest manageOrderLinesRequest = new ManageOrderLinesRequest() {
Operations = new List<ManageOrderLinesOperation> {
new ManageOrderLinesAddOperation() {
Data = new ManageOrderLinesAddOperationData {
Name = "new-order-line",
// Other properties of order line to add
}
},
new ManageOrderLinesUpdateOperation {
Data = new ManageOrderLinesUpdateOperationData {
Id = "{yourOrderLineIdToUpdate}",
Name = "updated-name"
// ... Other properties you'd like to update
}
},
new ManageOrderLinesCancelOperation {
Data = new ManagerOrderLinesCancelOperationData {
Id = "{yourOrderLineIdToCancel}",
Quantity = 1
}
}
}
};
OrderResponse updatedOrder = await this._orderClient.ManageOrderLinesAsync(createdOrder.Id, manageOrderLinesRequest);
```


### Retrieve list of orders
Retrieve all orders.
```c#
Expand Down

0 comments on commit 47701ba

Please sign in to comment.