Add products to order
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/orders/{id}/products
Description
Add products to order
Example
Request
1use Ticketmatic\Endpoints\Orders;
2
3$result = Orders::addproducts($client, $id, array(
4 "products" => array(
5 array(
6 "productid" => 345,
7 ),
8 ),
9));
Response
1object(\Ticketmatic\Model\AddItemsResult) (2) {
2 ["ids"]=>
3 array(3) {
4 [0]=>
5 int(0)
6 [1]=>
7 int(0)
8 [2]=>
9 int(0)
10 }
11 ["order"]=>
12 object(\Ticketmatic\Model\Order) (1) {
13 ["orderid"]=>
14 int(0)
15 }
16}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/orders"
4)
5
6result, err := orders.Addproducts(client, id, &ticketmatic.AddProducts{
7 Products: []*ticketmatic.CreateProduct{
8 &ticketmatic.CreateProduct{
9 Productid: 345,
10 },
11 },
12})
Response
1result := &ticketmatic.AddItemsResult{
2 Ids: []int64{
3 1,
4 2,
5 5,
6 },
7 Order: &ticketmatic.Order{
8 Orderid: 1269434,
9 },
10}
Request
1POST /api/1/{accountname}/orders/{id}/products HTTP/1.1
2Content-Type: application/json
3
4{
5 "products": [
6 {
7 "productid": 345
8 }
9 ]
10}
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "ids": [ 1, 2, 5 ],
6 "order": {
7 "orderid": 1269434
8 }
9}
Request body fields
Field | Description |
---|---|
products | Product information Example value:[ { "productid": 345 } ] |
Type reference: AddProducts
Result fields
Field | Description |
---|---|
ids int[] | Ids of the items that were added Example value:[ 1, 2, 5 ] |
order | The modified order Example value:{ "orderid": 1269434 } |
Type reference: AddItemsResult