Demander Api - Usage Hours Policies
This article is part of the REST Integration API documentation.
Documentation to consult, insert, update and delete usage time policies.
Concept and operation: Use Hours Policies.
Consultation
Section titled “Consultation”Lists the company’s time policies. Without filter, returns all.
Rota: {host}/public/v1/politicas-de-horario?filtroDataAlteracao={data}&operadorFiltro={operador}&mostrarVendedores={boolean}Método: GETReturn:
[ { "id": 123, "codigo": 1, "descricao": "Liberado Seg. a Sex. - 08:00 às 18:00", "ativo": true, "mensagemBloqueio": "Fora do horário permitido para utilização do aplicativo.", "operacoesBloqueadas": [ "sincronizacaoMobile", "iniciarPedidoMobile" ], "horarios": { "segunda": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "terca": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "quarta": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "12:00" }, { "inicio": "13:00", "fim": "18:00" } ] }, "quinta": { "opcao": "liberado", "intervalos": [] }, "sexta": { "opcao": "liberado", "intervalos": [] }, "sabado": { "opcao": "bloqueado", "intervalos": [] }, "domingo": { "opcao": "bloqueado", "intervalos": [] } }, "dataAlteracao": "2025-06-10 14:30:00", "vendedores": [ 10, 25, 30 ] }]Single query
Section titled “Single query”Returns a policy by codigo.
Rota: {host}/public/v1/politicas-de-horario/{codigo}?mostrarVendedores={boolean}Método: GETReturn: same object as the listing (without the array).
Insert or update
Section titled “Insert or update”POST upsert by key codigo. If codigo is omitted from inclusion, Demander generates the next available one.
Rota: {host}/public/v1/politicas-de-horarioMétodo: POSTBody: json| Property | Type | Size | Mandatory | Description |
|---|---|---|---|---|
| code | int | Policy code. Inclusion is optional (auto). If it already exists, the request updates it. | ||
| description | string | ✓ | Policy name. | |
| active | boolean | Indicates whether the policy is active. Default on inclusion: true. |
||
| mensagemBloqueio | string | Message displayed to seller on block. | ||
| operacoesBloqueadas | array | ✓ | Operations blocked after hours. See accepted values. | |
| schedules | object | ✓ | 7 day configuration. See schedule configuration. |
Body:
{ "descricao": "Liberado Seg. a Sex. - 08:00 às 18:00", "ativo": true, "mensagemBloqueio": "Fora do horário permitido para utilização do aplicativo.", "operacoesBloqueadas": [ "sincronizacaoMobile", "iniciarPedidoMobile" ], "horarios": { "segunda": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "terca": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "quarta": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "quinta": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "sexta": { "opcao": "liberadoEntre", "intervalos": [ { "inicio": "08:00", "fim": "18:00" } ] }, "sabado": { "opcao": "bloqueado", "intervalos": [] }, "domingo": { "opcao": "bloqueado", "intervalos": [] } }}Return:
{ "mensagem": "Política de horário de utilização salva com sucesso.", "codigo": 1}Delete
Section titled “Delete”Removes the policy via codigo.
Rota: {host}/public/v1/politicas-de-horario/{codigo}Método: DELETEReturn:
{ "mensagem": "Registro excluído com sucesso."}Operations blocked
Section titled “Operations blocked”Values accepted in operacoesBloqueadas:
| Value | Description |
|---|---|
| sincronizacaoMobile | Mobile synchronization (export/import) |
| iniciarPedidoMobile | Start entering new order |
| editarPedidoMobile | Edit existing order |
| excluirPedidoMobile | Delete order on mobile |
| salvarPedidoMobile | Save order on mobile |
| enviarPedidosParaWS | Export orders from mobile to Demander Web |
| finalizarPedidosWeb | Finalize orders on Demander Web |
Timetable configuration
Section titled “Timetable configuration”The object horarios must contain the 7 days: segunda, terca, quarta, quinta, sexta, sabado, domingo.
| Property | Type | Mandatory | Description |
|---|---|---|---|
| option | string | ✓ | liberado, bloqueado or liberadoEntre. |
| intervals | array | Mandatory when opcao=liberadoEntre (up to 2 intervals). Empty ([]) to liberado/bloqueado. |
Ranges in the format HH:mm:
"intervalos": [{ "inicio": "08:00", "fim": "12:00" },{ "inicio": "13:00", "fim": "18:00" }]