Branch


Representa a una sucursal de una Company. Un Branch es un comercio que puede vender productos o servicios y posee sus propias configuraciones.

Modelo Branch

{
    "id": 1,
    "name": "default",
    "description": "Store",
    "enabled": true,
    "in_service": true,
    "latitude_e6": 0,
    "longitude_e6": 0,
    "banner_url": "http://127.0.0.1:8000/storage/static/default/product_category_logo.png",
    "address": null,
    "phone": "170",
    "time_zone_offset": "-04:00",
    "options": 1,
    "has_custom_settings": false,
    "code": 1,
    "created_at": "2020-08-06 02:58:46",
    "updated_at": "2020-12-18 03:39:12",
    "deleted_at": null,
    "branch_group_id": 1,
    "is_visible": true,
    "eta": null,
    "internal_code": null,
    "promo_id": null,
    "promo_info": null,
    "rating_e2": 500,
    "rating_sum": 0,
    "rating_count": 0,
    "domain": "b1",
    "logo_url": "http://127.0.0.1:8000/storage/static/default/product_category_logo.png",
    "geofence_check": null,
    "is_market": false,
    "is_featured": false,
    "in_order": 65535,
    "group_rating_e2": 500,
    "group_rating_sum": 0,
    "group_rating_count": 0,
    "settings": {
        "uid": "",
        "slogan": "",
        "max_scheduling_days": 1,
        "delivery_fee_e2": 0,
        "delivery_providers_prc": 0,
        "delivery_discount_prc": 0,
        "pay_in_store": false,
        "enable_work_schedules": false,
        "auto_sync_work_schedules": false,
        "enable_multi_providers": false,
        "invoice_next_number": 1,
        "order_expiration_minutes": 720,
        "service_fee_flat_e2": 0,
        "service_fee_prc": 0,
        "min_checkout_price_e2": 0,
        "human_delivery_fee_e2": 0,
        "human_delivery_providers_prc": 0,
        "human_delivery_discount_prc": 0,
        "human_service_fee_flat_e2": 0,
        "human_service_fee_prc": 0,
        "human_min_checkout_price_e2": 0
    },
    "local_currency": {
        "id": 26,
        "enabled": true,
        "iso": "USD",
        "symbol": "$",
        "conversion_factor": 0,
        "related_iso": "USD",
        "decimals_count": 2,
        "format": "$ 0.00",
        "decimal_point": ".",
        "use_thousands_separator": true,
        "thousands_separator": ",",
        "is_local": true,
        "is_international": true,
        "created_at": "2020-08-06 02:58:46",
        "updated_at": "2020-08-06 02:58:46",
        "company_id": 1,
        "is_custom": false,
        "branch_id": 1,
        "use_conversion": false,
        "available": false,
        "related_iso_expected": "VES",
        "related_iso_error": true
    },
    "branch_group": {
        "id": 1,
        "name": "default",
        "created_at": "2020-08-06 02:58:46",
        "updated_at": "2020-12-18 03:39:42",
        "display_unavailable_goods": false,
        "enable_shoppers": false,
        "is_market": false,
        "logo_url": "http://127.0.0.1:8000/storage/static/default/product_category_logo.png",
        "is_featured": false,
        "in_order": 65535,
        "promo_label": null,
        "enable_pool": true,
        "rating_e2": 500,
        "rating_sum": 0,
        "rating_count": 0,
        "display_spent_goods": true,
        "domain": "b1",
        "custom_domain": null,
        "settings": {
            "template": "store_1",
            "color_primary": "/docs/3/branch#aaaaaa",
            "color_accent": "/docs/3/branch#777777"
        }
    },
    "currencies": [
        {
            "id": 26,
            "enabled": true,
            "iso": "USD",
            "symbol": "$",
            "conversion_factor": 0,
            "related_iso": "USD",
            "decimals_count": 2,
            "format": "$ 0.00",
            "decimal_point": ".",
            "use_thousands_separator": true,
            "thousands_separator": ",",
            "is_local": true,
            "is_international": true,
            "created_at": "2020-08-06 02:58:46",
            "updated_at": "2020-08-06 02:58:46",
            "company_id": 1,
            "is_custom": false,
            "branch_id": 1,
            "use_conversion": false,
            "available": false,
            "related_iso_expected": "VES",
            "related_iso_error": true
        }
    ]
}

Insertar Branch

Insertar Branch de BranchGroup

