Add refund for payment for order
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/orders/{id}/refunds
Example
Request
1use Ticketmatic\Endpoints\Orders;
2
3$result = Orders::addrefunds($client, $id, array(
4 "amount" => 1,
5 "paymentid" => 1,
6));
Response
1object(\Ticketmatic\Model\Order) (33) {
2 ["orderid"]=>
3 int(0)
4 ["amountpaid"]=>
5 float(15.000000)
6 ["calculate_ordercosts"]=>
7 bool(true)
8 ["code"]=>
9 string(12) "864056970700"
10 ["customerid"]=>
11 int(0)
12 ["deferredpaymentproperties"]=>
13 array(4) {
14 ["bankAccount"]=>
15 string(16) "BE54719400092697"
16 ["bankBic"]=>
17 string(8) "FTSBBE22"
18 ["bankName"]=>
19 string(25) "Stichting Mollie Payments"
20 ["transferReference"]=>
21 string(20) "+++695/7317/77752+++"
22 }
23 ["deliveryaddress"]=>
24 object(\Ticketmatic\Model\Address) (2) {
25 ["city"]=>
26 string(6) "Leuven"
27 ["street1"]=>
28 string(11) "Main street"
29 }
30 ["deliveryscenarioid"]=>
31 int(0)
32 ["deliverystatus"]=>
33 int(0)
34 ["expiryhandled"]=>
35 bool(false)
36 ["expiryts"]=>
37 object(\DateTime) (3) {
38 ["date"]=>
39 string(26) "2014-09-26 15:24:36.000000"
40 ["timezone_type"]=>
41 int(3)
42 ["timezone"]=>
43 string(3) "UTC"
44 }
45 ["firstname"]=>
46 string(4) "John"
47 ["hasopenpaymentrequest"]=>
48 bool(true)
49 ["isauthenticatedcustomer"]=>
50 bool(false)
51 ["lastname"]=>
52 string(3) "Doe"
53 ["lookup"]=>
54 array(1) {
55 ["events"]=>
56 array(0) {
57 }
58 }
59 ["nbroftickets"]=>
60 int(0)
61 ["ordercosts"]=>
62 array(2) {
63 [0]=>
64 object(\Ticketmatic\Model\Ordercost) (3) {
65 ["orderid"]=>
66 int(0)
67 ["amount"]=>
68 float(5.500000)
69 ["servicechargedefinitionid"]=>
70 int(0)
71 }
72 [1]=>
73 object(\Ticketmatic\Model\Ordercost) (3) {
74 ["orderid"]=>
75 int(0)
76 ["amount"]=>
77 float(2.000000)
78 ["servicechargedefinitionid"]=>
79 int(0)
80 }
81 }
82 ["payments"]=>
83 array(1) {
84 [0]=>
85 object(\Ticketmatic\Model\Payment) (7) {
86 ["id"]=>
87 int(0)
88 ["orderid"]=>
89 int(0)
90 ["amount"]=>
91 float(50.000000)
92 ["paidts"]=>
93 object(\DateTime) (3) {
94 ["date"]=>
95 string(26) "2015-04-07 07:00:00.000000"
96 ["timezone_type"]=>
97 int(3)
98 ["timezone"]=>
99 string(3) "UTC"
100 }
101 ["paymentmethodid"]=>
102 int(0)
103 ["properties"]=>
104 NULL
105 ["refundpaymentid"]=>
106 NULL
107 }
108 }
109 ["paymentscenarioid"]=>
110 int(0)
111 ["paymentstatus"]=>
112 int(0)
113 ["products"]=>
114 array(1) {
115 [0]=>
116 object(\Ticketmatic\Model\OrderProduct) (8) {
117 ["id"]=>
118 int(0)
119 ["orderid"]=>
120 int(0)
121 ["code"]=>
122 string(12) "123412341234"
123 ["contactid"]=>
124 NULL
125 ["price"]=>
126 float(15.000000)
127 ["productid"]=>
128 int(0)
129 ["properties"]=>
130 NULL
131 }
132 }
133 ["promocodes"]=>
134 array(2) {
135 [0]=>
136 string(9) "PROMO2015"
137 [1]=>
138 string(9) "COOLPROMO"
139 }
140 ["queuetokens"]=>
141 array(2) {
142 [0]=>
143 int(0)
144 [1]=>
145 int(0)
146 }
147 ["rappelhandled"]=>
148 bool(false)
149 ["rappelts"]=>
150 object(\DateTime) (3) {
151 ["date"]=>
152 string(26) "2014-09-26 15:24:36.000000"
153 ["timezone_type"]=>
154 int(3)
155 ["timezone"]=>
156 string(3) "UTC"
157 }
158 ["saleschannelid"]=>
159 int(0)
160 ["status"]=>
161 int(0)
162 ["tickets"]=>
163 array(2) {
164 [0]=>
165 object(\Ticketmatic\Model\OrderTicket) (8) {
166 ["id"]=>
167 int(0)
168 ["orderid"]=>
169 int(0)
170 ["price"]=>
171 float(15.000000)
172 ["servicecharge"]=>
173 float(1.000000)
174 ["ticketholderid"]=>
175 NULL
176 ["ticketname"]=>
177 NULL
178 ["tickettypeid"]=>
179 int(0)
180 ["tickettypepriceid"]=>
181 int(0)
182 }
183 [1]=>
184 object(\Ticketmatic\Model\OrderTicket) (8) {
185 ["id"]=>
186 int(0)
187 ["orderid"]=>
188 int(0)
189 ["price"]=>
190 float(15.000000)
191 ["servicecharge"]=>
192 float(1.000000)
193 ["ticketholderid"]=>
194 NULL
195 ["ticketname"]=>
196 NULL
197 ["tickettypeid"]=>
198 int(0)
199 ["tickettypepriceid"]=>
200 int(0)
201 }
202 }
203 ["totalamount"]=>
204 float(25.500000)
205 ["webskinid"]=>
206 int(0)
207 ["createdts"]=>
208 object(\DateTime) (3) {
209 ["date"]=>
210 string(26) "2014-09-26 15:24:36.000000"
211 ["timezone_type"]=>
212 int(3)
213 ["timezone"]=>
214 string(3) "UTC"
215 }
216 ["lastupdatets"]=>
217 object(\DateTime) (3) {
218 ["date"]=>
219 string(26) "2014-09-26 15:24:36.000000"
220 ["timezone_type"]=>
221 int(3)
222 ["timezone"]=>
223 string(3) "UTC"
224 }
225}
Request body fields
Field | Description |
---|---|
amount decimal (required) | Amount that needs to be refunded Example value:1.000000 |
paymentid int (required) | Id of the payment that needs to be refunded Example value:1 |
Type reference: AddRefunds
Result fields
Field | Description |
---|---|
orderid int | Order ID Example value:1269434 |
amountpaid decimal | Total amount paid Example value:15.000000 |
calculate_ordercosts bool | Whether or not auto / script order fees should be calculated Example value:true |
code string | Order code Used as a unique identifier in web sales. Example value:"864056970700" |
customerid int | Customer ID Example value:1256 |
deferredpaymentproperties map<string, mixed> | Information on the deferred payment scenario. Structure depends on payment method Example value:{ "bankAccount": "BE54719400092697", "bankBic": "FTSBBE22", "bankName": "Stichting Mollie Payments", "transferReference": "+++695/7317/77752+++" } |
deliveryaddress | Address used when delivering physically Example value:{ "city": "Leuven", "street1": "Main street" } |
deliveryscenarioid int | Delivery scenario ID See delivery scenarios for more info. Example value:1 |
deliverystatus int | Delivery status Possible values:
2602 |
expiryhandled bool | Whether the expired order has been handled (and optionally expiry mail has been sent) |
expiryts timestamp | When the order will expire Example value:"2014-09-26 15:24:36" |
firstname string | First name (only with minimal output) Example value:"John" |
hasopenpaymentrequest bool | Indicates of the order has an open payment request with a PSP. Example value:true |
isauthenticatedcustomer bool | Has customer authenticated? |
lastname string | Last name (only with minimal output) Example value:"Doe" |
lookup map<string, mixed> | Related objects See the lookup fields on the getlist operation for a full description. Example value:{ "events": [] } |
nbroftickets int | Number of tickets in the order. Read-only |
ordercosts | Order fees for the order Example value:[ { "orderid": 123, "amount": 5.500000, "servicechargedefinitionid": 12 }, { "orderid": 123, "amount": 2.000000, "servicechargedefinitionid": 13 } ] |
payments Payment[] | Payments for the order Example value:[ { "id": 125, "orderid": 412, "amount": 50.000000, "paidts": "2015-04-07 07:00:00", "paymentmethodid": 2, "properties": null, "refundpaymentid": null } ] |
paymentscenarioid int | Payment scenario ID See payment scenarios for more info. Example value:1 |
paymentstatus int | Payment status Possible values:
|
products | Products in the order Example value:[ { "id": 35539, "orderid": 368, "code": "123412341234", "contactid": null, "price": 15.000000, "productid": 234, "properties": null } ] |
promocodes string[] | Promocodes active for the Order Example value:[ "PROMO2015", "COOLPROMO" ] |
queuetokens int[] | Queue tokens for rate limiting Example value:[ 0, 24 ] |
rappelhandled bool | Whether the overdue order has been handled (and optionally reminder mail has been sent) |
rappelts timestamp | When the reminder mail will be sent Example value:"2014-09-26 15:24:36" |
saleschannelid int | Sales channel ID See sales channels for more info. Example value:1 |
status int | Order status Possible values:
1 |
tickets | Tickets in the order Example value:[ { "id": 35539, "orderid": 368, "price": 15.000000, "servicecharge": 1.000000, "ticketholderid": null, "ticketname": null, "tickettypeid": 111, "tickettypepriceid": 632 }, { "id": 35540, "orderid": 368, "price": 15.000000, "servicecharge": 1.000000, "ticketholderid": null, "ticketname": null, "tickettypeid": 111, "tickettypepriceid": 632 } ] |
totalamount decimal | Total order amount Includes all costs and fees. Example value:25.500000 |
webskinid int | Reference to the webskin that is used for showing the orderdetail page. Example value:1 |
createdts timestamp | Created timestamp Example value:"2014-09-26 15:24:36" |
lastupdatets timestamp | Last updated timestamp Example value:"2014-09-26 15:24:36" |
Type reference: Order