v2 is generally available. See what changed
Skip to content
Acme Commerce API Menu

Retrieve a product

GET /api/v2/products/{product} v2

No authentication required.

Full URL: https://api.acme.example/api/v2/products/{product}

Path parameters

Name Type Required Description
product integer yes The product id.

Responses

200 The product.

404 No product with that id.

Example request

cURL
curl -X GET 'https://api.acme.example/api/v2/products/1' \
  -H 'Accept: application/json'
JavaScript
const response = await fetch('https://api.acme.example/api/v2/products/1', {
  method: 'GET',
  headers: {
    'Accept': 'application/json'
  }
});

const data = await response.json();
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Accept' => 'application/json',
])->get('https://api.acme.example/api/v2/products/1');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('GET', 'https://api.acme.example/api/v2/products/1', [
    'headers' => [
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);

Free while you are building.

Get an API key

This page as Markdown, or the whole API as OpenAPI. Ask ChatGPT Ask Claude