- list - List all merchant accounts
- create - Create a merchant account
- get - Get a merchant account
- update - Update a merchant account
List all merchant accounts in an instance.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$responses = $sdk->merchantAccounts->list(
cursor: 'ZXhhbXBsZTE',
limit: 20,
search: 'merchant-12345'
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
| Parameter |
Type |
Required |
Description |
Example |
cursor |
?string |
➖ |
A pointer to the page of results to return. |
ZXhhbXBsZTE |
limit |
?int |
➖ |
The maximum number of items that are at returned. |
20 |
search |
?string |
➖ |
The search term to filter merchant accounts by. |
merchant-12345 |
?ListMerchantAccountsResponse
| 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 merchant account in an instance.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$request = new Gr4vy\MerchantAccountCreate(
accountUpdaterEnabled: true,
asyncNetworkTokensEnabled: true,
id: 'merchant-12345',
displayName: 'Example',
);
$response = $sdk->merchantAccounts->create(
request: $request
);
if ($response->merchantAccount !== null) {
// handle response
}
?CreateMerchantAccountResponse
| 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 |
*/* |
Get info about a merchant account in an instance.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->merchantAccounts->get(
merchantAccountId: 'merchant-12345'
);
if ($response->merchantAccount !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
merchantAccountId |
string |
✔️ |
The ID of the merchant account. |
merchant-12345 |
?GetMerchantAccountResponse
| 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 |
*/* |
Update info for a merchant account in an instance.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$merchantAccountUpdate = new Gr4vy\MerchantAccountUpdate(
accountUpdaterEnabled: true,
asyncNetworkTokensEnabled: true,
);
$response = $sdk->merchantAccounts->update(
merchantAccountId: 'merchant-12345',
merchantAccountUpdate: $merchantAccountUpdate
);
if ($response->merchantAccount !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
merchantAccountId |
string |
✔️ |
The ID of the merchant account. |
merchant-12345 |
merchantAccountUpdate |
MerchantAccountUpdate |
✔️ |
N/A |
|
?UpdateMerchantAccountResponse
| 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 |
*/* |