Skip to main content
API to record manual payment for an invoice by invoice id
POST https://services.leadconnectorhq.com/invoices/{invoiceId}/record-payment

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

invoiceId
string
default:"6578278e879ad2646715ba9c"
required
Invoice 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’
card
object
required
cheque
object
required
notes
string
default:"This was a direct payment"
required
Any note to be recorded with the transaction
amount
number
default:"999"
Amount to be paid against the invoice.
meta
object
paymentScheduleIds
string[]
Payment Schedule Ids to be recorded against the invoice.
fulfilledAt
string
default:"2025-03-19T05:03:00.000Z"
Updated At to be recorded against the invoice.

Respuestas

success
boolean
default:"True"
required
status
invoice
object
required
{
  "success": true,
  "invoice": {
    "_id": "6578278e879ad2646715ba9c",
    "status": "draft",
    "liveMode": false,
    "amountPaid": 0,
    "altId": "6578278e879ad2646715ba9c",
    "altType": "account",
    "name": "New Invoice",
    "businessDetails": {
      "name": "Alex",
      "address": {
        "addressLine1": "9931 Beechwood",
        "city": "St. Houston",
        "state": "TX",
        "countryCode": "USA",
        "postalCode": "559-6993"
      },
      "phoneNo": "+1-214-559-6993",
      "website": "www.example.com"
    },
    "invoiceNumber": "19",
    "currency": "USD",
    "contactDetails": {
      "id": "c6tZZU0rJBf30ZXx9Gli",
      "phoneNo": "+1-214-559-6993",
      "email": "alex@example.com",
      "customFields": [],
      "name": "Alex",
      "address": {
        "countryCode": "US"
      }
    },
    "issueDate": "2023-01-01",
    "dueDate": "2023-01-01",
    "discount": {
      "type": "percentage",
      "value": 0
  // truncado: 23 lineas mas
}
{}
{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/invoices/YOUR_invoiceId/record-payment' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "altId": "6578278e879ad2646715ba9c",
  "altType": "account",
  "mode": "card",
  "card": {
    "brand": "string",
    "last4": "string"
  },
  "cheque": {
    "number": "129-129-129-912"
  },
  "notes": "This was a direct payment",
  "amount": 999,
  "meta": {},
  "paymentScheduleIds": [
    "6578278e879ad2646715ba9c"
  ],
  "fulfilledAt": "2025-03-19T05:03:00.000Z"
}'
const response = await fetch('https://services.leadconnectorhq.com/invoices/YOUR_invoiceId/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", "card": {"brand": "string", "last4": "string"}, "cheque": {"number": "129-129-129-912"}, "notes": "This was a direct payment", "amount": 999, "meta": {}, "paymentScheduleIds": ["6578278e879ad2646715ba9c"], "fulfilledAt": "2025-03-19T05:03:00.000Z"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/invoices/YOUR_invoiceId/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", "card": {"brand": "string", "last4": "string"}, "cheque": {"number": "129-129-129-912"}, "notes": "This was a direct payment", "amount": 999, "meta": {}, "paymentScheduleIds": ["6578278e879ad2646715ba9c"], "fulfilledAt": "2025-03-19T05:03:00.000Z"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/invoices/YOUR_invoiceId/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', 'card': {'brand': 'string', 'last4': 'string'}, 'cheque': {'number': '129-129-129-912'}, 'notes': 'This was a direct payment', 'amount': 999, 'meta': {}, 'paymentScheduleIds': ['6578278e879ad2646715ba9c'], 'fulfilledAt': '2025-03-19T05:03:00.000Z'}),
]);
$data = json_decode(curl_exec($ch), true);