SMM API Cost Reconciliation: Charges, Currency and Remains
An estimate tells you what you expected an order to cost. A status response tells you what the API reported when you checked it. A customer invoice records a separate commercial agreement. Keep those three records separate if you want to explain a difference without guessing.
The AlwaysCompleted API reference includes charge, currency, status and remains in its order-status example. Those fields are useful evidence, but they are not a complete transaction history. This guide builds a small reconciliation ledger around them. The downloadable six-order example is fictional and contains no customer orders or account statement.
Start with an order-level question
Write the question as: “For this order, in this currency, what did we estimate, what has been observed, and what difference still needs an explanation?” Do not begin by subtracting yesterday's balance from today's balance. Other orders, deposits and adjustments can affect an account balance, so that subtraction cannot identify one order's cost by itself.
Keep the returned order ID beside your application's own intent ID. The intent ID belongs to your system; it is not a documented lookup field accepted by this API. Store a quote version, service ID, quantity and the conditions used to calculate the estimate. A catalog snapshot explains the estimate even if a rate later changes. Preserve the service's pricing basis: a package and a quantity-priced service should not be forced into one universal per-thousand formula.
An observation should contain the raw monetary string, its currency, the status, remains and the time collected. Retain previous observations. Replacing yesterday's value with today's leaves you unable to explain when the difference appeared.
Give every amount a clear role
| Amount | What it means in this ledger | What it does not establish |
|---|---|---|
| Original estimate | Your calculation from an identified quote | An accepted final charge |
| Latest API charge | The value observed for that order at a stated time | Every historical balance movement |
| Customer price | Your agreement with the customer | The amount charged to your API account |
| Confirmed adjustment | A separate, documented accounting event | A refund inferred from an unfinished quantity |
The downloadable ledger deliberately includes an open order whose latest charge equals its estimate. Its arithmetic matches, but the report remains provisional because the order has not reached an agreed closing condition. “Difference is zero” and “review is closed” are separate conclusions.
For a manually confirmed adjustment, record the evidence reference and whether that adjustment is already reflected in the latest charge. Otherwise a report can subtract the same credit twice. The DEMO adjustment is an invented accounting scenario, not a claim that the API supplies an adjustment endpoint.
Preserve decimals from the first parse
Python's decimal documentation explains exact decimal construction from strings and explicit rounding. For a decimal amount, pass the API string directly to Decimal. Converting to a binary float first and converting back later does not preserve the original representation.
from decimal import Decimal
estimate = Decimal("0.30000")
observed = Decimal("0.27819")
difference = observed - estimate # Decimal('-0.02181')Store the original string alongside the parsed value. Reject nonfinite values, missing currency and values that violate your application's amount rules. Choose display rounding separately from reconciliation precision. For example, showing two decimal places on a summary does not justify discarding smaller differences in the underlying ledger. Your accounting policy should specify how and when rounding occurs; this article supplies no tax or invoicing rules.
Currency must be checked before subtraction. In the DEMO currency-mismatch row, the estimate is denominated in USD and the observation in EUR. The result is “currency review”, not a numerical variance. Do not silently use a current exchange rate to rewrite a historical estimate. If conversion is needed, record the rate source, timestamp and separate converted amount while preserving both originals.
Use remains to ask a question
The reference shows remains alongside a Partial status. It does not document a universal refund calculation based on that field. Keep remains as observed delivery-status evidence and check the actual service conditions and account records before explaining a financial outcome.
In particular, quantity - remains is not automatically an invoice quantity, a measured business result or an independently verified audience count. A customer-facing statement can say: “The order currently reports Partial and 157 remaining units; the account adjustment is under review.” It should not announce a refund calculated from those units alone.
The same discipline applies when the latest charge differs from the original estimate. First confirm that you matched the right order and currency. Then compare the quote snapshot, observation times and any documented adjustment. A plausible explanation is still an unresolved explanation until evidence supports it.
Work through the six-order ledger
Download the DEMO ledger, blank ledger record, and offline decimal checker. Keep the three files together and run python3 check_cost_ledger.py cost-reconciliation-demo.json. The checker makes no network requests and contains no API key.
The examples cover a matching completed order, a Partial order with a difference, a currency mismatch, an unfinished order, a separately confirmed adjustment and a quote-version difference. The checker calculates only same-currency observed-minus-estimate differences. It preserves the distinction between a matching number and a resolved business question; it does not calculate refunds or convert currencies.
Replace each DEMO object with an actual authorized record when adapting the template. Keep synthetic and real records in different files. Attach evidence to the ledger internally, but remove customer links, credentials and private account details from any public report.
Close a reporting period deliberately
Agree on a cutoff time and retain the observations available at that cutoff. Assign each difference an owner, next action and evidence requirement. A closed item needs either a matching and sufficiently final record or a documented explanation accepted under your reporting process. Open items should carry forward visibly rather than disappearing into a rounded total.
For customer reporting, separate delivered service status, account cost and the customer's campaign outcome. The API status cannot establish sales, qualified leads or incremental listening. Use the developer guide for connection scope and the reseller guide for the commercial workflow. Ask technical support about a specific order discrepancy with the order ID, relevant timestamps and a concise description; never include an API key.
Can the quote and latest charge differ?
They are different observations and should be stored separately. Investigate a difference using the saved quote, order identity, currency and confirmed account evidence instead of automatically treating either number as wrong.
Does a zero difference mean the order is finished?
No. A numerical match says nothing by itself about delivery completion or the timing of later observations. Keep a separate review state.
Should remains determine a refund amount?
Only a documented rule applicable to that service and order could justify such a calculation. This ledger intentionally does not infer it.