Every call of the SDK
PHPThe entry point of each SDK, its modules and every call they offer, with the request of the API each call makes, the scope it needs and the idempotency key it carries.
Everything the SDK does goes through one entry point, built once with its options. This page shows how the calls hang off it and lists every call of the SDK in the language you read it in, with the request each one sends to the API.
The entry point and its modules
The entry point is SlenSdk, built by SlenSdk::create() over a SlenConfig. Each module is a method that returns it — operations(), executions(), customers() and webhooks() — and health() belongs to the SDK itself. WebhooksFacade::standalone() builds the webhooks module alone over its WebhooksOptions, for a receiver that has no API key. withLogger() returns a copy of the SDK that writes its journal to another logger — Logging. In Laravel the Slen facade calls the same SDK — Laravel integration.
Configuration lists the options the SDK is built with.
Every call
| Method | HTTP request | Scope | Idempotency-Key |
|---|---|---|---|
customers()->adjustadjust(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTO | POST /v1/customers/{externalUserId}/adjust | customers:write | Sent; the SDK makes one unless you pass your own |
customers()->blockblock(string $externalUserId, ?Slen\Sdk\Modules\Customers\Options\BlockOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTO | POST /v1/customers/{externalUserId}/block | customers:write | — |
customers()->chargecharge(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTO | POST /v1/customers/{externalUserId}/charge | customers:write | Sent; the SDK makes one unless you pass your own |
customers()->createcreate(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTO | PUT /v1/customers/{externalUserId} | customers:write | — |
customers()->deletedelete(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): void | DELETE /v1/customers/{externalUserId} | customers:write | — |
customers()->entriesentries(string $externalUserId, ?Slen\Sdk\Modules\Customers\Options\EntryListOptions $options = null): Slen\Sdk\Modules\Customers\Data\CreditEntryPageDTO | GET /v1/customers/{externalUserId}/entries | customers:read | — |
customers()->getget(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTO | GET /v1/customers/{externalUserId} | customers:read | — |
customers()->listlist(?Slen\Sdk\Modules\Customers\Options\CustomerListOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerPageDTO | GET /v1/customers | customers:read | — |
customers()->pricesprices(?Slen\Sdk\Modules\Customers\Options\PriceListOptions $options = null): array | GET /v1/credit-prices | customers:read | — |
customers()->topUptopUp(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTO | POST /v1/customers/{externalUserId}/topup | customers:write | Sent; the SDK makes one unless you pass your own |
customers()->unblockunblock(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTO | POST /v1/customers/{externalUserId}/unblock | customers:write | — |
customers()->updateAccountupdateAccount(string $externalUserId, string $creditType, ?Slen\Sdk\Modules\Customers\Options\AccountOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTO | PUT /v1/customers/{externalUserId}/accounts/{creditType} | customers:write | — |
executions()->getget(string $executionId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionStatusDTO | GET /v1/executions/{id}/status | read | — |
executions()->tracetrace(string $executionId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionTraceDTO | GET /v1/executions/{id} | read | — |
executions()->waitwait(string $executionId, ?Slen\Sdk\Modules\Executions\Options\WaitOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionStatusDTO | GET /v1/executions/{id}/status | read | — |
healthhealth(?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Data\HealthDTO | GET /health | — | — |
operations()->executeexecute(string $operation, array $input, ?Slen\Sdk\Modules\Operations\Options\ExecuteOptions $options = null): Slen\Sdk\Modules\Operations\Data\ExecutionDTO | POST /v1/operations/execute | gateway:write | Sent; the SDK makes one unless you pass your own |
operations()->executeAsyncexecuteAsync(string $operation, array $input, ?Slen\Sdk\Modules\Operations\Options\ExecuteOptions $options = null): Slen\Sdk\Modules\Operations\Data\ExecutionDTO | POST /v1/operations/execute | gateway:write | Sent; the SDK makes one unless you pass your own |
webhooks()->constructEventconstructEvent(string $payload, ?string $signatureHeader, ?Slen\Sdk\Modules\Webhooks\Options\VerifyOptions $options = null): Slen\Sdk\Modules\Webhooks\Data\WebhookEventDTO | No request to the API | — | — |
webhooks()->verifyverify(string $payload, ?string $signatureHeader, ?Slen\Sdk\Modules\Webhooks\Options\VerifyOptions $options = null): bool | No request to the API | — | — |
HTTP request is the operation of the API the call sends, with a link to its page in the API section. A call without a request works inside the SDK: the two calls of the webhooks check a delivery where it arrived.
Scope is the permission the API key needs for that request. Authentication says what each scope includes.
Idempotency-Key says whether the request carries the header. Such a call makes a key when you pass none, and sends yours when you do: Idempotency keys says when to pass your own.
What the calls are for:
operations.execute()andoperations.executeAsync()run a flow — Send a request, Async runs and waiting.executions.get(),executions.wait()andexecutions.trace()read an execution — Async runs and waiting.The calls of
customerskeep your customers and their credits — Customers and credits.webhooks.verify()andwebhooks.constructEvent()check a delivery of a webhook — Webhooks.health()reads whether the API serves. A dependency that is down is named in the body of the answer, not in its status.
Every call may be sent again by the SDK after no answer, a 429 or a 503 — Retries and timeouts. A call that fails raises an error of a type the code of the answer decides — Handling errors. The errors the SDK raises itself, without an answer of the API, are listed in Error types.
Where to go next
Result objects — what each call returns.
PHP and Node.js — the two SDKs side by side.
Configuration — the options of the SDK.
Built from openapi b070e1f, sdk contract 6a2e0e0, php 4089db3, node 0fa87be