curl --request POST \
--url https://api.1club.ai/v1/platform/transactions/{id}/record-payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodDefinitionId": 123,
"paymentDate": "2023-12-25",
"reference": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/transactions/{id}/record-payment"
payload = {
"paymentMethodDefinitionId": 123,
"paymentDate": "2023-12-25",
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodDefinitionId: 123,
paymentDate: '2023-12-25',
reference: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/transactions/{id}/record-payment', 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.1club.ai/v1/platform/transactions/{id}/record-payment",
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([
'paymentMethodDefinitionId' => 123,
'paymentDate' => '2023-12-25',
'reference' => '<string>'
]),
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.1club.ai/v1/platform/transactions/{id}/record-payment"
payload := strings.NewReader("{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.1club.ai/v1/platform/transactions/{id}/record-payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/transactions/{id}/record-payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"outstanding": 123,
"payment": {
"id": 123,
"status": "succeeded"
},
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"transactionType": "<string>",
"bookingId": 123,
"membershipId": 123,
"contactId": 123,
"clubId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"date": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"paymentStatus": "pending",
"amount": "<string>",
"taxAmount": "<string>",
"totalAmount": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Record a payment for a charge
Records that the member paid what a charge still owes, with one of your organization’s own payment methods - money already taken at the desk, such as cash, a card on your own terminal or a bank transfer. The whole outstanding is recorded, the charge becomes paid and the member is sent a receipt. Nothing is charged: to take the money from a member’s saved card, use charge-saved-card. A method that takes the money itself (Stripe, the Wallet) is refused with 400 TENDER_NOT_RECORDABLE, a charge that owes nothing (or no longer owes what was read, because another payment landed first) with 409 CHARGE_NOT_OWED, one with no contact with 400 CHARGE_HAS_NO_CONTACT, and one a payment is already being taken for, such as a saved card being charged or one whose outcome Stripe has not confirmed, with 409 PAYMENT_IN_PROGRESS: wait for that payment to settle. An API key reaches only the charges of bookings it made through the API; any other charge is a 404.
curl --request POST \
--url https://api.1club.ai/v1/platform/transactions/{id}/record-payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodDefinitionId": 123,
"paymentDate": "2023-12-25",
"reference": "<string>"
}
'import requests
url = "https://api.1club.ai/v1/platform/transactions/{id}/record-payment"
payload = {
"paymentMethodDefinitionId": 123,
"paymentDate": "2023-12-25",
"reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodDefinitionId: 123,
paymentDate: '2023-12-25',
reference: '<string>'
})
};
fetch('https://api.1club.ai/v1/platform/transactions/{id}/record-payment', 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.1club.ai/v1/platform/transactions/{id}/record-payment",
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([
'paymentMethodDefinitionId' => 123,
'paymentDate' => '2023-12-25',
'reference' => '<string>'
]),
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.1club.ai/v1/platform/transactions/{id}/record-payment"
payload := strings.NewReader("{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.1club.ai/v1/platform/transactions/{id}/record-payment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/transactions/{id}/record-payment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodDefinitionId\": 123,\n \"paymentDate\": \"2023-12-25\",\n \"reference\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"outstanding": 123,
"payment": {
"id": 123,
"status": "succeeded"
},
"id": 123,
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"transactionType": "<string>",
"bookingId": 123,
"membershipId": 123,
"contactId": 123,
"clubId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"date": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"paymentStatus": "pending",
"amount": "<string>",
"taxAmount": "<string>",
"totalAmount": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
Response
The charge, paid, with the payment recorded
A billing transaction with amounts, payment status, and links to the originating booking or membership.
What the transaction is for, in English, built from what it links to: the part of the booking it pays for and the visit, the plan and the period it pays for, the product or the check-in; a reversal reads Reversal: ... with the share it gives back. For a settlement, or anything else linked to none of those, it is the text it was created with. Read it as a label, not as an identifier: it follows the records' current names.
Was this page helpful?