chengkun
2025-09-09 774d962b76d63366ed26c395e0a33cdbec309242
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/**
* This class is autogenerated by the Spapi class generator
* Date of generation: 2022-05-26
* Specification: https://github.com/amzn/selling-partner-api-models/blob/main/models/finances-api-model/financesV0.json
* Source MD5 signature: f81d62176ea29d6b0ac326203b931bb8
*
*
* Selling Partner API for Finances
* The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range.
*/
namespace DoubleBreak\Spapi\Api;
use DoubleBreak\Spapi\Client;
 
class Finances extends Client {
 
  /**
  * Operation listFinancialEventGroups
  *
  * @param array $queryParams
  *    - *maxResultsPerPage* integer - The maximum number of results to return per page.
  *    - *financialEventGroupStartedBefore* string - A date used for selecting financial event groups that opened before (but not at) a specified date and time, in ISO 8601 format. The date-time  must be later than FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no financial event groups are returned.
  *    - *financialEventGroupStartedAfter* string - A date used for selecting financial event groups that opened after (or at) a specified date and time, in ISO 8601 format. The date-time must be no later than two minutes before the request was submitted.
  *    - *nextToken* string - A string token returned in the response of your previous request.
  *
  */
  public function listFinancialEventGroups($queryParams = [])
  {
    return $this->send("/finances/v0/financialEventGroups", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function listFinancialEventGroupsAsync($queryParams = [])
  {
    return $this->sendAsync("/finances/v0/financialEventGroups", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation listFinancialEventsByGroupId
  *
  * @param string $eventGroupId The identifier of the financial event group to which the events belong.
  *
  * @param array $queryParams
  *    - *maxResultsPerPage* integer - The maximum number of results to return per page.
  *    - *nextToken* string - A string token returned in the response of your previous request.
  *
  */
  public function listFinancialEventsByGroupId($eventGroupId, $queryParams = [])
  {
    return $this->send("/finances/v0/financialEventGroups/{$eventGroupId}/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function listFinancialEventsByGroupIdAsync($eventGroupId, $queryParams = [])
  {
    return $this->sendAsync("/finances/v0/financialEventGroups/{$eventGroupId}/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation listFinancialEventsByOrderId
  *
  * @param string $orderId An Amazon-defined order identifier, in 3-7-7 format.
  *
  * @param array $queryParams
  *    - *maxResultsPerPage* integer - The maximum number of results to return per page.
  *    - *nextToken* string - A string token returned in the response of your previous request.
  *
  */
  public function listFinancialEventsByOrderId($orderId, $queryParams = [])
  {
    return $this->send("/finances/v0/orders/{$orderId}/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function listFinancialEventsByOrderIdAsync($orderId, $queryParams = [])
  {
    return $this->sendAsync("/finances/v0/orders/{$orderId}/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation listFinancialEvents
  *
  * @param array $queryParams
  *    - *maxResultsPerPage* integer - The maximum number of results to return per page.
  *    - *postedAfter* string - A date used for selecting financial events posted after (or at) a specified time. The date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format.
  *    - *postedBefore* string - A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.
  *    - *nextToken* string - A string token returned in the response of your previous request.
  *
  */
  public function listFinancialEvents($queryParams = [])
  {
    return $this->send("/finances/v0/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function listFinancialEventsAsync($queryParams = [])
  {
    return $this->sendAsync("/finances/v0/financialEvents", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
}