API Mock: Notas importantes - Socomarca/socomarca-backend GitHub Wiki
General
- La header de autorización para los endpoints que la requieran es Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
Autenticación - dummy data
200 POST /api/auth/token
- rut: cualquiera
- password: "strongPassword"
401 POST /api/auth/token
- rut: cualquiera
- password: "wrong-password"
200 POST /api/auth/restore/code
- rut: cualquiera excepto 111111111*
422 POST /api/auth/restore/code (RUT inválido no encontrado en la base de datos)
- rut: 111111111
200 PUT /api/auth/restore/password
- verification_code: 007007567
- password: New$trongPassw0rd
- password_confirmation: New$trongPassw0rd
422 PUT /api/auth/restore/password (código inválido)
- verification_code: cualquiera distinto de 007007567
- password: New$trongPassw0rd
- password_confirmation: New$trongPassw0rd
422 PUT /api/auth/restore/password (confirmación de contraseña inválida)
- verification_code: 007007567
- password: Newstrongpassword
- password_confirmation: New$trongPassw0rd
422 PUT /api/auth/restore/password (todos los campos inválidos)
- verification_code: cualquiera distinto de 007007567
- password: cualquiera distinto de New$trongPassw0rd
- password_confirmation: cualquiera distinto de New$trongPassw0rd
Direcciones - dummy data
401 GET /api/addresses
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
200 GET /api/addresses
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
401 POST /api/addresses
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
422 POST /api/addresses (todos los campos inválidos)
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9body
address_line1: nullbody
address_line2: nullbody
postal_code: nullbody
is_default: nullbody
type: nullbody
phone: nullbody
contact_name: nullbody
user_id: nullbody
municipality_id: null
201 POST /api/addresses
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9body
address_line1: Address Street #321body
address_line2: Small Housebody
postal_code: 25700000body
is_default: truebody
type: shippingbody
phone: 998877665body
contact_name: Contactbody
user_id: 1body
municipality_id: 1
401 GET /api/addresses/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 GET /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
200 GET /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
401 PUT /api/addresses/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 PUT /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
422 PUT /api/addresses/:id (todos los campos inválidos)
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1body
address_line1: nullbody
address_line2: nullbody
postal_code: nullbody
is_default: nullbody
type: nullbody
phone: nullbody
contact_name: nullbody
user_id: nullbody
municipality_id: null
200 PUT /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1body
address_line1: Address Street #321body
address_line2: Small Housebody
postal_code: 25700000body
is_default: truebody
type: shippingbody
phone: 998877665body
contact_name: Contactbody
user_id: 1body
municipality_id: 1
401 DELETE /api/addresses/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 DELETE /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
200 DELETE /api/addresses/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
Users dummy data
401 GET /api/users
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
200 GET /api/users
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
401 POST /api/users
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
422 POST /api/users (todos los campos inválidos)
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9body
name: nullbody
email: nullbody
phone: nullbody
rut: nullbody
business_name: nullbody
is_active: null
201 POST /api/users
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9body
name: Customerbody
email: [email protected]body
phone: 998877665body
rut: 20987654-3body
business_name: Business Storebody
is_active: true
401 GET /api/users/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 GET /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
200 GET /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
401 PUT /api/users/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 PUT /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
422 PUT /api/users/:id (todos los campos inválidos)
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1body
name: nullbody
email: nullbody
phone: nullbody
rut: nullbody
business_name: nullbody
is_active: null
200 PUT /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1body
name: Customerbody
email: [email protected]body
phone: 998877665body
rut: 20987654-3body
business_name: Business Storebody
is_active: true
401 DELETE /api/users/:id
header
Authorization: distinto de Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1
422 DELETE /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: distinto de un entero
200 DELETE /api/users/:id
header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9params
id: 1