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”.
POST https://services.leadconnectorhq.com/payments/orders/{orderId}/record-payment
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
orderId
string
default: "5e2d4c8e0e8b4e001c1c4f5d"
required
Order ID
Body
altId
string
default: "6578278e879ad2646715ba9c"
required
account Id / company Id based on altType
altType
string
default: "account"
required
Alt Type Posibles valores: ‘account’
mode
string
default: "card"
required
manual payment method Posibles valores: ‘cash’, ‘card’, ‘cheque’, ‘bank_transfer’, ‘other’
Details of Card if used for payment
Details of the Cheque if used for payment
notes
string
default: "This was a direct payment"
Any note to be recorded with the transaction
Amount to be paid against the invoice.
Meta data to be recorded with the transaction
Indicates if the order is intended to be a partial payment.
Respuestas
200 - Successful response
success
boolean
default: "True"
required
Success status of the request
422 - Unprocessable Entity
Ejemplo
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 );