- list - List configured reports
- create - Add a report
- get - Get a report
- put - Update a report
List all configured reports that can be generated.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Gr4vy\ListReportsRequest();
$responses = $sdk->reports->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
?ListReportsResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Create a new report.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$reportCreate = new Gr4vy\ReportCreate(
name: 'Monthly Transaction Report',
schedule: '<value>',
scheduleEnabled: true,
scheduleTimezone: 'UTC',
spec: new Gr4vy\DetailedSettlementReportSpec(
params: [
'filters' => [
'ingested_at' => [
'end' => 'day_end',
'start' => 'day_start',
],
],
],
),
);
$response = $sdk->reports->create(
reportCreate: $reportCreate
);
if ($response->report !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
reportCreate |
ReportCreate |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?AddReportResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Fetches a report by its ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->reports->get(
reportId: '4d4c7123-b794-4fad-b1b9-5ab2606e6bbe'
);
if ($response->report !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
reportId |
string |
✔️ |
The ID of the report to retrieve details for. |
4d4c7123-b794-4fad-b1b9-5ab2606e6bbe |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?GetReportResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |
Updates the configuration of a report.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$reportUpdate = new Gr4vy\ReportUpdate();
$response = $sdk->reports->put(
reportId: '4d4c7123-b794-4fad-b1b9-5ab2606e6bbe',
reportUpdate: $reportUpdate
);
if ($response->report !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
reportId |
string |
✔️ |
The ID of the report to edit. |
4d4c7123-b794-4fad-b1b9-5ab2606e6bbe |
reportUpdate |
ReportUpdate |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?UpdateReportResponse
| Error Type |
Status Code |
Content Type |
| Errors\Error400 |
400 |
application/json |
| Errors\Error401 |
401 |
application/json |
| Errors\Error403 |
403 |
application/json |
| Errors\Error404 |
404 |
application/json |
| Errors\Error405 |
405 |
application/json |
| Errors\Error409 |
409 |
application/json |
| Errors\HTTPValidationError |
422 |
application/json |
| Errors\Error425 |
425 |
application/json |
| Errors\Error429 |
429 |
application/json |
| Errors\Error500 |
500 |
application/json |
| Errors\Error502 |
502 |
application/json |
| Errors\Error504 |
504 |
application/json |
| errors\APIException |
4XX, 5XX |
*/* |