Delete orders
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/orders
Description
Delete multiple orders.
Example
Request
1use Ticketmatic\Endpoints\Orders;
2
3$result = Orders::deletebatch($client, array(
4 1,
5));
Response
1object(\Ticketmatic\Model\BatchResult) (2) {
2 ["nbrsucceeded"]=>
3 int(0)
4 ["results"]=>
5 array(2) {
6 [0]=>
7 object(\Ticketmatic\Model\BatchResultItem) (3) {
8 ["id"]=>
9 int(0)
10 ["msg"]=>
11 string(0) ""
12 ["succeeded"]=>
13 bool(true)
14 }
15 [1]=>
16 object(\Ticketmatic\Model\BatchResultItem) (3) {
17 ["id"]=>
18 int(0)
19 ["msg"]=>
20 string(10) "Invalid id"
21 ["succeeded"]=>
22 bool(false)
23 }
24 }
25}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/orders"
4)
5
6result, err := orders.Deletebatch(client, []int64{
7 1,
8})
Response
1result := &ticketmatic.BatchResult{
2 Nbrsucceeded: 1,
3 Results: []*ticketmatic.BatchResultItem{
4 &ticketmatic.BatchResultItem{
5 Id: 1,
6 Msg: "",
7 Succeeded: true,
8 },
9 &ticketmatic.BatchResultItem{
10 Id: 2,
11 Msg: "Invalid id",
12 Succeeded: false,
13 },
14 },
15}
Request
1DELETE /api/1/{accountname}/orders HTTP/1.1
2Content-Type: application/json
3
4[ 1 ]
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "nbrsucceeded": 1,
6 "results": [
7 {
8 "id": 1,
9 "msg": "",
10 "succeeded": true
11 },
12 {
13 "id": 2,
14 "msg": "Invalid id",
15 "succeeded": false
16 }
17 ]
18}
Result fields
Field | Description |
---|---|
nbrsucceeded int | The number of items for which the batch operation succeeded. Example value:1 |
results | Detailed results for the batch operation Example value:[ { "id": 1, "msg": "", "succeeded": true }, { "id": 2, "msg": "Invalid id", "succeeded": false } ] |
Type reference: BatchResult