Skip to content

Latest commit

 

History

History
205 lines (150 loc) · 9.89 KB

File metadata and controls

205 lines (150 loc) · 9.89 KB

Payouts

Overview

Available Operations

  • list - List payouts created
  • create - Create a payout
  • get - Get a payout

list

Returns a list of payouts made.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$responses = $sdk->payouts->list(
    cursor: 'ZXhhbXBsZTE',
    limit: 20

);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

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
merchantAccountId ?string The ID of the merchant account to use for this request. default

Response

?ListPayoutsResponse

Errors

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

Creates a new payout.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$payoutCreate = new Gr4vy\PayoutCreate(
    amount: 1299,
    currency: 'EUR',
    paymentServiceId: 'ed8bd87d-85ad-40cf-8e8f-007e21e55aad',
    paymentMethod: new Gr4vy\PaymentMethodStoredCard(
        id: '852b951c-d7ea-4c98-b09e-4a1c9e97c077',
    ),
);

$response = $sdk->payouts->create(
    payoutCreate: $payoutCreate
);

if ($response->payoutSummary !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
payoutCreate PayoutCreate ✔️ N/A
merchantAccountId ?string The ID of the merchant account to use for this request. default

Response

?CreatePayoutResponse

Errors

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

Retrieves a payout.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Gr4vy;

$sdk = Gr4vy\SDK::builder()
    ->setMerchantAccountId('default')
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();



$response = $sdk->payouts->get(
    payoutId: '4344fef2-bc2f-49a6-924f-343e62f67224'
);

if ($response->payoutSummary !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
payoutId string ✔️ N/A
merchantAccountId ?string The ID of the merchant account to use for this request. default

Response

?GetPayoutResponse

Errors

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 */*