Ir al contenido

Actualizar establecimiento y sus puntos de venta

PATCH
/emitters/{id}/establishments/{establishment_id}
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.

id
obligatorio
string
establishment_id
obligatorio
string
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
default: true
points_of_sale
Array<object>
object
code
string
name
string
active
boolean
default: true

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
default: true
points_of_sale
Array<object>
object
code
string
name
string
active
boolean
default: true

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"
]
}
}

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"
]
}
}