Bulk Refunds
List selected order ids
- POST /fast-events/v1/admin/bulk/refunds/list
Select all order ids that meet the selection conditions for refunding. Only paid orders are included.
Mandatory parameters
- dates
Order was created between
date_from
anddate_to
.- tickets
The number of tickets the order has is between
tickets_minimum
andtickets_maximum
.- amount
The total amount of the order is between
ammount_minimum
andamount_maximum
.- event ids
If the
event_ids
field is empty the selection works across all authorised events. You can specify a selection of events by a comma-separated list of event ids. For example34,56,86
.
Example request
$ curl \ -X POST \ -H "X-FE-API-KEY: 3zo58AUYP9zOE6YT" \ -H "Content-Type: application/json" \ -u "test:4ZAN O5OY OAvZ FZb2 Lslv JnJG" \ -d '{"date_from":"2022-09-01 00:00:00", \ "date_to":"2023-10-07 00:00:00", \ "event_ids":"", \ "tickets_minimum":1, \ "tickets_maximum":100, \ "amount_minimum":1.00, \ "amount_maximum":200.00}' \ https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/list
<?php $ch = curl_init(); $url = 'https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/list'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_USERPWD, 'test:4ZAN O5OY OAvZ FZb2 Lslv JnJG'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'X-FE-API-KEY: 3zo58AUYP9zOE6YT') ); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ "date_from" => "2022-09-01 00:00:00", "date_to" => "2023-10-07 00:00:00", "event_ids" => "", "tickets_minimum" => 1, "tickets_maximum" => 100, "amount_minimum" => 1.00, "amount_maximum" => 200.00 ])); $result = curl_exec($ch); echo $result;
import requests from requests.auth import HTTPBasicAuth URL = 'https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/list' HEADERS = {'X-FE-API-KEY':'3zo58AUYP9zOE6YT'} AUTH = HTTPBasicAuth('test', '4ZAN O5OY OAvZ FZb2 Lslv JnJG') JSON = {'date_from':'2022-09-01 00:00:00', 'date_to':'2023-10-07 00:00:00', 'event_ids':'', 'tickets_minimum':1, 'tickets_maximum':100, 'amount_minimum':1.00, 'amount_maximum':200.00} response = requests.post(URL, headers=HEADERS, auth=AUTH, json=JSON) print(response.json())
Example response
{ "event_ids": "", "date_from": "2022-09-01 00:00:00", "date_to": "2023-10-07 00:00:00", "tickets_minimum": 1, "tickets_maximum": 100, "amount_minimum": 1, "amount_maximum": 200, "amount_maximum": 200, "order_ids": [ 28, 33 ] }
Changelog
Version
Description
2.0
Introduced.
Refund order ids
- POST /fast-events/v1/admin/bulk/refunds/send
Refund all order ids in the
order_ids
array field.An amount can be withheld per order based on the number of tickets times the withholding costs per ticket (
cost
field) or a fixed amount per order (cost
field). In the first case, thecost-type
field must contain the value ticket and in the other case order.The maximum number of order ids in the array cannot exceed the
batch_size
field which is returned as part of thelist
api call.Example request
$ curl \ -X POST \ -H "X-FE-API-KEY: 3zo58AUYP9zOE6YT" \ -H "Content-Type: application/json" \ -u "test:4ZAN O5OY OAvZ FZb2 Lslv JnJG" \ -d '{"order_ids":[1,28,33], \ "cost_type":"order", \ "cost":2.25}' \ https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/send
<?php $ch = curl_init(); $url = 'https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/send'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_USERPWD, 'test:4ZAN O5OY OAvZ FZb2 Lslv JnJG'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'X-FE-API-KEY: 3zo58AUYP9zOE6YT') ); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([ "order_ids" => [1,28,33], "cost_type" => "order", "cost" => 2.25 ])); $result = curl_exec($ch); echo $result;
import requests from requests.auth import HTTPBasicAuth URL = 'https://exampledomain.com/wp-json/fast-events/v1/admin/bulk/refunds/send' HEADERS = {'X-FE-API-KEY':'3zo58AUYP9zOE6YT'} AUTH = HTTPBasicAuth('test', '4ZAN O5OY OAvZ FZb2 Lslv JnJG') JSON = {'order_ids':[1,28,33], 'cost_type':'order', 'cost':2.25} response = requests.post(URL, headers=HEADERS, auth=AUTH, json=JSON) print(response.json())
Example response
{ "errors": [ { "order_id": 1, "error": "Order not found" }, { "order_id": 33, "error": "Order status is not set to 'paid'" }, ] }
Changelog
Version
Description
2.0
Introduced.