Branches

GET /branches

Retrieve a list of branches

Example

curl -X GET \
  'https://api.woowup.com/apiv3/branches?page=0&limit=1' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'

Response

{
    "payload": [
        {
            "id": 1,
            "name": "Palermo I",
            "display_name": "Palermo",
            "description": "",
            "status": "active",
            "created": "2018-04-13 15:12:50",
            "modified": null,
            "holder": null,
            "email": null,
            "telephone": null,
            "address": null,
            "working_hours": null,
            "notes": null,
            "branch_zone_name": null
        }
    ],
    "message": "ok",
    "code": "ok",
    "time": "25ms"
}

HTTP Response codes

GET /branches/{id}

Retrieve a specific branch identified by id.

Example

curl -X GET \
  'https://api.woowup.com/apiv3/branches/1' \
  -H 'accept: application/json' \
  -H 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -H 'cache-control: no-cache'

Response

{
    "payload": {
        "id": 1,
        "name": "Palermo I",
        "display_name": "Palermo",
        "description": "",
        "status": "active",
        "created": "2018-04-13 15:12:50",
        "modified": null,
        "holder": null,
        "email": null,
        "telephone": null,
        "address": null,
        "working_hours": null,
        "notes": null,
        "branch_zone_name": null
    },
    "message": "ok",
    "code": "ok",
    "time": "25ms"
}

HTTP Response codes

POST /branches

Create a new branch.

The json with the branch should be valid with the following json-schema

Request content format

{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A branch",
        "type": "object",
        "required": ["name"],
        "properties": {
            "name": { "type": "string", "minLenght": 1, "maxLength": 128 },
            "description": { "type": ["string", "null"], "minLenght": 1, "maxLength": 100 },
            "display_name": { "type": ["string", "null"], "minLenght": 1, "maxLength": 128 },
            "email": { "type": ["string", "null"] },
            "telephone": { "type": ["string", "null"] },
            "address": { "type": ["string", "null"] },
            "working_hours": { "type": ["string", "null"] },
            "notes": { "type": ["string", "null"] },
            "branch_zone": {
                "type": ["object", "null"],
                "properties": {
                    "code": { "type": "string" },
                    "name": { "type": "string" }
                }
            },
            "holder": { "type": ["string", "null"] },
            "status": { "type": ["string", "null"], "enum": ["active", "inactive"] },
            "country": {
                "type": ["object", "null"],
                "properties": {
                    "code": { "type": "string" }
                }
            },
            "state": { "type": ["string", "null"] },
            "city": { "type": ["string", "null"] },
            "business_type": { "type": ["string", "null"], "enum": ["own", "franchisee", null] },
            "shopping_center": { "type": ["string", "null"] },
            "location_type": { "type": ["string", "null"] },
            "m2": { "type": ["integer", "null"] },
            "m2_cost": { "type": ["integer", "null"] },
            "employees_quantity": { "type": ["integer", "null"] },
            "group": { "type": ["string", "null"] },
            "format": { "type": ["string", "null"], "enum": ["brand_branch", "multibrand_branch", "brand_island", "multibrand_island", "outlet", null] },
            "is_web": { "type": "boolean" }
        }
    }

Example

This is a valid branch according to the previous json-schema:

{
    "name" : 'Shopping de Prueba',
    "description" : "Este Shopping es una prueba para el endpoint de creación de sucursales",
    "working_hours" : "Lunes a Viernes 9.00 a 22.00 hs",
    "email" : "shopping@marca.com.ar",
    "telephone" : "01132392300",
    "holder" : "Gerente Juan Perez",
    "branch_zone_name" : "Buenos Aires",
    "country": ARG
}

Errors

PUT /branches/{id}

Update a branch.

The json with the branch should be valid with the following json-schema

Request content format

{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A branch",
        "type": "object",
        "properties": {
            "name": { "type": "string", "minLenght": 1, "maxLength": 128 },
            "description": { "type": "string", "minLenght": 1, "maxLength": 100 },
            "display_name": { "type": ["string", "null"], "minLenght": 1, "maxLength": 128 },
            "email": { "type": "string" },
            "telephone": { "type": "string" },
            "address": { "type": "string" },
            "working_hours": { "type": "string" },
            "notes": { "type": "string" },
            "branch_zone_name": { "type": "string" },
            "holder": { "type": "string" },
            "status": { "type": "string", "enum": ["active", "inactive"] }
        }
    }

Example

This is a valid branch according to the previous json-schema, We are going to change branch description, working hours and it's zoneN

{
    "description": "Este shopping es una prueba para el endpoint de actualización de sucursales",
    "working_hours": "Lunes a Viernes 11.00 a 22.00 hs",
    "branch_zone_name": "Pilar"
}

Errors

Delete branch

DELETE https://api.woowup.com/apiv3/branches

Delete a branch and its purchases

Request Body

{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}

Example

curl -X DELETE \
  https://api.woowup.com/apiv3/branches \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"id": 00000,
	"notify_to": "test@email.com"
}'

Response

{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}

Last updated