1 /**
2 * @oas [get] /admin/customers/{id}
3 * operationId: GetCustomersId
4 * summary: Get a Customer
5 * description: Retrieve a customer by its ID. You can expand the customer's relations or select the fields that should be returned.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The customer's ID.
11 * required: true
12 * schema:
13 * type: string
14 * - name: fields
15 * in: query
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom
18 * Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation.
19 * required: false
20 * schema:
21 * type: string
22 * title: fields
23 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
24 * fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom
25 * Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation.
26 * externalDocs:
27 * url: "#select-fields-and-relations"
28 * security:
29 * - api_token: []
30 * - cookie_auth: []
31 * - jwt_token: []
32 * x-codeSamples:
33 * - lang: JavaScript
34 * label: JS SDK
35 * source: |-
36 * import Medusa from "@medusajs/js-sdk"
37 *
38 * export const sdk = new Medusa({
39 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
40 * debug: import.meta.env.DEV,
41 * auth: {
42 * type: "session",
43 * },
44 * })
45 *
46 * sdk.admin.customer.retrieve("cus_123")
47 * .then(({ customer }) => {
48 * console.log(customer)
49 * })
50 * - lang: Shell
51 * label: cURL
52 * source: |-
53 * curl '{backend_url}/admin/customers/{id}' \
54 * -H 'Authorization: Bearer {jwt_token}'
55 * tags:
56 * - Customers
57 * responses:
58 * "200":
59 * description: OK
60 * content:
61 * application/json:
62 * schema:
63 * $ref: "#/components/schemas/AdminCustomerResponse"
64 * "400":
65 * $ref: "#/components/responses/400_error"
66 * "401":
67 * $ref: "#/components/responses/unauthorized"
68 * "404":
69 * $ref: "#/components/responses/not_found_error"
70 * "409":
71 * $ref: "#/components/responses/invalid_state_error"
72 * "422":
73 * $ref: "#/components/responses/invalid_request_error"
74 * "500":
75 * $ref: "#/components/responses/500_error"
76 *
77 */
78