# ContractExecutionRecord

A model the API reference uses in a request or a response. The operation pages link every field typed as this model here.

A single execution record for a recurring billing contract, capturing the outcome
of one billing attempt. Stored as part of `executionHistory`
(capped at the most recent 10 entries).

## Fields
- `executedAt` (string(date-time)): The date and time the billing execution was performed.
- `success` (boolean): Whether the billing attempt was approved by the payment processor.
- `amountBilled` (number(double)): The amount charged in this billing execution.
- `transactionId` (string(uuid)): The transaction ID created in the payment engine, if one was created. (nullable)
- `failureReason` (string): An explanation of why the billing execution failed. Null for successful attempts. (nullable)
- `responseCode` (string): The processor response code for this execution. Used for failure classification  against `failureRetryResultCodes`. (nullable)
- `scheduledRunTime` (string(date-time)): The scheduled occurrence time this execution was triggered for.  Used by the Layer 2 idempotency guard to detect duplicate billing for the same  scheduled occurrence. Null for execution records created before this field was added. (nullable)
- `preCreditAmount` (number(double)): The contract amount this cycle was priced at before any proration credit was applied: the  inline per-bill total, or the plan revision in force. Pre-surcharge, so it is the number a  later cycle compares against to detect a mid-cycle price change (`amountBilled`  is the processor's response amount and may include a surcharge). Null on records written  before proration existed; such a record never seeds a proration credit. (nullable)
- `creditApplied` (number(double)): The proration credit taken off this charge, or null when none applied. Zero is never  written; a cycle with no credit leaves the field absent. (nullable)
- `chargedAmount` (number(double)): The contract amount actually submitted for this cycle after the credit:  `preCreditAmount` less `creditApplied`, floored at zero. Pre-surcharge,  like the two fields it derives from. Null on records written before proration existed. (nullable)
- `planPriceId` (string(uuid)): The plan price revision this charge was billed under, or null when the contract carries no  plan and bills its own inline amounts. Null too on records written before the field existed. (nullable)
- `planId` (string(uuid)): The plan the revision in `planPriceId` belongs to. Written together with it, and  null under exactly the same conditions. (nullable)

## See also

- [All documentation](https://devportal.demo.winkpg.io/llms.txt): the machine-readable index of every public page on this site.
