Listas de precios


APIs para el tratamiento de listas de precios.


Tanto la api de create, update y get devuelven el json de la lista sobre la cual se está trabajando.

Ejemplo:

{
    "id": 3,
    "name": 1,
    "stock_location_id": 15,
    "stock_location_name": "BGH",
    "prices": [
        {
            "id": 65469,
            "amount": "30.0",
            "variant": {
                "id": 27865,
                "full_name": "Notebook A1050P POSITIVO BGH SERIE A"
            }
        },
        {
            "id": 65468,
            "amount": "130.0",
            "variant": {
                "id": 21220,
                "full_name": "Pava Eléctrica BPE17C16 - BGH - Champagne"
            }
        },
        {
            "id": 65467,
            "amount": "30.0",
            "variant": {
                "id": 51792,
                "full_name": "Notebook A1530i  POSITIVO BGH serie A"
            }
        }
    ]
}

Creación

POST /api/v2/price_lists

Body:

    { 
    "price_list": {
        "name": "Afinidad",
        "stock_location_id": 15,
        "prices_attributes": [
            {
                "amount": 30,
                "variant_id": 51792,
                "merchant_id": 8
            },
            {
                "amount": 130,
                "variant_id": 21220,
                "merchant_id": 8

            },
            {
                "amount": 30,
                "variant_id": 27865,
                "merchant_id": 8

            }
        ]
    }
}

Edición

PUT/api/v2/price_lists/3

Body:

    { 
    "price_list": {
        "prices_attributes": [
            {
                "id": 65467,
                "amount": 930,
                "variant_id": 51792,
                "merchant_id": 8
            },
            {
                "amount": 110,
                "variant_id": 17025,
                "merchant_id": 8
            }
        ]
    }
}

Eliminar

DELETE /api/v2/user_group_rules/:id


Eliminar un precio de la lista

PUT/api/v2/price_lists/3

Body:

    { 
    "price_list": {
        "prices_attributes": [
            {
                "id": 65467,
                "_destroy": true
            }            
        ]
    }
}

results matching ""

    No results matching ""