protected function getUri(string $endpoint, array $parameters = []): Uri
    {
        Assert::keyExists(self::ENDPOINTS, $endpoint, "Named endpoint {$endpoint} is unknown.");

        $uri = $this->sandbox ? self::SANDBOX_URL : self::PRODUCTION_URL;
        $uri .= self::ENDPOINTS[$endpoint];

        if ($parameters) {
            $uri .= '?' . http_build_query($parameters);
        }

        return new Uri($uri);
    }