Files
medusa-store/docs/api/store/paths/customers_me.yaml
2022-09-13 10:59:51 +03:00

111 lines
3.2 KiB
YAML

get:
operationId: GetCustomersCustomer
summary: Get a Customer
description: >-
Retrieves a Customer - the Customer must be logged in to retrieve their
details.
x-authenticated: true
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/customers_me/getundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/customers_me/getundefined
security:
- cookie_auth: []
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: ../components/schemas/customer.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostCustomersCustomer
summary: Update Customer
description: Updates a Customer's saved details.
x-authenticated: true
requestBody:
content:
application/json:
schema:
properties:
first_name:
description: The Customer's first name.
type: string
last_name:
description: The Customer's last name.
type: string
billing_address:
description: The Address to be used for billing purposes.
anyOf:
- $ref: ../components/schemas/address.yaml
description: The full billing address object
- type: string
description: The ID of an existing billing address
password:
description: The Customer's password.
type: string
phone:
description: The Customer's phone number.
type: string
email:
description: The email of the customer.
type: string
metadata:
description: Metadata about the customer.
type: object
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/customers_me/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/customers_me/postundefined
security:
- cookie_auth: []
tags:
- Customer
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
customer:
$ref: ../components/schemas/customer.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml