Branches
GET /branches
Retrieve a list of branches
Parameter
Type
Required
Description
page
query
No
Number of the page returned. Default: 0
limit
query
No
Items per page returned. Default: 10, Max: 100
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
HTTP Code
Name
Description
200
ok
Successful request
400
bad request
Invalid parameters
403
forbidden
Invalid or inexistent apikey
405
method not allowed
Use an invalid http verb in the request
500
server error
Internal error, explained in the json response
GET /branches/{id}
Retrieve a specific branch identified by id.
Parameter
Type
Required
Description
id
uri
Yes
Branch 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
HTTP Code
Name
Description
200
ok
Successful request
400
bad request
Invalid parameters
403
forbidden
Invalid or inexistent apikey
405
method not allowed
Use an invalid http verb in the request
500
server error
Internal error, explained in the json response
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
HttpCode
HttpCode Name
Code
Description
201
ok
ok
Branch successfully saved
400
bad request
bad_request
Invalid parameters, view message for more details
400
bad request
already_exist
The branch already exist
500
internal error
internal_error
Unexpected error
PUT /branches/{id}
Update a branch.
Parameter
Type
Required
Description
id
URI
Yes
Branch Id in WoowUp
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
HttpCode
HttpCode Name
Code
Description
200
ok
ok
Branch successfully updated
400
bad request
bad_request
Invalid parameters, view message for more details
404
not found
not_found
The branch doesn't exist
500
internal error
internal_error
Unexpected error
Delete branch
DELETE
https://api.woowup.com/apiv3/branches
Delete a branch and its purchases
Request Body
id
integer
Branch Id in WoowUp
notify_to
string
email to receive the confirmation
{
"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
Was this helpful?