The "Record Order Payment" API allows to record a payment for an order. Use this endpoint to record payment for an order and update the order status to "Paid".
http
POST https://services.leadconnectorhq.com/payments/orders/{orderId}/record-paymentAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
orderId | string | Yes | 5e2d4c8e0e8b4e001c1c4f5d | Order ID |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | account Id / company Id based on altType |
altType | string | Yes | account | Alt Type Possible values: 'account' |
mode | string | Yes | card | manual payment method Possible values: 'cash', 'card', 'cheque', 'bank_transfer', 'other' |
card | object | No | Details of Card if used for payment | |
cheque | object | No | Details of the Cheque if used for payment | |
notes | string | No | This was a direct payment | Any note to be recorded with the transaction |
amount | number | No | 100 | Amount to be paid against the invoice. |
meta | object | No | Meta data to be recorded with the transaction | |
isPartialPayment | boolean | No | Indicates if the order is intended to be a partial payment. |
Responses
200 - Successful response
success(boolean, required): Success status of the request Example:True
json
{
"success": true
}400 - Order not found
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/record-payment' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "account",
"mode": "card",
"notes": "This was a direct payment",
"amount": 100,
"meta": {},
"isPartialPayment": true
}'const response = await fetch('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/record-payment', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "account", "mode": "card", "notes": "This was a direct payment", "amount": 100, "meta": {}, "isPartialPayment": true}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/record-payment',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "account", "mode": "card", "notes": "This was a direct payment", "amount": 100, "meta": {}, "isPartialPayment": true},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/payments/orders/YOUR_orderId/record-payment');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'account', 'mode': 'card', 'notes': 'This was a direct payment', 'amount': 100, 'meta': {}, 'isPartialPayment': true}),
]);
$data = json_decode(curl_exec($ch), true);