Billing App APIs
Bulk Charge Operations
Process bulk charges (General)
1 min
code examples curl location globoff 'https //{tenant id} {stack base domain}/tms/api/v1/billing/bulk process charge' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "create" \[ { "uniquecode" "chg 20241201 001", "chargehead" "freight charges", "chargetype" "expense", "status" "billable", "indentid" "ind 20241201 001", "transporterid" "trp 001" } ], "update" \[ { "uniquecode" "chg123456789" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "create" \[ { "uniquecode" "chg 20241201 001", "chargehead" "freight charges", "chargetype" "expense", "status" "billable", "indentid" "ind 20241201 001", "transporterid" "trp 001" } ], "update" \[ { "uniquecode" "chg123456789" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //{tenant id} {stack base domain}/tms/api/v1/billing/bulk process charge", 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/bulk process charge") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "create" \[ { "uniquecode" "chg 20241201 001", "chargehead" "freight charges", "chargetype" "expense", "status" "billable", "indentid" "ind 20241201 001", "transporterid" "trp 001" } ], "update" \[ { "uniquecode" "chg123456789" } ] }) response = https request(request) puts response read body import requests import json url = "https //{tenant id} {stack base domain}/tms/api/v1/billing/bulk process charge" payload = json dumps({ "create" \[ { "uniquecode" "chg 20241201 001", "chargehead" "freight charges", "chargetype" "expense", "status" "billable", "indentid" "ind 20241201 001", "transporterid" "trp 001" } ], "update" \[ { "uniquecode" "chg123456789" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // bulk charge processing request accepted { "requestid" "req 123456789", "id" "entity resp 123", "batch request create" "batch create 123", "batch request update" "batch update 123" }// bad request invalid charge data { "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" }// forbidden access denied for some indents { "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" }
