POST /checkout/upload
Some option sets allow users to upload a picture. E.g. this is usefull when a merchant wants to allow customers to upload a picture for a cake topping. With this endpoint, you can upload a picture and save the CartUpload
object to the cart in your app. File uploads will get removed automatically over time if the order has not been placed.
This endpoint requires uploaded files in the HTTP request. You can check the examples on the right for more information or read more about this on MDN.
Key | Description |
---|---|
files |
Multiple files allowed by adding the [] at the end of the key name. |
POST /checkout/upload HTTP/1.1
Host: api.bakeronline.be
X-VERSION: 1.5.2
Accept-Language: en-US,en;q=0.5
Content-Type: multipart/form-data;boundary="boundary"
--boundary
Content-Disposition: form-data; name="multiple"; filename="test.png"
Content-Type: image/png
...<Binary file here depending on Content-Transfer-Encoding field>...
--boundary--
Array of CartUpload: [CartUpload]
Field | Type | Description |
---|---|---|
id | Int | An integer value |
url | URL | An URL field starting with http:// or https:// |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 206
[
{
"id": 10,
"url": "https://example.com"
},
{
"id": 15,
"url": "https://example.com"
},
{
"id": 19,
"url": "https://example.com"
}
]