Billing App APIs
Payment Management
Get payments for an invoice
1 min
code examples curl location globoff 'https //{tenant id} {stack base domain}/tms/api/v1/billing/invoice/payments/{invoice id}/' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //{tenant id} {stack base domain}/tms/api/v1/billing/invoice/payments/{invoice id}/", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //{tenant id} {stack base domain}/tms/api/v1/billing/invoice/payments/{invoice id}/") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //{tenant id} {stack base domain}/tms/api/v1/billing/invoice/payments/{invoice id}/" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // payments retrieved successfully { "data" { "payments" \[ { "paymentid" "pay123456789", "invoicenumber" "inv123456789", "paymenttype" "bank transfer", "totalamount" 5000, "appliedamount" 5000, "paymentdate" 1701388800000, "referencenumber" "ref987654321", "paymentstatus" "applied", "bankdetails" { "bankname" "abc bank", "accountnumber" "1234567890", "ifsccode" "abcd0123456" }, "paymentremarks" "payment for invoice inv123456789", "appliedby" "user\@example com", "appliedat" 1701388800000, "createdat" 1701388800000, "updatedat" 1701388800000, "isdeleted" false } ], "totalpaidamount" 15000, "remainingamount" 5000, "paymentcount" 3 }, "message" "success", "status" "success" }// bad request invalid invoice id { "message" "invalid charge id provided", "status" "error", "errorcode" "invalid charge id" }// unauthorized invalid authentication { "message" "invalid charge id provided", "status" "error", "errorcode" "invalid charge id" }// invoice not found or no payments associated { "message" "invalid charge id provided", "status" "error", "errorcode" "invalid charge id" }// internal server error { "message" "invalid charge id provided", "status" "error", "errorcode" "invalid charge id" }
