1 /**
2 * @oas [get] /admin/stores
3 * operationId: GetStores
4 * summary: List Stores
5 * description: Retrieve a list of stores. The stores can be filtered by fields such as `id`. The stores can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * 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
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
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.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * - name: offset
21 * in: query
22 * description: The number of items to skip when retrieving a list.
23 * required: false
24 * schema:
25 * type: number
26 * title: offset
27 * description: The number of items to skip when retrieving a list.
28 * externalDocs:
29 * url: "#pagination"
30 * - name: limit
31 * in: query
32 * description: Limit the number of items returned in the list.
33 * required: false
34 * schema:
35 * type: number
36 * title: limit
37 * description: Limit the number of items returned in the list.
38 * externalDocs:
39 * url: "#pagination"
40 * - name: order
41 * in: query
42 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
43 * required: false
44 * schema:
45 * type: string
46 * title: order
47 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
48 * - name: q
49 * in: query
50 * description: Search term to filter the store's searchable properties.
51 * required: false
52 * schema:
53 * type: string
54 * title: q
55 * description: Search term to filter the store's searchable properties.
56 * - name: id
57 * in: query
58 * required: false
59 * schema:
60 * oneOf:
61 * - type: string
62 * title: id
63 * description: Filter by a store ID.
64 * - type: array
65 * description: Filter by store IDs.
66 * items:
67 * type: string
68 * title: id
69 * description: A store ID.
70 * - name: name
71 * in: query
72 * required: false
73 * schema:
74 * oneOf:
75 * - type: string
76 * title: name
77 * description: Filter by a store name.
78 * - type: array
79 * description: Filter by store names.
80 * items:
81 * type: string
82 * title: name
83 * description: A store name.
84 * - name: $and
85 * in: query
86 * required: false
87 * schema:
88 * type: array
89 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
90 * items:
91 * type: object
92 * title: $and
93 * - name: $or
94 * in: query
95 * required: false
96 * schema:
97 * type: array
98 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
99 * items:
100 * type: object
101 * title: $or
102 * - name: with_deleted
103 * in: query
104 * description: Whether to include deleted records in the result.
105 * required: false
106 * schema:
107 * type: boolean
108 * title: with_deleted
109 * description: Whether to include deleted records in the result.
110 * security:
111 * - api_token: []
112 * - cookie_auth: []
113 * - jwt_token: []
114 * x-codeSamples:
115 * - lang: JavaScript
116 * label: JS SDK
117 * source: |-
118 * import Medusa from "@medusajs/js-sdk"
119 *
120 * export const sdk = new Medusa({
121 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
122 * debug: import.meta.env.DEV,
123 * auth: {
124 * type: "session",
125 * },
126 * })
127 *
128 * sdk.admin.store.list()
129 * .then(({ stores, count, limit, offset }) => {
130 * console.log(stores)
131 * })
132 * - lang: Shell
133 * label: cURL
134 * source: |-
135 * curl '{backend_url}/admin/stores' \
136 * -H 'Authorization: Bearer {jwt_token}'
137 * tags:
138 * - Stores
139 * responses:
140 * "200":
141 * description: OK
142 * content:
143 * application/json:
144 * schema:
145 * $ref: "#/components/schemas/AdminStoreListResponse"
146 * "400":
147 * $ref: "#/components/responses/400_error"
148 * "401":
149 * $ref: "#/components/responses/unauthorized"
150 * "404":
151 * $ref: "#/components/responses/not_found_error"
152 * "409":
153 * $ref: "#/components/responses/invalid_state_error"
154 * "422":
155 * $ref: "#/components/responses/invalid_request_error"
156 * "500":
157 * $ref: "#/components/responses/500_error"
158 *
159 */
160