Update Order
curl --request PUT \
--url https://api.example.com/wp-json/latepoint-api/v1/orders/{id} \
--header 'Content-Type: application/json' \
--data '
{
"total": 123,
"subtotal": 123,
"tax_total": 123,
"discount_total": 123,
"coupon_code": "<string>",
"status": "<string>",
"payment_status": "<string>",
"fulfillment_status": "<string>",
"customer_comment": "<string>",
"notes": "<string>",
"coupon_discount": 123,
"ip_address": "<string>",
"source_id": "<string>",
"source_url": "<string>",
"confirmation_code": "<string>",
"customer_id": 123
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/orders/{id}"
payload = {
"total": 123,
"subtotal": 123,
"tax_total": 123,
"discount_total": 123,
"coupon_code": "<string>",
"status": "<string>",
"payment_status": "<string>",
"fulfillment_status": "<string>",
"customer_comment": "<string>",
"notes": "<string>",
"coupon_discount": 123,
"ip_address": "<string>",
"source_id": "<string>",
"source_url": "<string>",
"confirmation_code": "<string>",
"customer_id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
total: 123,
subtotal: 123,
tax_total: 123,
discount_total: 123,
coupon_code: '<string>',
status: '<string>',
payment_status: '<string>',
fulfillment_status: '<string>',
customer_comment: '<string>',
notes: '<string>',
coupon_discount: 123,
ip_address: '<string>',
source_id: '<string>',
source_url: '<string>',
confirmation_code: '<string>',
customer_id: 123
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/orders/{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.example.com/wp-json/latepoint-api/v1/orders/{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' => 123,
'subtotal' => 123,
'tax_total' => 123,
'discount_total' => 123,
'coupon_code' => '<string>',
'status' => '<string>',
'payment_status' => '<string>',
'fulfillment_status' => '<string>',
'customer_comment' => '<string>',
'notes' => '<string>',
'coupon_discount' => 123,
'ip_address' => '<string>',
'source_id' => '<string>',
'source_url' => '<string>',
'confirmation_code' => '<string>',
'customer_id' => 123
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/orders/{id}"
payload := strings.NewReader("{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}")
req, _ := http.NewRequest("PUT", 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))
}HttpResponse<String> response = Unirest.put("https://api.example.com/wp-json/latepoint-api/v1/orders/{id}")
.header("Content-Type", "application/json")
.body("{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}"
response = http.request(request)
puts response.read_bodyOrders
Update Order
Update an existing order.
PUT
/
wp-json
/
latepoint-api
/
v1
/
orders
/
{id}
Update Order
curl --request PUT \
--url https://api.example.com/wp-json/latepoint-api/v1/orders/{id} \
--header 'Content-Type: application/json' \
--data '
{
"total": 123,
"subtotal": 123,
"tax_total": 123,
"discount_total": 123,
"coupon_code": "<string>",
"status": "<string>",
"payment_status": "<string>",
"fulfillment_status": "<string>",
"customer_comment": "<string>",
"notes": "<string>",
"coupon_discount": 123,
"ip_address": "<string>",
"source_id": "<string>",
"source_url": "<string>",
"confirmation_code": "<string>",
"customer_id": 123
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/orders/{id}"
payload = {
"total": 123,
"subtotal": 123,
"tax_total": 123,
"discount_total": 123,
"coupon_code": "<string>",
"status": "<string>",
"payment_status": "<string>",
"fulfillment_status": "<string>",
"customer_comment": "<string>",
"notes": "<string>",
"coupon_discount": 123,
"ip_address": "<string>",
"source_id": "<string>",
"source_url": "<string>",
"confirmation_code": "<string>",
"customer_id": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
total: 123,
subtotal: 123,
tax_total: 123,
discount_total: 123,
coupon_code: '<string>',
status: '<string>',
payment_status: '<string>',
fulfillment_status: '<string>',
customer_comment: '<string>',
notes: '<string>',
coupon_discount: 123,
ip_address: '<string>',
source_id: '<string>',
source_url: '<string>',
confirmation_code: '<string>',
customer_id: 123
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/orders/{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.example.com/wp-json/latepoint-api/v1/orders/{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' => 123,
'subtotal' => 123,
'tax_total' => 123,
'discount_total' => 123,
'coupon_code' => '<string>',
'status' => '<string>',
'payment_status' => '<string>',
'fulfillment_status' => '<string>',
'customer_comment' => '<string>',
'notes' => '<string>',
'coupon_discount' => 123,
'ip_address' => '<string>',
'source_id' => '<string>',
'source_url' => '<string>',
'confirmation_code' => '<string>',
'customer_id' => 123
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/orders/{id}"
payload := strings.NewReader("{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}")
req, _ := http.NewRequest("PUT", 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))
}HttpResponse<String> response = Unirest.put("https://api.example.com/wp-json/latepoint-api/v1/orders/{id}")
.header("Content-Type", "application/json")
.body("{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"total\": 123,\n \"subtotal\": 123,\n \"tax_total\": 123,\n \"discount_total\": 123,\n \"coupon_code\": \"<string>\",\n \"status\": \"<string>\",\n \"payment_status\": \"<string>\",\n \"fulfillment_status\": \"<string>\",\n \"customer_comment\": \"<string>\",\n \"notes\": \"<string>\",\n \"coupon_discount\": 123,\n \"ip_address\": \"<string>\",\n \"source_id\": \"<string>\",\n \"source_url\": \"<string>\",\n \"confirmation_code\": \"<string>\",\n \"customer_id\": 123\n}"
response = http.request(request)
puts response.read_bodyPath Parameters
integer
required
The ID of the order to update
Request Body Parameters
number
Total amount for the order
number
Subtotal amount for the order
number
Tax amount for the order
number
Discount amount for the order
string
Coupon code applied to the order
string
Order status. Valid values:
open, cancelled, completedstring
Payment status. Valid values:
not_paid, partially_paid, fully_paid, processing, refunded, partially_refundedstring
Fulfillment status. Valid values:
not_fulfilled, partially_fulfilled, fulfilledstring
Customer comment or notes for the order
string
Internal notes for the order
number
Discount amount from coupon
string
IP address of the customer
string
Source identifier for tracking
string
Source URL for tracking
string
Custom confirmation code
integer
Customer ID (can be updated to transfer order to different customer)
Invoice Management
Orders can contain invoices that track payment obligations. When updating orders, you may also need to manage associated invoices.Valid Invoice Statuses
open- Invoice is open and awaiting paymentpaid- Invoice has been fully paidpartially_paid- Invoice has been partially paiddraft- Invoice is in draft statusvoid- Invoice has been voideduncollectible- Invoice is marked as uncollectible
Invoice Update Example
To update an invoice within an order, you can use the dedicated invoice endpoint:PUT /wp-json/latepoint-api/v1/orders/{order_id}/invoices/{invoice_id}
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"status": "paid",
"charge_amount": 55.00
}
When updating invoice status to
paid, ensure that the corresponding payment transactions are properly recorded in the system.Example Request
PUT /wp-json/latepoint-api/v1/orders/39
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"status": "completed",
"payment_status": "fully_paid",
"fulfillment_status": "fulfilled",
"customer_comment": "Order completed successfully",
"total": 55.00
}
Example Response
{
"id": 39,
"confirmation_code": "LP39CONF",
"subtotal": "45.00",
"total": "55.00",
"status": "completed",
"fulfillment_status": "fulfilled",
"payment_status": "fully_paid",
"customer_id": 8,
"coupon_code": null,
"tax_total": "5.00",
"customer_comment": "Order completed successfully",
"created_at": "2024-12-21 18:15:45",
"updated_at": "2024-12-21 18:20:12"
}
⌘I
