Pular para o conteúdo principal

API — Clientes

Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.


GET /api/customers/me

Get My Profile

Exemplo resposta (200):

{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"phone": null,
"is_active": true,
"email_verified": true,
"created_at": null,
"updated_at": null
}

PUT /api/customers/me

Update My Profile

Corpo do pedido:

CampoTipoObrigatorioDescricao
first_nameobjectNaoFirst Name
last_nameobjectNaoLast Name
phoneobjectNaoPhone
emailobjectNaoEmail

Exemplo pedido:

{
"first_name": null,
"last_name": null,
"phone": null,
"email": null
}

Exemplo resposta (200):

{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"phone": null,
"is_active": true,
"email_verified": true,
"created_at": null,
"updated_at": null
}

Erros possiveis: 422 Validation Error


DELETE /api/customers/me

Delete My Account

Exemplo resposta (200):

{}

PUT /api/customers/me/password

Change My Password

Corpo do pedido:

CampoTipoObrigatorioDescricao
current_passwordstringSimCurrent Password
new_passwordstringSimNew Password

Exemplo pedido:

{
"current_password": "string",
"new_password": "string"
}

Exemplo resposta (200):

{}

Erros possiveis: 422 Validation Error


GET /api/customers/me/data-export

Export My Data

Exemplo resposta (200):

{}

GET /api/customers/me/preferences

Get My Preferences

Exemplo resposta (200):

{
"order_updates": true,
"promotions": true,
"newsletter": true
}

PUT /api/customers/me/preferences

Update My Preferences

Corpo do pedido:

CampoTipoObrigatorioDescricao
order_updatesbooleanNaoOrder Updates
promotionsbooleanNaoPromotions
newsletterbooleanNaoNewsletter

Exemplo pedido:

{
"order_updates": true,
"promotions": true,
"newsletter": true
}

Exemplo resposta (200):

{
"order_updates": true,
"promotions": true,
"newsletter": true
}

Erros possiveis: 422 Validation Error


GET /api/customers/analytics/overview

Customer Analytics

Exemplo resposta (200):

{
"total_customers": 0,
"new_this_month": 0,
"active_rate": 0,
"segments": {},
"top_customers": [
"..."
]
}

GET /api/customers/export

Export Customers Csv

Exemplo resposta (200):

{}

GET /api/customers

List Customers

Parametros:

NomeTipoObrigatorioDescricao
pageintegerNao
page_sizeintegerNao
searchstringNao
segmentstringNao

Exemplo resposta (200):

{
"items": [
"..."
],
"total": 0,
"page": 0,
"page_size": 0,
"pages": 0
}

Erros possiveis: 422 Validation Error


GET /api/customers/{customer_id}

Get Customer

Parametros:

NomeTipoObrigatorioDescricao
customer_idintegerSim

Exemplo resposta (200):

{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"phone": null,
"is_active": true,
"email_verified": true,
"created_at": null,
"updated_at": null,
"stats": {
"total_orders": 0,
"total_spent": "string",
"avg_order_value": "string",
"first_order_date": null,
"last_order_date": null
},
"orders": [
"..."
],
"addresses": [
"..."
],
"segment": "string",
"admin_notes": null
}

Erros possiveis: 422 Validation Error


PUT /api/customers/{customer_id}

Update Customer

Parametros:

NomeTipoObrigatorioDescricao
customer_idintegerSim

Corpo do pedido:

CampoTipoObrigatorioDescricao
first_nameobjectNaoFirst Name
last_nameobjectNaoLast Name
phoneobjectNaoPhone
is_activeobjectNaoIs Active

Exemplo pedido:

{
"first_name": null,
"last_name": null,
"phone": null,
"is_active": null
}

Exemplo resposta (200):

{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"phone": null,
"is_active": true,
"email_verified": true,
"created_at": null,
"updated_at": null
}

Erros possiveis: 422 Validation Error


PUT /api/customers/{user_id}/role

Update User Role

Parametros:

NomeTipoObrigatorioDescricao
user_idintegerSim

Corpo do pedido:

CampoTipoObrigatorioDescricao
rolestringSimRole

Exemplo pedido:

{
"role": "string"
}

Exemplo resposta (200):

{
"id": 0,
"email": "string",
"first_name": "string",
"last_name": "string",
"role": "string"
}

Erros possiveis: 422 Validation Error


Documentacao gerada automaticamente.