Create Order
curl --request POST \
--url https://api.example.com/wp-json/latepoint-api/v1/ordersimport requests
url = "https://api.example.com/wp-json/latepoint-api/v1/orders"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/wp-json/latepoint-api/v1/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/orders"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/wp-json/latepoint-api/v1/orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOrders
Create Order
Create a new order.
POST
/
wp-json
/
latepoint-api
/
v1
/
orders
Create Order
curl --request POST \
--url https://api.example.com/wp-json/latepoint-api/v1/ordersimport requests
url = "https://api.example.com/wp-json/latepoint-api/v1/orders"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/wp-json/latepoint-api/v1/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/wp-json/latepoint-api/v1/orders"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/wp-json/latepoint-api/v1/orders")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyRequired Parameters
| Parameter | Type | Description |
|---|---|---|
customer_id | integer | Customer ID |
total | number | Order total amount |
subtotal | number | Order subtotal |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
tax_total | number | Tax amount |
discount_total | number | Discount amount |
coupon_code | string | Applied coupon code |
status | string | Order status |
payment_method | string | Payment method used |
notes | string | Order notes |
coupon_discount | number | Discount amount from coupon |
ip_address | string | IP address of the customer |
source_id | string | Source identifier for tracking |
source_url | string | Source URL for tracking |
confirmation_code | string | Custom confirmation code (auto-generated if not provided) |
Example Request
POST /wp-json/latepoint-api/v1/orders
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"customer_id": 8,
"total": 50.00,
"subtotal": 45.00,
"tax_total": 5.00,
"status": "open",
"payment_status": "not_paid",
"fulfillment_status": "not_fulfilled",
"customer_comment": "Test order creation"
}
Example Response
{
"id": 39,
"confirmation_code": "LP39CONF",
"subtotal": "45.00",
"total": "50.00",
"status": "open",
"fulfillment_status": "not_fulfilled",
"payment_status": "not_paid",
"customer_id": 8,
"coupon_code": null,
"tax_total": "5.00",
"customer_comment": "Test order creation",
"created_at": "2024-12-21 18:15:45",
"updated_at": "2024-12-21 18:15:45"
}
⌘I
