[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

Response Format

{
  "code": "<string>",
  "message": "<string>"
}

Example Error Response

{
  "code": "CART_NOT_FOUND",
  "message": "Cart not found."
}

Path Parameters

Body

Response Summary