> For the complete documentation index, see [llms.txt](https://docs.claret.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.claret.app/api-reference/reference-and-master-data/get-a-single-resource-by-id-11.md).

# Get a single resource by ID

Parameter order matches route binding: `{id}` is a URL segment (comes first), `resource` is a route default (appended after URL params). Swapping the order to `(int $id, string $resource)` ensures Laravel's positional dispatch aligns with the reflection parameter list after the FormRequest is injected.

```json
{"openapi":"3.1.0","info":{"title":"Claret","version":"1.0.0"},"tags":[{"name":"Reference & Master Data","description":"Read-only master data: items, units of measure, calendars, locations, customer groups, and other configuration."}],"servers":[{"url":"https://plan.claret.app/{tenant}/api/v1","description":"Production","variables":{"tenant":{"default":"your-tenant","description":"Your Claret tenant identifier (the slug in your Claret URL)."}}}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/hierarchy-types/{id}":{"get":{"operationId":"tenant.public.hierarchy_types.show","description":"Parameter order matches route binding: `{id}` is a URL segment (comes first),\n`resource` is a route default (appended after URL params). Swapping the order\nto `(int $id, string $resource)` ensures Laravel's positional dispatch aligns\nwith the reflection parameter list after the FormRequest is injected.","summary":"Get a single resource by ID","tags":["Reference & Master Data"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"include","in":"query","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"404":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/404"},"title":{"type":"string","const":"Not Found"},"status":{"type":"integer","const":404},"detail":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}},"422":{"$ref":"#/components/responses/ValidationException"},"500":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/500"},"title":{"type":"string","const":"Server Error"},"status":{"type":"integer","const":500},"detail":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}}}}}}}
```
