cURL
curl --request PUT \
--url https://api.loyaltylion.com/v2/orders/{merchant_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"total_paid": "99.99",
"total_refunded": "59.99",
"$magento_payload": "<unknown>"
}
'import requests
url = "https://api.loyaltylion.com/v2/orders/{merchant_id}"
payload = {
"total_paid": "99.99",
"total_refunded": "59.99",
"$magento_payload": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({total_paid: '99.99', total_refunded: '59.99', $magento_payload: '<unknown>'})
};
fetch('https://api.loyaltylion.com/v2/orders/{merchant_id}', 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.loyaltylion.com/v2/orders/{merchant_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'total_paid' => '99.99',
'total_refunded' => '59.99',
'$magento_payload' => '<unknown>'
]),
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.loyaltylion.com/v2/orders/{merchant_id}"
payload := strings.NewReader("{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.loyaltylion.com/v2/orders/{merchant_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/orders/{merchant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body""{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Orders
Update Order
PUT
/
v2
/
orders
/
{merchant_id}
cURL
curl --request PUT \
--url https://api.loyaltylion.com/v2/orders/{merchant_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"total_paid": "99.99",
"total_refunded": "59.99",
"$magento_payload": "<unknown>"
}
'import requests
url = "https://api.loyaltylion.com/v2/orders/{merchant_id}"
payload = {
"total_paid": "99.99",
"total_refunded": "59.99",
"$magento_payload": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({total_paid: '99.99', total_refunded: '59.99', $magento_payload: '<unknown>'})
};
fetch('https://api.loyaltylion.com/v2/orders/{merchant_id}', 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.loyaltylion.com/v2/orders/{merchant_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'total_paid' => '99.99',
'total_refunded' => '59.99',
'$magento_payload' => '<unknown>'
]),
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.loyaltylion.com/v2/orders/{merchant_id}"
payload := strings.NewReader("{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.loyaltylion.com/v2/orders/{merchant_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loyaltylion.com/v2/orders/{merchant_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"total_paid\": \"99.99\",\n \"total_refunded\": \"59.99\",\n \"$magento_payload\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body""{
"error": {
"message": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"details": {}
}
}Use this endpoint to update an existing order in LoyaltyLion, using your
internal (from your ecommerce platform)
merchant_id to identify the order.
This is a full update and must include the order’s current payment, cancellation
and refund status, including any relevant totals if required (total_paid and
total_refunded).
The update endpoint is idempotent, so it’s safe to call it every time an order
is updated in your system.Authorizations
ProgramApiKeySiteTokenSecret
An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer token in the Authorization header
Path Parameters
Minimum string length:
1Body
application/json
Body
Available options:
not_paid, partially_paid, paid Available options:
not_refunded, partially_refunded, refunded Available options:
cancelled, not_cancelled The total amount paid for the order as a decimal string without formatting, e.g. 99.99
Example:
"99.99"
The total amount refunded for the order as a decimal string without formatting, e.g. 59.99
Example:
"59.99"
Response
204
The response is of type string.
Allowed value:
""