GET
/api/v2/orders/{order}
Requires authentication
v2
Send a bearer token in the Authorization header.
Full URL: https://api.acme.example/api/v2/orders/{order}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| order | integer | yes | The order id. |
Responses
200 The order.
| Field | Type | Description |
|---|---|---|
| data | object | |
| data.id | integer | |
| data.customer_id | integer | |
| data.status | string, one of pending, paid, shipped, refunded | |
| data.total | integer | |
| data.currency | string | |
| data.items | array | |
| data.items[].product_id | integer | |
| data.items[].quantity | integer | |
| data.items[].unit_price | integer | |
| data.placed_at | string<date-time> | |
| data.refunded_at | string<date-time>, nullable |
404 No order with that id.
Example request
curl -X GET 'https://api.acme.example/api/v2/orders/1' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json'
const response = await fetch('https://api.acme.example/api/v2/orders/1', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
});
const data = await response.json();
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_TOKEN',
'Accept' => 'application/json',
])->get('https://api.acme.example/api/v2/orders/1');
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.acme.example/api/v2/orders/1', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Accept' => 'application/json',
],
]);
$data = json_decode((string) $response->getBody(), true);