Every call of the SDK

PHP

The 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

MethodHTTP requestScopeIdempotency-Key
customers()->adjustadjust(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTOPOST /v1/customers/{externalUserId}/adjustcustomers:writeSent; 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\CustomerDTOPOST /v1/customers/{externalUserId}/blockcustomers:write—
customers()->chargecharge(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTOPOST /v1/customers/{externalUserId}/chargecustomers:writeSent; the SDK makes one unless you pass your own
customers()->createcreate(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTOPUT /v1/customers/{externalUserId}customers:write—
customers()->deletedelete(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): voidDELETE /v1/customers/{externalUserId}customers:write—
customers()->entriesentries(string $externalUserId, ?Slen\Sdk\Modules\Customers\Options\EntryListOptions $options = null): Slen\Sdk\Modules\Customers\Data\CreditEntryPageDTOGET /v1/customers/{externalUserId}/entriescustomers:read—
customers()->getget(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTOGET /v1/customers/{externalUserId}customers:read—
customers()->listlist(?Slen\Sdk\Modules\Customers\Options\CustomerListOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerPageDTOGET /v1/customerscustomers:read—
customers()->pricesprices(?Slen\Sdk\Modules\Customers\Options\PriceListOptions $options = null): arrayGET /v1/credit-pricescustomers:read—
customers()->topUptopUp(string $externalUserId, string $credits, ?Slen\Sdk\Modules\Customers\Options\MovementOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTOPOST /v1/customers/{externalUserId}/topupcustomers:writeSent; the SDK makes one unless you pass your own
customers()->unblockunblock(string $externalUserId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerDTOPOST /v1/customers/{externalUserId}/unblockcustomers:write—
customers()->updateAccountupdateAccount(string $externalUserId, string $creditType, ?Slen\Sdk\Modules\Customers\Options\AccountOptions $options = null): Slen\Sdk\Modules\Customers\Data\CustomerAccountDTOPUT /v1/customers/{externalUserId}/accounts/{creditType}customers:write—
executions()->getget(string $executionId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionStatusDTOGET /v1/executions/{id}/statusread—
executions()->tracetrace(string $executionId, ?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionTraceDTOGET /v1/executions/{id}read—
executions()->waitwait(string $executionId, ?Slen\Sdk\Modules\Executions\Options\WaitOptions $options = null): Slen\Sdk\Modules\Executions\Data\ExecutionStatusDTOGET /v1/executions/{id}/statusread—
healthhealth(?Slen\Sdk\RequestOptions $options = null): Slen\Sdk\Data\HealthDTOGET /health——
operations()->executeexecute(string $operation, array $input, ?Slen\Sdk\Modules\Operations\Options\ExecuteOptions $options = null): Slen\Sdk\Modules\Operations\Data\ExecutionDTOPOST /v1/operations/executegateway:writeSent; 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\ExecutionDTOPOST /v1/operations/executegateway:writeSent; 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\WebhookEventDTONo request to the API——
webhooks()->verifyverify(string $payload, ?string $signatureHeader, ?Slen\Sdk\Modules\Webhooks\Options\VerifyOptions $options = null): boolNo 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() and operations.executeAsync() run a flow — Send a request, Async runs and waiting.

  • executions.get(), executions.wait() and executions.trace() read an execution — Async runs and waiting.

  • The calls of customers keep your customers and their credits — Customers and credits.

  • webhooks.verify() and webhooks.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

Built from openapi b070e1f, sdk contract 6a2e0e0, php 4089db3, node 0fa87be