Skip to main content
PATCH
/
v1
/
abandoned_checkout_protocol
Update
curl --request PATCH \
  --url https://{defaultHost}/v1/abandoned_checkout_protocol \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "abandoned_checkout_protocol": {
    "enabled": false
  }
}
'
import requests

url = "https://{defaultHost}/v1/abandoned_checkout_protocol"

payload = { "abandoned_checkout_protocol": { "enabled": False } }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({abandoned_checkout_protocol: {enabled: false}})
};

fetch('https://{defaultHost}/v1/abandoned_checkout_protocol', 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://{defaultHost}/v1/abandoned_checkout_protocol",
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([
'abandoned_checkout_protocol' => [
'enabled' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{defaultHost}/v1/abandoned_checkout_protocol"

payload := strings.NewReader("{\n \"abandoned_checkout_protocol\": {\n \"enabled\": false\n }\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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))

}
HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/abandoned_checkout_protocol")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"abandoned_checkout_protocol\": {\n \"enabled\": false\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{defaultHost}/v1/abandoned_checkout_protocol")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"abandoned_checkout_protocol\": {\n \"enabled\": false\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "993643aa-3ceb-44a5-b3ee-ddb8a0c1a294",
  "object": "abandoned_checkout_protocol",
  "enabled": false,
  "first_promotion_notification": null,
  "grace_period_days": 0,
  "ignore_purchased_products": false,
  "notification_delays": [
    3600,
    86400,
    432000
  ],
  "promotion_expires_after_days": null,
  "test_mode_enabled": true,
  "coupon": "e1f4a391-6797-43e7-a508-27679fbbdc6a",
  "created_at": 1782485795,
  "updated_at": 1782485795
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
abandoned_checkout_protocol
object

Response

200 - application/json

Success

id
string | null

The UUID of the specific object.

object
string

A string describing the object type returned.

enabled
boolean

If set to true abandonded checkout reminder emails will be sent to customers.

first_promotion_notification
integer | null

The first notification that should have an auto-generated promotion code – can be one of 1, 2, 3 or null. For example, if set to 2 the promotion code will be generated when the second notification is sent. If null a promotion code will never be generated.

grace_period_days
integer

The number of days to wait after a customer's purchase before allowing an abandoned checkout to be created. This helps to prevent abandoned checkouts being created for customers very soon after they have made a purchase.

ignore_purchased_products
boolean

Whether or not to ignore checkouts where the customer has already purchased all of the products in the checkout.

notification_delays
array

The timing schedule for abandoned checkout notifications. It is an array of integers representing the delay in seconds for all notifications. For example, a value of [3600, 86400, 432000] indicates that notifications will be sent 1 hour, 24 hours, and 5 days after a checkout is abandoned. The number of notifications (items in array) must be between 1 and 3.

promotion_expires_after_days
integer | null

The number of days that the auto-generated promotion code should be valid for. If set to 'null' it is valid forever.

test_mode_enabled
boolean

Whether or not abandoned checkouts should be created for test mode checkouts.

coupon

The coupon that is used when creating discounts for abandoned checkouts.

Expandable – The associated coupon ID.

created_at
integer | null

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at
integer | null

Time at which the object was last updated. Measured in seconds since the Unix epoch.