Skip to content

Latest commit

 

History

History
548 lines (367 loc) · 19.3 KB

README.md

File metadata and controls

548 lines (367 loc) · 19.3 KB

V1

Overview

Available Operations

createClient

Create client

Example Usage

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\CreateClientRequest(
        name: '<value>',
    );
    $response = $sdk->authV1->createClient($request);

    if ($response->createClientResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Shared\CreateClientRequest ✔️ The request object to use for the request.

Response

?Operations\CreateClientResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

createSecret

Add a secret to a client

Example Usage

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\CreateSecretRequest(
        clientId: '<value>',
    );
    $response = $sdk->authV1->createSecret($request);

    if ($response->createSecretResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\CreateSecretRequest ✔️ The request object to use for the request.

Response

?Operations\CreateSecretResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

deleteClient

Delete client

Example Usage

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\DeleteClientRequest(
        clientId: '<value>',
    );
    $response = $sdk->authV1->deleteClient($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\DeleteClientRequest ✔️ The request object to use for the request.

Response

?Operations\DeleteClientResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

deleteSecret

Delete a secret from a client

Example Usage

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\DeleteSecretRequest(
        clientId: '<value>',
        secretId: '<value>',
    );
    $response = $sdk->authV1->deleteSecret($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\DeleteSecretRequest ✔️ The request object to use for the request.

Response

?Operations\DeleteSecretResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

getOIDCWellKnowns

Retrieve OpenID connect well-knowns.

Example Usage

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 {
    $response = $sdk->authV1->getOIDCWellKnowns();

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\GetOIDCWellKnownsResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

getServerInfo

Get server info

Example Usage

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 {
    $response = $sdk->authV1->getServerInfo();

    if ($response->serverInfo !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\GetServerInfoResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

listClients

List clients

Example Usage

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 {
    $response = $sdk->authV1->listClients();

    if ($response->listClientsResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\ListClientsResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

listUsers

List users

Example Usage

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 {
    $response = $sdk->authV1->listUsers();

    if ($response->listUsersResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\ListUsersResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

readClient

Read client

Example Usage

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\ReadClientRequest(
        clientId: '<value>',
    );
    $response = $sdk->authV1->readClient($request);

    if ($response->readClientResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\ReadClientRequest ✔️ The request object to use for the request.

Response

?Operations\ReadClientResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

readUser

Read user

Example Usage

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\ReadUserRequest(
        userId: '<value>',
    );
    $response = $sdk->authV1->readUser($request);

    if ($response->readUserResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\ReadUserRequest ✔️ The request object to use for the request.

Response

?Operations\ReadUserResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /

updateClient

Update client

Example Usage

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\UpdateClientRequest(
        clientId: '<value>',
    );
    $response = $sdk->authV1->updateClient($request);

    if ($response->updateClientResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

Parameter Type Required Description
$request Operations\UpdateClientRequest ✔️ The request object to use for the request.

Response

?Operations\UpdateClientResponse

Errors

Error Object Status Code Content Type
formance\stack\Models\Errors.SDKException 4xx-5xx /