[Deprecated] Cart soft delete - Fabric
[Deprecated] Cart soft delete
cURL
curl --request PATCH \
--url https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber \
--header 'Content-Type: application/json' \
--data '
{
"orderNumber": "1234-1234-12345"
}
'
Python
import requests
url = "https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber"
payload = { "orderNumber": "1234-1234-12345" }
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({orderNumber: '1234-1234-12345'})
};
fetch('https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber', 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://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'orderNumber' => '1234-1234-12345'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber"
payload := strings.NewReader("{\n \"orderNumber\": \"1234-1234-12345\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.patch("https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber")
.header("Content-Type", "application/json")
.body("{\n \"orderNumber\": \"1234-1234-12345\"\n}")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.yourcompany.fabric.zone/api-cart/cart/{cartId}/orderNumber")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderNumber\": \"1234-1234-12345\"\n}"
response = http.request(request)
puts response.read_body
Status Codes
- 200: Successful request
- 400: Bad Request
- 404: Not Found
- 500: Internal Server Error
Response Format
{
"code": "<string>",
"message": "<string>"
}
Example Error Response
{
"code": "CART_NOT_FOUND",
"message": "Cart not found."
}
Path Parameters
- cartId:
- Type: string
- Required: Yes
- Description: Required string length:
24
- Example:
"5e5818a84d030c206b2ffb02"
Body
- orderNumber:
- Type: string
- Required: Yes
- Description: Required string length:
15
- Example:
"1234-1234-12345"
Response Summary
- 200: Cart soft delete, adds the deleted boolean flag as true and order number to the cart. The response is of type
any.