June 10, 2024
The June 10, 2024 Karbon API release includes a updates for customers using Karbon Billing, including a new API endpoint to make Manual Payments on an Invoice and a new Webhook subscription type for Invoice status changes.
ManualPayments
POST ManualPayments
Endpoint:
https://api.karbonhq.com/v3/ManualPaymentsWhen used with the
POSTRefer to the Manual Payments API documentation for a full example of the response from this endpoint.
Example use case
A payment is taken for an invoice outside of Karbon, a manual payment is created to ensure the outstanding invoice balance is correct and reporting in Karbon is accurate.
You need:
- an for an invoice that has the statusJSONCopied!InvoiceKey- e.g.JSONCopied!AwaitingPaymentJSONCopied!tnl31HQDzRS
- a payment date that is on or after the invoice date and on or before the current date
- a payment amount that is less or equal to the amount owing on the invoice
- an optional reference to include with the payment record
Make a call to
https://api.karbonhq.com/v3/ManualPaymentsJSONCopied!{
    "InvoiceKey" : "tnl31HQDzRS",
    "PaymentMethod" : "Cash",
    "PaymentDate" : "2024-06-10",
    "TotalAmount" : 110.10,
    "Reference" : "Partial payment in Cash"
}
This will create a manual payment and return the response with HTTP
201JSONCopied!{ "@odata.context": "https://api.karbonhq.com/v3/$metadata#ManualPayments/$entity", "InvoiceKey": "tnl31HQDzRS", "PaymentMethod": "Cash", "PaymentDate": "2024-06-10T00:00:00Z", "TotalAmount" : 110.10, "Reference" : "Partial payment in Cash", "PaymentProcessingKey": "8ywNzh9cTgm" }
Notes:
At the time of writing valid values for PaymentMethod are:
Bank TransferDirect DebitCredit Card OnlineCredit Card OfficeCheckCashOtherInvoice Webhook Subscription
POST, GET and DELETE WebhookSubscriptions
Endpoint:
https://api.karbonhq.com/v3/WebhookSubscriptionsThe
WebhookSubscriptionsInvoiceInvoiceAwaitingPaymentPaidVoidedThe following actions will cause a webhook to be triggered, though the status may be the same as a previous instance:
- Partial payments on an invoice
- Moving an invoice between billing runs
Refer to the Webhook Subscriptions API documentation for a full example of the response from this endpoint.
Example use case
Your firm manages a centralised AR ledger and requires all invoices from Karbon Billing to be recorded in this ledger as soon as they are sent to a client, paid by the client or voided.
In order to receive a webhook notification of an Invoice being sent, paid or voided, make a call to
https://api.karbonhq.com/v3/WebhookSubscriptionsJSONCopied!{
    "TargetUrl": "https://example.com/webhook-notifications",
    "WebhookType": "Invoice"
}
This will create a new Webhook Subscription for Invoices and return the response:
JSONCopied!{
    "@odata.context": "https://api-dev.karbonhq.com/v3/$metadata#WebhookSubscriptions/$entity",
    "TargetUrl": "https://example.com/webhook-notifications",
    "WebhookType": "Invoice"
}
Changing the status of an Invoice from within Karbon (e.g. voiding the invoice) or by using the ManualPayments endpoint (above) to completely pay off the invoice
CkyyMTjH6wqJSONCopied!{
  "ResourcePermaKey": "CkyyMTjH6wq",
  "ResourceType": "Invoice",
  "ActionType": "Paid"
}
Note
It is only possible to have one subscription per type of
WebhookSubscriptionContactInvoiceNoteUserWork