curl --request POST \
--url https://api.loopreturns.com/api/v1/blocklists \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"value": "example@example.com",
"secondary_value": "example.2@example.com"
}
'import requests
url = "https://api.loopreturns.com/api/v1/blocklists"
payload = {
"value": "example@example.com",
"secondary_value": "example.2@example.com"
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 'example@example.com', secondary_value: 'example.2@example.com'})
};
fetch('https://api.loopreturns.com/api/v1/blocklists', 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.loopreturns.com/api/v1/blocklists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'value' => 'example@example.com',
'secondary_value' => 'example.2@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/v1/blocklists"
payload := strings.NewReader("{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
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.post("https://api.loopreturns.com/api/v1/blocklists")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/blocklists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"type": "order",
"value": "example@example.com",
"secondary_value": "example.2@example.com",
"created_at": "2023-06-09 00:00:00"
}{
"errors": "Unauthorized."
}{
"message": "Must be one of the following values: order, product, email, product_tag",
"errors": {}
}Create Blocklist Item
Create a blocklist entry.
Required API key scope
- Orders
curl --request POST \
--url https://api.loopreturns.com/api/v1/blocklists \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"value": "example@example.com",
"secondary_value": "example.2@example.com"
}
'import requests
url = "https://api.loopreturns.com/api/v1/blocklists"
payload = {
"value": "example@example.com",
"secondary_value": "example.2@example.com"
}
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: 'example@example.com', secondary_value: 'example.2@example.com'})
};
fetch('https://api.loopreturns.com/api/v1/blocklists', 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.loopreturns.com/api/v1/blocklists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'value' => 'example@example.com',
'secondary_value' => 'example.2@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/v1/blocklists"
payload := strings.NewReader("{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
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.post("https://api.loopreturns.com/api/v1/blocklists")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/blocklists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"example@example.com\",\n \"secondary_value\": \"example.2@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"type": "order",
"value": "example@example.com",
"secondary_value": "example.2@example.com",
"created_at": "2023-06-09 00:00:00"
}{
"errors": "Unauthorized."
}{
"message": "Must be one of the following values: order, product, email, product_tag",
"errors": {}
}Authorizations
Body
The blocked value. Items purchased using this value will be ineligible for return.
"example@example.com"
The type of value blocked by this blocklist entry. order is the order number of the blocked order, email is the blocked customer's email address, product is the variant ID of the blocked product, and product_tag disables returns for all products with that tag.
order, email, product, product_tag An additional blocked value associated with this entry. Items purchased using this value will also be ineligible for return.
"example.2@example.com"
Response
Success
The unique identifier associated with the blocklist entry.
1
The type of value blocked by this blocklist entry. order is the order number of the blocked order, email is the blocked customer's email address, product is the variant ID of the blocked product, and product_tag disables returns for all products with that tag.
order, email, product, product_tag The blocked value. Items purchased using this value will be ineligible for return.
"example@example.com"
An additional blocked value associated with this entry. Items purchased using this value will also be ineligible for return.
"example.2@example.com"
The date and time at which the entry was created.
"2023-06-09 00:00:00"