Update Payment
curl --request PUT \
--url https://api.example.com/wp-json/latepoint-api/v1/payments/{id} \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>",
"receipt_number": "<string>"
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
payload = {
"amount": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>",
"receipt_number": "<string>"
}
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({
amount: 123,
processor: '<string>',
payment_method: '<string>',
payment_portion: '<string>',
kind: '<string>',
status: '<string>',
token: '<string>',
notes: '<string>',
receipt_number: '<string>'
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments/{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/payments/{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([
'amount' => 123,
'processor' => '<string>',
'payment_method' => '<string>',
'payment_portion' => '<string>',
'kind' => '<string>',
'status' => '<string>',
'token' => '<string>',
'notes' => '<string>',
'receipt_number' => '<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/{id}"
payload := strings.NewReader("{\n \"amount\": 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 \"receipt_number\": \"<string>\"\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/payments/{id}")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 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 \"receipt_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments/{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 \"amount\": 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 \"receipt_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Payment not found"
}
Payments
Update Payment
Update an existing payment transaction.
PUT
/
wp-json
/
latepoint-api
/
v1
/
payments
/
{id}
Update Payment
curl --request PUT \
--url https://api.example.com/wp-json/latepoint-api/v1/payments/{id} \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>",
"receipt_number": "<string>"
}
'import requests
url = "https://api.example.com/wp-json/latepoint-api/v1/payments/{id}"
payload = {
"amount": 123,
"processor": "<string>",
"payment_method": "<string>",
"payment_portion": "<string>",
"kind": "<string>",
"status": "<string>",
"token": "<string>",
"notes": "<string>",
"receipt_number": "<string>"
}
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({
amount: 123,
processor: '<string>',
payment_method: '<string>',
payment_portion: '<string>',
kind: '<string>',
status: '<string>',
token: '<string>',
notes: '<string>',
receipt_number: '<string>'
})
};
fetch('https://api.example.com/wp-json/latepoint-api/v1/payments/{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/payments/{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([
'amount' => 123,
'processor' => '<string>',
'payment_method' => '<string>',
'payment_portion' => '<string>',
'kind' => '<string>',
'status' => '<string>',
'token' => '<string>',
'notes' => '<string>',
'receipt_number' => '<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/{id}"
payload := strings.NewReader("{\n \"amount\": 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 \"receipt_number\": \"<string>\"\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/payments/{id}")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 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 \"receipt_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/wp-json/latepoint-api/v1/payments/{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 \"amount\": 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 \"receipt_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": false,
"error": "Payment not found"
}
Path Parameters
integer
required
The unique identifier of the payment to update
Request Body
number
The payment amount
string
Payment processor (stripe, paypal, square, etc.)
string
Payment method (credit_card, paypal, cash, etc.)
string
Payment portion (full, partial, etc.)
string
Transaction kind (capture, refund, etc.)
string
Payment status (succeeded, processing, failed)
string
Payment transaction token from processor
string
Additional notes about the payment
string
Receipt number for the payment
Example Request
PUT /wp-json/latepoint-api/v1/payments/3
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"amount": 75.00,
"status": "succeeded",
"notes": "Updated payment amount",
"payment_portion": "full",
"kind": "capture"
}
Example Response
{
"success": true,
"message": "Payment updated successfully",
"data": {
"id": "3",
"booking_id": null,
"customer_id": "0",
"processor": "stripe",
"payment_method": "credit_card",
"payment_portion": "full",
"kind": "capture",
"amount": "75",
"status": "succeeded",
"token": null,
"notes": "Updated payment amount",
"order_id": "37",
"created_at": "2025-01-21 15:30:00",
"updated_at": "2025-01-21 15:45:00"
}
}
Error Responses
{
"success": false,
"error": "Payment not found"
}
{
"success": false,
"error": "Invalid payment status provided"
}
{
"success": false,
"error": "Failed to update payment"
}
⌘I
