Actualizar establecimiento y sus puntos de venta
PATCH
/emitters/{id}/establishments/{establishment_id}
const url = 'https://api.sudte.com/v1/emitters/example/establishments/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"example","code":"example","name":"example","type":"example","address":{"department":"example","municipality":"example","district":"example","line":"example"},"phone":"example","email":"hello@example.com","active":true,"points_of_sale":[{"code":"example","name":"example","active":true}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.sudte.com/v1/emitters/example/establishments/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "code": "example", "name": "example", "type": "example", "address": { "department": "example", "municipality": "example", "district": "example", "line": "example" }, "phone": "example", "email": "hello@example.com", "active": true, "points_of_sale": [ { "code": "example", "name": "example", "active": true } ] }'points_of_sale reemplaza la lista completa. Un punto de venta con documentos emitidos no se borra: se marca active: false.
Autorización
Sección titulada « Autorización »Parámetros
Sección titulada « Parámetros »Parámetros de ruta
Sección titulada « Parámetros de ruta » id
obligatorio
string
establishment_id
obligatorio
string
Cuerpo de la solicitudobligatorio
Sección titulada « Cuerpo de la solicitudobligatorio » Media type application/json
object
id
string
code
obligatorio
Código MH (M001, S001, …)
string
name
Nombre interno de la sucursal
string
type
obligatorio
CAT-009
string
address
obligatorio
object
department
CAT-012
string
municipality
CAT-013
string
district
CAT-008
string
line
string
phone
string
email
string format: email
active
boolean
points_of_sale
Array<object>
object
code
string
name
string
active
boolean
Respuestas
Sección titulada « Respuestas »Actualizado
Media type application/json
object
id
string
code
obligatorio
Código MH (M001, S001, …)
string
name
Nombre interno de la sucursal
string
type
obligatorio
CAT-009
string
address
obligatorio
object
department
CAT-012
string
municipality
CAT-013
string
district
CAT-008
string
line
string
phone
string
email
string format: email
active
boolean
points_of_sale
Array<object>
object
code
string
name
string
active
boolean
Example
{ "active": true, "points_of_sale": [ { "active": true } ]}Error (RFC 9457)
Media type application/problem+json
object
type
string format: uri
title
string
status
integer
detail
string
instance
string
request_id
string
errors
Array<object>
object
path
string
message
string
mh
object
codigoMsg
string
descripcionMsg
string
observaciones
Array<string>
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": [ { "path": "example", "message": "example" } ], "mh": { "codigoMsg": "example", "descripcionMsg": "example", "observaciones": [ "example" ] }}default
Sección titulada « default »Error (RFC 9457)
Media type application/problem+json
object
type
string format: uri
title
string
status
integer
detail
string
instance
string
request_id
string
errors
Array<object>
object
path
string
message
string
mh
object
codigoMsg
string
descripcionMsg
string
observaciones
Array<string>
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": [ { "path": "example", "message": "example" } ], "mh": { "codigoMsg": "example", "descripcionMsg": "example", "observaciones": [ "example" ] }}