- activateConfig - Activate one config
- changeConfigSecret - Change the signing secret of a config
- deactivateConfig - Deactivate one config
- deleteConfig - Delete one config
- getManyConfigs - Get many configs
- insertConfig - Insert a new config
- testConfig - Test one config
Activate a webhooks config by ID, to start receiving webhooks to its endpoint.
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\ActivateConfigRequest(
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
);
$response = $sdk->webhooksV1->activateConfig($request);
if ($response->configResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\ActivateConfigRequest | ✔️ | The request object to use for the request. |
?Operations\ActivateConfigResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Change the signing secret of the endpoint of a webhooks config.
If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\ChangeConfigSecretRequest(
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
configChangeSecret: new Shared\ConfigChangeSecret(
secret: 'V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
),
);
$response = $sdk->webhooksV1->changeConfigSecret($request);
if ($response->configResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\ChangeConfigSecretRequest | ✔️ | The request object to use for the request. |
?Operations\ChangeConfigSecretResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\DeactivateConfigRequest(
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
);
$response = $sdk->webhooksV1->deactivateConfig($request);
if ($response->configResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\DeactivateConfigRequest | ✔️ | The request object to use for the request. |
?Operations\DeactivateConfigResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Delete a webhooks config by ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\DeleteConfigRequest(
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
);
$response = $sdk->webhooksV1->deleteConfig($request);
if ($response->statusCode === 200) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\DeleteConfigRequest | ✔️ | The request object to use for the request. |
?Operations\DeleteConfigResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Sorted by updated date descending
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\GetManyConfigsRequest(
endpoint: 'https://example.com',
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
);
$response = $sdk->webhooksV1->getManyConfigs($request);
if ($response->configsResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\GetManyConfigsRequest | ✔️ | The request object to use for the request. |
?Operations\GetManyConfigsResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Insert a new webhooks config.
The endpoint should be a valid https URL and be unique.
The secret is the endpoint's verification secret. If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)
All eventTypes are converted to lower-case when inserted.
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Shared\ConfigUser(
endpoint: 'https://example.com',
eventTypes: [
'TYPE1',
'TYPE2',
],
name: 'customer_payment',
secret: 'V0bivxRWveaoz08afqjU6Ko/jwO0Cb+3',
);
$response = $sdk->webhooksV1->insertConfig($request);
if ($response->configResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Shared\ConfigUser | ✔️ | The request object to use for the request. |
?Operations\InsertConfigResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |
Test a config by sending a webhook to its endpoint.
declare(strict_types=1);
require 'vendor/autoload.php';
use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;
$security = new Shared\Security(
authorization: "<YOUR_AUTHORIZATION_HERE>",
);
$sdk = stack\SDK::builder()->setSecurity($security)->build();
try {
$request = new Operations\TestConfigRequest(
id: '4997257d-dfb6-445b-929c-cbe2ab182818',
);
$response = $sdk->webhooksV1->testConfig($request);
if ($response->attemptResponse !== null) {
// handle response
}
} catch (Throwable $e) {
// handle exception
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\TestConfigRequest | ✔️ | The request object to use for the request. |
?Operations\TestConfigResponse
Error Object | Status Code | Content Type |
---|---|---|
Errors\WebhooksErrorResponse | default | application/json |
formance\stack\Models\Errors.SDKException | 4xx-5xx | / |