1 /**
2 * @oas [delete] /admin/customers/{id}
3 * operationId: DeleteCustomersId
4 * summary: Delete a Customer
5 * description: Delete a customer.
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 * security:
15 * - api_token: []
16 * - cookie_auth: []
17 * - jwt_token: []
18 * x-codeSamples:
19 * - lang: JavaScript
20 * label: JS SDK
21 * source: |-
22 * import Medusa from "@medusajs/js-sdk"
23 *
24 * export const sdk = new Medusa({
25 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
26 * debug: import.meta.env.DEV,
27 * auth: {
28 * type: "session",
29 * },
30 * })
31 *
32 * sdk.admin.customer.delete("cus_123")
33 * .then(({ deleted }) => {
34 * console.log(deleted)
35 * })
36 * - lang: Shell
37 * label: cURL
38 * source: |-
39 * curl -X DELETE '{backend_url}/admin/customers/{id}' \
40 * -H 'Authorization: Bearer {jwt_token}'
41 * tags:
42 * - Customers
43 * responses:
44 * "200":
45 * description: OK
46 * content:
47 * application/json:
48 * schema:
49 * type: object
50 * description: The deletion's details.
51 * required:
52 * - id
53 * - object
54 * - deleted
55 * properties:
56 * id:
57 * type: string
58 * title: id
59 * description: The customer's ID.
60 * object:
61 * type: string
62 * title: object
63 * description: The customer's object.
64 * deleted:
65 * type: boolean
66 * title: deleted
67 * description: The customer's deleted.
68 * "400":
69 * $ref: "#/components/responses/400_error"
70 * "401":
71 * $ref: "#/components/responses/unauthorized"
72 * "404":
73 * $ref: "#/components/responses/not_found_error"
74 * "409":
75 * $ref: "#/components/responses/invalid_state_error"
76 * "422":
77 * $ref: "#/components/responses/invalid_request_error"
78 * "500":
79 * $ref: "#/components/responses/500_error"
80 * x-workflow: removeCustomerAccountWorkflow
81 * x-events:
82 * - name: customer.deleted
83 * payload: |-
84 * ```ts
85 * {
86 * id, // The ID of the customer
87 * }
88 * ```
89 * description: Emitted when a customer is deleted.
90 * deprecated: false
91 *
92 */
93