101 lines
3.1 KiB
Markdown
101 lines
3.1 KiB
Markdown
# Class: AdminCustomersResource
|
|
|
|
## Hierarchy
|
|
|
|
- `default`
|
|
|
|
↳ **`AdminCustomersResource`**
|
|
|
|
## Methods
|
|
|
|
### create
|
|
|
|
▸ **create**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
Creates a customer
|
|
|
|
#### Parameters
|
|
|
|
| Name | Type | Description |
|
|
| :------ | :------ | :------ |
|
|
| `payload` | [`AdminPostCustomersReq`](internal-5.AdminPostCustomersReq.md) | information of customer |
|
|
| `customHeaders` | `Record`<`string`, `any`\> | |
|
|
|
|
#### Returns
|
|
|
|
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
#### Defined in
|
|
|
|
[medusa-js/src/resources/admin/customers.ts:18](https://github.com/medusajs/medusa/blob/f7a63f178/packages/medusa-js/src/resources/admin/customers.ts#L18)
|
|
|
|
___
|
|
|
|
### list
|
|
|
|
▸ **list**(`query?`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersListRes`](../modules/internal-4.md#admincustomerslistres)\>
|
|
|
|
Lists customers
|
|
|
|
#### Parameters
|
|
|
|
| Name | Type | Description |
|
|
| :------ | :------ | :------ |
|
|
| `query?` | [`AdminGetCustomersParams`](internal-4.AdminGetCustomersParams.md) | optional |
|
|
| `customHeaders` | `Record`<`string`, `any`\> | |
|
|
|
|
#### Returns
|
|
|
|
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersListRes`](../modules/internal-4.md#admincustomerslistres)\>
|
|
|
|
#### Defined in
|
|
|
|
[medusa-js/src/resources/admin/customers.ts:59](https://github.com/medusajs/medusa/blob/f7a63f178/packages/medusa-js/src/resources/admin/customers.ts#L59)
|
|
|
|
___
|
|
|
|
### retrieve
|
|
|
|
▸ **retrieve**(`id`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
Retrieves a customer
|
|
|
|
#### Parameters
|
|
|
|
| Name | Type | Description |
|
|
| :------ | :------ | :------ |
|
|
| `id` | `string` | customer id |
|
|
| `customHeaders` | `Record`<`string`, `any`\> | |
|
|
|
|
#### Returns
|
|
|
|
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
#### Defined in
|
|
|
|
[medusa-js/src/resources/admin/customers.ts:46](https://github.com/medusajs/medusa/blob/f7a63f178/packages/medusa-js/src/resources/admin/customers.ts#L46)
|
|
|
|
___
|
|
|
|
### update
|
|
|
|
▸ **update**(`id`, `payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
Updates a customer
|
|
|
|
#### Parameters
|
|
|
|
| Name | Type | Description |
|
|
| :------ | :------ | :------ |
|
|
| `id` | `string` | customer id |
|
|
| `payload` | [`AdminPostCustomersCustomerReq`](internal-5.AdminPostCustomersCustomerReq.md) | data to update customer with |
|
|
| `customHeaders` | `Record`<`string`, `any`\> | |
|
|
|
|
#### Returns
|
|
|
|
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`AdminCustomersRes`](../modules/internal-5.md#admincustomersres)\>
|
|
|
|
#### Defined in
|
|
|
|
[medusa-js/src/resources/admin/customers.ts:32](https://github.com/medusajs/medusa/blob/f7a63f178/packages/medusa-js/src/resources/admin/customers.ts#L32)
|