CartItem.cart

Request

Fields when send to the api inside a request.

Field Type Description
amount Int An integer value
persons Int An integer value
gram Int An integer value
comment String A String value
product_id Int An integer value
product_price_id Int? Nullable. An integer value
shop_id Int An integer value
options [CartItemOption] Array of CartItemOption

Response

Fields when returned by the api in a response.

Field Type Description
amount Int An integer value
persons Int An integer value
gram Int An integer value
comment String A String value
product Product.simple
product_price ProductPrice.simple? Nullable.
calculated_prices CartItemPrices
discount_prices CartItemPrices? Nullable.
amount_free Int Amount you receive for free on top of the chosen amount. If the price type of the product is in gram or persons, this amount is also in gram or persons.
shop Shop.simple
options [CartItemOption] Array of CartItemOption

Examples

Request

When used inside a request.

Example 1

{
    "amount": 12,
    "persons": 12,
    "gram": 12,
    "comment": "string",
    "product_id": 12,
    "product_price_id": 12,
    "shop_id": 12,
    "options": [
        {
            "option_id": 12,
            "upload_id": 12
        },
        {
            "option_id": 12,
            "upload_id": 12
        },
        {
            "option_id": 12,
            "upload_id": 12
        }
    ]
}

Response

When returned in a response.

Example 1

{
    "amount": 12,
    "persons": 12,
    "gram": 12,
    "comment": "string",
    "product": {
        "id": 12,
        "name": "string",
        "images": [
            {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": true
            },
            {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": true
            },
            {
                "resolutions": [
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    },
                    {
                        "src": "https://example.com",
                        "width": 600,
                        "height": 350
                    }
                ],
                "white_background": true
            }
        ],
        "price_type": "PER_UNIT",
        "target_price": true,
        "price": {
            "value": 12,
            "currency": "EUR"
        }
    },
    "product_price": {
        "id": 12,
        "name": "string",
        "price": {
            "value": 12,
            "currency": "EUR"
        }
    },
    "calculated_prices": {
        "unit_price": {
            "value": 12,
            "currency": "EUR"
        },
        "price": {
            "value": 12,
            "currency": "EUR"
        }
    },
    "discount_prices": {
        "unit_price": {
            "value": 12,
            "currency": "EUR"
        },
        "price": {
            "value": 12,
            "currency": "EUR"
        }
    },
    "amount_free": 12,
    "shop": {
        "id": 227,
        "name": "Budding Tastes",
        "address": {
            "street": "Pierrering",
            "nr": "42",
            "zipcode": "5170",
            "city": "Poperinge",
            "country": "BE",
            "position": {
                "latitude": 50.8503396,
                "longitude": 4.3517103
            }
        },
        "allow_comments": true,
        "currency": "EUR"
    },
    "options": [
        {
            "option": {
                "id": 12,
                "name": "string",
                "price_change": {
                    "value": 12,
                    "currency": "EUR"
                },
                "image": {
                    "resolutions": [
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        }
                    ],
                    "white_background": true
                },
                "require_image": true,
                "code": "string",
                "optionset": {
                    "id": 12,
                    "name": "string",
                    "code": "string"
                }
            },
            "upload": {
                "id": 12,
                "url": "https://example.com"
            }
        },
        {
            "option": {
                "id": 12,
                "name": "string",
                "price_change": {
                    "value": 12,
                    "currency": "EUR"
                },
                "image": {
                    "resolutions": [
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        }
                    ],
                    "white_background": true
                },
                "require_image": true,
                "code": "string",
                "optionset": {
                    "id": 12,
                    "name": "string",
                    "code": "string"
                }
            },
            "upload": {
                "id": 12,
                "url": "https://example.com"
            }
        },
        {
            "option": {
                "id": 12,
                "name": "string",
                "price_change": {
                    "value": 12,
                    "currency": "EUR"
                },
                "image": {
                    "resolutions": [
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        },
                        {
                            "src": "https://example.com",
                            "width": 600,
                            "height": 350
                        }
                    ],
                    "white_background": true
                },
                "require_image": true,
                "code": "string",
                "optionset": {
                    "id": 12,
                    "name": "string",
                    "code": "string"
                }
            },
            "upload": {
                "id": 12,
                "url": "https://example.com"
            }
        }
    ]
}
1.5.0 stable