- create - Add a payment link
- list - List all payment links
- expire - Expire a payment link
- get - Get payment link
Create a new payment link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$paymentLinkCreate = new Gr4vy\PaymentLinkCreate(
amount: 1299,
country: 'DE',
currency: 'EUR',
store: true,
);
$response = $sdk->paymentLinks->create(
paymentLinkCreate: $paymentLinkCreate
);
if ($response->paymentLink !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentLinkCreate |
PaymentLinkCreate |
✔️ |
N/A |
|
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?AddPaymentLinkResponse
| 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 |
*/* |
List all created payment links.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$responses = $sdk->paymentLinks->list(
limit: 20
);
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 returned. |
20 |
buyerSearch |
array<string> |
➖ |
Filters the results to only get the items for which some of the buyer data contains exactly the provided buyer_search values. |
[ "John", "London" ] |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?ListPaymentLinksResponse
| 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 |
*/* |
Expire an existing payment link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->paymentLinks->expire(
paymentLinkId: 'a1b2c3d4-5678-90ab-cdef-1234567890ab'
);
if ($response->statusCode === 200) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentLinkId |
string |
✔️ |
The unique identifier for the payment link. |
a1b2c3d4-5678-90ab-cdef-1234567890ab |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?ExpirePaymentLinkResponse
| 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 |
*/* |
Fetch the details for a payment link.
declare(strict_types=1);
require 'vendor/autoload.php';
use Gr4vy;
$sdk = Gr4vy\SDK::builder()
->setMerchantAccountId('default')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->paymentLinks->get(
paymentLinkId: 'a1b2c3d4-5678-90ab-cdef-1234567890ab'
);
if ($response->paymentLink !== null) {
// handle response
}
| Parameter |
Type |
Required |
Description |
Example |
paymentLinkId |
string |
✔️ |
The unique identifier for the payment link. |
a1b2c3d4-5678-90ab-cdef-1234567890ab |
merchantAccountId |
?string |
➖ |
The ID of the merchant account to use for this request. |
default |
?GetPaymentLinkResponse
| 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 |
*/* |