Create Payment
curl --request POST \
--url https://api.example.com/wp-json/latepoint-api/v1/payments \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 123,
"amount": 123,
"customer_id": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments"
payload = {
"order_id": 123,
"amount": 123,
"customer_id": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 123,
amount: 123,
customer_id: 123,
processor: '<string>',
payment_method: '<string>',
payment_portion: '<string>',
kind: '<string>',
status: '<string>',
token: '<string>',
notes: '<string>'
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments', 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/payments",
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([
'order_id' => 123,
'amount' => 123,
'customer_id' => 123,
'processor' => '<string>',
'payment_method' => '<string>',
'payment_portion' => '<string>',
'kind' => '<string>',
'status' => '<string>',
'token' => '<string>',
'notes' => '<string>'
]),
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/payments"
payload := strings.NewReader("{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/wp-json/latepoint-api/v1/payments")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Missing required fields: booking_id, amount"
}
Payments
Create Payment
Create a new payment transaction.
POST
/
wp-json
/
latepoint-api
/
v1
/
payments
Create Payment
curl --request POST \
--url https://api.example.com/wp-json/latepoint-api/v1/payments \
--header 'Content-Type: application/json' \
--data '
{
"order_id": 123,
"amount": 123,
"customer_id": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>"
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments"
payload = {
"order_id": 123,
"amount": 123,
"customer_id": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
order_id: 123,
amount: 123,
customer_id: 123,
processor: '<string>',
payment_method: '<string>',
payment_portion: '<string>',
kind: '<string>',
status: '<string>',
token: '<string>',
notes: '<string>'
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments', 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/payments",
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([
'order_id' => 123,
'amount' => 123,
'customer_id' => 123,
'processor' => '<string>',
'payment_method' => '<string>',
'payment_portion' => '<string>',
'kind' => '<string>',
'status' => '<string>',
'token' => '<string>',
'notes' => '<string>'
]),
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/payments"
payload := strings.NewReader("{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/wp-json/latepoint-api/v1/payments")
.header("Content-Type", "application/json")
.body("{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"order_id\": 123,\n \"amount\": 123,\n \"customer_id\": 123,\n \"processor\": \"<string>\",\n \"payment_method\": \"<string>\",\n \"payment_portion\": \"<string>\",\n \"kind\": \"<string>\",\n \"status\": \"<string>\",\n \"token\": \"<string>\",\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Missing required fields: booking_id, amount"
}
Request Body
integer
required
The order ID associated with this payment
number
required
The payment amount
integer
The customer ID (default: 0)
string
Payment processor (default: ‘manual’)
string
Payment method (default: ‘other’)
string
Payment portion (default: ‘full’)
string
Transaction kind (default: ‘capture’)
string
Payment status (succeeded, processing, failed)
string
Payment transaction token from processor
string
Additional notes about the payment
Example Request
POST /wp-json/latepoint-api/v1/payments
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"order_id": 37,
"amount": 50.00,
"processor": "stripe",
"payment_method": "credit_card",
"payment_portion": "full",
"kind": "capture",
"status": "succeeded",
"token": "pi_1234567890abcdef"
}
Example Response
{
"success": true,
"message": "Payment created successfully",
"data": {
"id": "3",
"booking_id": null,
"customer_id": "0",
"processor": "stripe",
"payment_method": "credit_card",
"payment_portion": "full",
"kind": "capture",
"amount": "50",
"status": "succeeded",
"token": null,
"notes": null,
"order_id": "37",
"created_at": "2025-01-21 15:30:00",
"updated_at": "2025-01-21 15:30:00"
}
}
Error Responses
{
"success": false,
"error": "Missing required fields: booking_id, amount"
}
{
"success": false,
"error": "Invalid booking ID provided"
}
⌘I
