Search routes

Search major documentation and API reference routes.

Developer Tools

Expose Endpoint

Use VS Code to expose a local callback endpoint so AfroPays can send callbacks to your development machine.

Why Expose a Local Endpoint?

Localhost is not reachable by AfroPays. During development, you need a public HTTPS URL that forwards requests back to your local server.

Development-only setup

Exposed local URLs are best for testing and debugging callbacks. For production, always use your real public backend endpoint.

Expose It with VS Code

  1. 1

    Run Your Local App

    Start the application that contains your callback route, for example a local Next.js or backend server running on port 3000.

  2. 2

    Open the Ports View in VS Code

    In VS Code, open the Command Palette and run the Ports view command, or open the Ports panel directly if it is already visible.

  3. 3

    Forward the Local Port

    Forward the port your app is listening on, such as 3000, and allow VS Code to generate a reachable URL for that service.

    Right click on the forwared port go to visibility change to public.

    If VS Code prompts for visibility or sharing options, choose the option that allows AfroPays to reach the forwarded URL.

  4. 4

    Copy the Forwarded HTTPS URL

    Copy the public HTTPS URL created by VS Code and append your callback route path to it.

  5. 5

    Use the Exposed URL as callbackUrl

    Use the forwarded URL in your AfroPays transaction request so callbacks can reach your local machine during development.

Example callbackUrl

After forwarding the local port, use the generated HTTPS URL as your callback destination.

https://your-forwarded-url.example.dev/api/payments/callback