ASCI API

| Home | Swagger | All Forms | Documentation | HTS →

Pending Charges (billing) module page - how the store works, the endpoint reference, the charge fields, the settlement pipeline status, and the settlement writeback feed. See All Forms for the combined surface or Home for the module index.

How it works

Pending-charges store + settlement read-model for the billing pipeline.

Pending Charges

The Pending Charges module is the API-side read-model of the legacy IPCHR pending charges (doc type PCHG), tenant-scoped.

The direction of traffic is:

The billing routes and identifiers are deliberately provider-neutral - "charges", not any biller's name - so the payment provider can be swapped without a contract change. The payee is resolved against the A/P Vendors master (vendor_code). This module is ASCI only.

Settlement pipeline

Provider-neutral outbound settlement channel.

Settlement status

Outbound settlement is sent through our payment provider. The send is via a pluggable outbound handler selected by channel, so the route surface does not change when the provider does:

ChannelHandlerStatus
charges.pendingthe outbound payment handlerSTUB. The payment-provider client (send + auth) is pending the provider's API spec - not yet wired to a live endpoint.
Pending the payment provider's API spec. The outbound send path is a stub today; the pending-charges store, the /api/Charges/* read model, and the settlement writeback feed are in place and work independently of which provider ultimately settles. The vendor → payee mapping is held in a provider-neutral vendor→payee map.

Endpoints

Pending Charges endpoint family (api/Charges).

Charges endpoints

MethodPathScopeDirectionPurpose
POST/api/Charges/Importipjson.submitASCI → APIPush a batch of pending charges. Idempotent UPSERT on (ref_no, seq_no); mode = add|replace. Returns { mode, inserted, updated, skipped, errors }.
GET/api/Chargesqueue.readreadList pending charges. Filters: ?status=&vendor_code=&customer_id=&limit=. Returns {count, rows}.
GET/api/Charges/{refNo}/{seqNo}queue.readreadFetch a single charge by ref_no + seq_no. 404 if absent.
GET/api/Charges/Settlementsqueue.readAPI → ASCISettlement writeback feed the ASCI side polls. Returns charges carrying a provider settlement (default: non-empty settlement_status). Filters: ?status=&settlement_status=&limit=.

Schema

The charges[] element of POST /api/Charges/Import. Batch shape: { mode, charges[] }. The same fields are returned by the GET read endpoints, plus provider-settlement fields.

Charge record

FieldTypeReq?Description
ref_nostringYesCH_REF_NO (key).
seq_nostringYesCH_SEQ_NO (key).
vendor_codestringNoA/P vendor code (payee). Resolves against the Vendors master.
charge_codestringNoCharge code.
record_typestringNoRecord type.
amountnumberNoCharge amount.
billedstringNoBilled flag.
customer_idstringNoCustomer id.
check_nostringNoCheck number.
datestringNoCharge date.
vendor_namestringNoVendor name (denormalized).
payment_typestringNoPayment type.
awb_bl_nostringNoAWB / B-L number.
statusstringNoOptional initial status (defaults to pending).
Settlement writeback fields (GET /api/Charges/Settlements)
FieldTypeDescription
ref_no / seq_nostringCharge key, echoed back.
statusstringCharge status.
provider_payment_idstringProvider-assigned payment id.
paid_amountnumberAmount the provider settled.
paid_datestringProvider settlement date.
settlement_statusstringProvider settlement status (the feed filter key).
settlement_rawstringRaw provider settlement payload, stored verbatim.
updated_atstringLast-updated timestamp.