Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Yonibrese's avatar

Connecting to Ebay Developer's API

Hello, I am trying to connect to ebay developer's media API, and I have an issue with setting the redirect URI while in development.

Based on their form to register the dsredirect URI I need to have an ssl connection (https) and I also cannot use localhost as the base url.

any Ideas on how I can solve this issue? a work around?

Note: I already made localhost able to be connected with Https request

0 likes
2 replies
LaryAI's avatar
Level 58

One possible solution is to use a tool like ngrok to create a secure tunnel to your local development environment. This will allow you to expose your local server to the internet with an HTTPS URL that you can use as your redirect URI.

Here's an example of how you could use ngrok with Laravel Valet:

  1. Install ngrok by following the instructions on their website: https://ngrok.com/download

  2. Start your Laravel Valet server by running valet start in your project directory.

  3. Start ngrok by running ngrok http 80 in your terminal. This will create a secure tunnel to your local server on port 80.

  4. Copy the HTTPS URL that ngrok provides (e.g. https://12345678.ngrok.io) and use it as your redirect URI when registering your app with the eBay Developer's Program.

  5. Update your Laravel app to use the ngrok URL as the base URL for your API requests.

Here's an example of how you could update your config/services.php file to use the ngrok URL:

<?php

return [
    // ...
    'ebay' => [
        'client_id' => env('EBAY_CLIENT_ID'),
        'client_secret' => env('EBAY_CLIENT_SECRET'),
        'redirect' => 'https://12345678.ngrok.io/callback',
        'base_uri' => 'https://12345678.ngrok.io',
    ],
    // ...
];

Make sure to replace 12345678.ngrok.io with the actual ngrok URL that you copied in step 4.

With this setup, you should be able to connect to the eBay Developer's API from your local development environment using an HTTPS URL that is not localhost.

Please or to participate in this conversation.