Método URI Cabeceras
POST /companies/{companyId}/branch-groups/{branchGroupId}/branches Authorization
{
    "name": "required|max:112|string",
    "description": "required|max:255|string",
    "latitude_e6": "required|integer",
    "longitude_e6": "required|integer",
    "address": "required|string|max:255",
    "phone": "required|string",
    "eta": "string",
    "internal_code": "string|max:16",
    "domain": "required|max:32|domain",
    "time_zone_offset": {
        "required": true,
        "string": true,
        "regex": "/^[\\+\\-]([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    }
}

Listar Branch

{info} Soporta: Paginación Filters

Método URI Cabeceras
GET /companies/{companyId}/branches N/A

Listar ByPosition

Muestra un Listado de Branches con is_featured == true y Branches cercanos al punto especificado.

Método URI Cabeceras
GET /companies/{companyId}/branches/by-position N/A
{
    "latitude_e6": "required|integer",
    "longitude_e6": "required|integer",
    "distance_in_meters": "integer"
}

Listar BySection

Muestra un Listado de Branches cercanos al punto especificado.

Método URI Cabeceras
GET /companies/{companyId}/branches/by-sections N/A
{
    "latitude_e6": "required|integer",
    "longitude_e6": "required|integer",
    "distance_in_meters": "integer"
}

Listar Branch de BranchGroup

{info} Soporta: Paginación Filters Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/branch-groups/{branchGroupId}/branches Authorization

Listar Setting

Método URI Cabeceras
GET /companies/{companyId}/branches/{branchId}/settings Authorization

Listar Branch de BranchCategory

{info} Soporta: Paginación Filters

Método URI Cabeceras
GET /companies/{companyId}/branch-categories/{branchCategoryId}/branches N/A

Mostrar Branch

{info} Soporta: Carga dinámica

Método URI Cabeceras
GET /companies/{companyId}/branches/{branchId} N/A
{
    "latitude_e6": "integer",
    "longitude_e6": "integer"
}

Actualizar Branch

Método URI Cabeceras
PATCH /companies/{companyId}/branches/{branchId} Authorization
{
    "name": "max:112|string",
    "description": "max:255|string",
    "latitude_e6": "integer",
    "longitude_e6": "integer",
    "address": "string|max:255",
    "phone": "string",
    "eta": "string",
    "internal_code": "string|max:16",
    "time_zone_offset": {
        "string": true,
        "regex": "/^[\\+\\-]([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
    },
    "options": "integer",
    "has_custom_settings": "boolean",
    "domain": "required|max:32|domain"
}

Actualizar Setting

Método URI Cabeceras
PATCH /companies/{companyId}/branches/{branchId}/settings Authorization
{
    "uid": "string|max:64",
    "slogan": "string|max:80",
    "max_scheduling_days": "integer|min:0|max:365",
    "delivery_providers_prc": "numeric|between:0.0000,1.0000",
    "human_delivery_providers_prc": "numeric|between:0.00,100.00",
    "enable_work_schedules": "boolean",
    "auto_sync_work_schedules": "boolean",
    "order_expiration_minutes": "integer|min:5",
    "service_fee_flat_e2": "integer|min:0",
    "human_service_fee_flat_e2": "numeric|min:0.0",
    "service_fee_prc": "numeric|between:0.0000,1.0000",
    "human_service_fee_prc": "numeric|between:0.00,100.00",
    "order_tax_flat_e2": "integer|min:0",
    "human_order_tax_flat_e2": "numeric|min:0.0",
    "order_tax_prc": "numeric|between:0.0000,1.0000",
    "human_order_tax_prc": "numeric|between:0.00,100.00",
    "add_rating_sum": "integer|min:0",
    "add_rating_count": "integer|min:0",
    "min_checkout_price_e2": "integer|min:0",
    "human_min_checkout_price_e2": "numeric|min:0.0",
    "import_config": "array",
    "terms_of_service": "string",
    "payments_mode": "string|in:company,branch,both",
    "pool_mode": "string|in:company,branch",
    "delivery_fee_steps": [
        {
            "name": "required|string|max:32",
            "label": "string|max:32",
            "is_additional": "boolean",
            "distance_min": "required|integer|min:0",
            "distance_max": "required|integer|min:-1",
            "fee_min_e2": "integer|min:0",
            "human_fee_min_e2": "numeric|min:0.0",
            "fee_max_e2": "integer|min:0",
            "human_fee_max_e2": "numeric|min:0.0",
            "delivery_providers_prc": "numeric|between:0.0000,1.0000",
            "human_delivery_providers_prc": "numeric|between:0.00,100.00",
            "hour_beg": {
                "string": true,
                "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
            },
            "hour_end": {
                "string": true,
                "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
            }
        }
    ],
    "service_app_modifiers": [
        {
            "name": "required|string|max:32",
            "label": "string|max:32",
            "price_min_e2": "integer|min:0",
            "human_price_min_e2": "numeric|min:0.0",
            "price_max_e2": "integer|min:0",
            "human_price_max_e2": "numeric|min:0.0",
            "order_fee_e2": "integer|min:0",
            "human_order_fee_e2": "numeric|min:0.0",
            "client_fee_e2": "integer|min:0",
            "human_client_fee_e2": "numeric|min:0.0",
            "hour_beg": {
                "string": true,
                "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
            },
            "hour_end": {
                "string": true,
                "regex": "/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/"
            }
        }
    ]
}

Eliminar Branch

Método URI Cabeceras
DELETE /companies/{companyId}/branches/{branchId} Authorization

Restaurar Branch

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/restore Authorization
{
    "name": "string|max:112"
}

Acciones de Branch

Upload Logo

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/upload-logo Authorization
{
    "image": "required|image|mimes:jpeg,png,bmp|max:8192|dimensions:min_width=600,ratio=1/1"
}

Upload Banner

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/upload-banner Authorization
{
    "image": "required|image|mimes:jpeg,png,bmp|max:8192|dimensions:min_width=2160,min_height=868"
}

Set Enabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-enabled Authorization

Set Disabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-disabled Authorization

Set In Service Enabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-in-service-enabled Authorization

Set In Service Disabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-in-service-disabled Authorization

Set Featured Enabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-featured-enabled Authorization

Set Featured Disabled

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-featured-disabled Authorization

Set Visible

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-visible Authorization

Set Hidden

Método URI Cabeceras
POST /companies/{companyId}/branches/{branchId}/set-hidden Authorization

Index Allowed

Método URI Cabeceras
GET /companies/{companyId}/branches/{branchId}/allowed-settings Authorization

Enlaces de Branch