Delete cart
curl --request DELETE \
--url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "Requested resource not found",
"code": "NOT_FOUND"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}Carts
Delete cart
Deletes the cart. Use this when the shopper abandons their order.
DELETE
/
locations
/
{locationId}
/
carts
/
{cartId}
Delete cart
curl --request DELETE \
--url https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craveup.com/api/v1/locations/{locationId}/carts/{cartId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Unauthorized access",
"code": "UNAUTHORIZED"
}{
"success": false,
"message": "Requested resource not found",
"code": "NOT_FOUND"
}{
"success": false,
"message": "An unexpected error occurred",
"code": "GENERIC_ERROR"
}⌘I