Skip to main content
POST
/
label-requests
/
{id}
/
errors
Create Label Request Error
curl --request POST \
  --url https://api.loopreturns.com/api/v1/label-requests/{id}/errors \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "reason": "INVALID_ADDRESS",
  "message": "Failed to generate a label, the origin address is invalid"
}
'
import requests

url = "https://api.loopreturns.com/api/v1/label-requests/{id}/errors"

payload = {
"reason": "INVALID_ADDRESS",
"message": "Failed to generate a label, the origin address is invalid"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reason: 'INVALID_ADDRESS',
message: 'Failed to generate a label, the origin address is invalid'
})
};

fetch('https://api.loopreturns.com/api/v1/label-requests/{id}/errors', 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/label-requests/{id}/errors",
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([
'reason' => 'INVALID_ADDRESS',
'message' => 'Failed to generate a label, the origin address is invalid'
]),
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://api.loopreturns.com/api/v1/label-requests/{id}/errors"

payload := strings.NewReader("{\n \"reason\": \"INVALID_ADDRESS\",\n \"message\": \"Failed to generate a label, the origin address is invalid\"\n}")

req, _ := http.NewRequest("POST", 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.post("https://api.loopreturns.com/api/v1/label-requests/{id}/errors")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"INVALID_ADDRESS\",\n \"message\": \"Failed to generate a label, the origin address is invalid\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.loopreturns.com/api/v1/label-requests/{id}/errors")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"INVALID_ADDRESS\",\n \"message\": \"Failed to generate a label, the origin address is invalid\"\n}"

response = http.request(request)
puts response.read_body
{
  "reason": "INVALID_ADDRESS",
  "message": "Failed to generate a label, the origin address is invalid",
  "created_at": "2023-04-25T13:25:00-05:00"
}
{
"errors": "Unauthorized."
}
{
"message": "The status field is required.",
"errors": {
"status": [
"The status field is required."
]
}
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
integer
required

The unique identifier for the label request, created by Loop.

Example:

67329889100573

Body

application/json
reason
enum<string>
required

The reason code associated with the label request error.

Available options:
INSUFFICIENT_FUNDS,
INVALID_ADDRESS,
Other
Example:

"INVALID_ADDRESS"

message
string | null

The message associated with the label request error.

Maximum string length: 500
Example:

"Failed to generate a label, the origin address is invalid"

Response

Accepted

reason
enum<string>
required

The reason code associated with the label request error.

Available options:
INSUFFICIENT_FUNDS,
INVALID_ADDRESS,
Other
Example:

"INVALID_ADDRESS"

message
string | null

The message associated with the label request error.

Example:

"Failed to generate a label, the origin address is invalid"

created_at
string<date-time>

The date the label was created.

Example:

"2023-04-25T13:25:00-05:00"