La documentación que estás leyendo no cuenta con los últimos cambios. ¡Revisa nuestra documentación actualizada!
Listar, editar crear y eliminar sucursales. La creación está condicionada por el plan asociado a la instancia.
Al realizar una petición HTTP, el servicio retornara un JSON con la siguiente estructura:
{
"href": "https://api.bsale.cl/v1/offices/1.json",
"id": 1,
"name": "Tienda Online",
"description": "",
"address": "",
"latitude": "",
"longitude": "",
"isVirtual": 1,
"country": null,
"municipality": "",
"city": null,
"zipCode": null,
"costCenter": "",
"state": 1,
"imagestionCellarId": 0
}
GET /v1/offices.json
retornara todas las sucursales.Parámetros
Ejemplos
GET /v1/offices.json?limit=10&offset=0
GET /v1/offices.json?fields=[name,address,costcenter]
GET /v1/offices.json?state=0
Respuesta
{
"href": "https://api.bsale.cl/v1/offices.json",
"count": 4,
"limit": 25,
"offset": 0,
"items": [
{
"href": "https://api.bsale.cl/v1/offices/2.json",
"id": 2,
"name": "Casa Matriz - Puerto Varas",
"description": "",
"address": "Direccion de la sucursal",
"latitude": "",
"longitude": "",
"isVirtual": 0,
"country": "",
"municipality": "",
"city": "",
"zipCode": "",
"costCenter": "",
"state": 0,
"imagestionCellarId": 0
},
{
"href": "https://api.bsale.cl/v1/offices/3.json",
"id": 3,
"name": "Casa Matriz Pto. Varas en ($)",
"description": "",
"address": "Direccion de la sucursal",
"latitude": "",
"longitude": "",
"isVirtual": 0,
"country": "",
"municipality": "",
"city": "",
"zipCode": "",
"costCenter": "",
"state": 1,
"imagestionCellarId": 0
},
{
"href": "https://api.bsale.cl/v1/offices/4.json",
"id": 4,
"name": "Internacional",
"description": "",
"address": "",
"latitude": "",
"longitude": "",
"isVirtual": 0,
"country": "",
"municipality": "",
"city": "",
"zipCode": "",
"costCenter": "",
"state": 0,
"imagestionCellarId": 0
},
{
"href": "https://api.bsale.cl/v1/offices/1.json",
"id": 1,
"name": "Tienda Online",
"description": "",
"address": "",
"latitude": "",
"longitude": "",
"isVirtual": 1,
"country": null,
"municipality": "",
"city": null,
"zipCode": null,
"costCenter": "",
"state": 1,
"imagestionCellarId": 0
}
]
}
GET /v1/offices/1.json
retornara una sucursal específica.Respuesta
{
"href": "https://api.bsale.cl/v1/offices/1.json",
"id": 1,
"name": "Tienda Online",
"description": "",
"address": "",
"latitude": "",
"longitude": "",
"isVirtual": 1,
"country": null,
"municipality": "",
"city": null,
"zipCode": null,
"costCenter": "",
"state": 1,
"imagestionCellarId": 0
}
GET /v1/offices/count.json
Parámetros
Respuesta
{
"count": 4
}
POST /v1/offices.json
Se debe enviar un Json con la siguiente estructura.
{
"longitude": "",
"zipCode": "000000",
"name": "Imaginex",
"latitude": "",
"isVirtual": 0,
"address": "Santa Rosa 402",
"country": "Chile",
"municipality": "Puerto Varas",
"city": "Puerto Varas",
"costCenter": "25",
"description": "Oficina"
}
Respuesta
{
"zipCode": "000000",
"longitude": "",
"state": 0,
"latitude": "",
"name": "Imaginex",
"isVirtual": 0,
"href": "https://api.bsale.cl/v1/offices/5.json",
"address": "Santa Rosa 402",
"id": 5,
"city": "Puerto Varas",
"municipality": "Puerto Varas",
"country": "Chile",
"costCenter": "25",
"description": "Oficina",
"imagestionCellarId": 0
}
PUT /v1/offices/5.json
Se debe enviar un Json con la siguiente estructura.
{
"id":"97",
"name": "Imaginex TI",
"address": "Santa Rosa 402 oficina B"
}
Respuesta
{
"zipCode": "000000",
"longitude": "",
"state": 0,
"latitude": "",
"name": "Imaginex TI",
"isVirtual": 0,
"href": "https://api.bsale.cl/v1/offices/5.json",
"address": "SSanta Rosa 402 oficina B",
"id": 5,
"city": "Puerto Varas",
"municipality": "Puerto Varas",
"country": "Chile",
"costCenter": "25",
"description": "Oficina",
"imagestionCellarId": 0
}
DELETE /v1/offices/5.json
cambia el estado de la sucursal.{
"zipCode": "000000",
"longitude": "",
"state": 1,
"latitude": "",
"name": "Imaginex TI",
"isVirtual": 0,
"href": "https://api.bsale.cl/v1/offices/5.json",
"address": "SSanta Rosa 402 oficina B",
"id": 5,
"city": "Puerto Varas",
"municipality": "Puerto Varas",
"country": "Chile",
"costCenter": "25",
"description": "Oficina",
"imagestionCellarId": 0
}