Auth API

All functions related to Auth API

Create a bearer access token

Retrieve a bearer token from your shop using your secret key

$response = $client->authenticate();
$data = json_decode($response->getBody()->getContents())->data;
$client->setBearer($data->token);

Then you can use the $client variable to make requests while being authenticated.

Get a public key

$publicKey = "pk_0000";
$response = $client->getPublicKey($publicKey);
$data = json_decode($response->getBody()->getContents())->data;

if ($data !== null && $data->revoked_at === null) {
    // public key is valid
} else {
    // public key is NOT valid
}