Skip to main content
A user credit transaction is a single change to a user credit balance. You post one with POST /v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions and read it with GET /v2/user_credit_transactions/{id}.
A user credit transaction has one state, posted. It exists once Lead accepts it, and it has no status field. Corrections are reversals: new user credit transactions with their own IDs. See Reversals.

Fields

Types

The type sets the rules for the amounts and which blocks of the user credit balance move. “Sign” is the required sign of amount. Any type that carries details.rewards also moves rewards. See The details block.

How the dispute and charge-off blocks move

The dispute and charge_off blocks track amounts that have left the outstanding balance but are not yet settled.
  • A dispute_provisionalfor $50 reduces amount_breakdown by 5000 and raises disputeby5000.
  • A dispute_lost for $50 raises amount_breakdown by 5000 and reduces disputeby5000.
  • A dispute_won for $50 reduces disputeby5000 and leaves amount_breakdown alone, because the provisional credit already reduced it.
Charge-offs follow the same pattern. A charge_off moves the amount from amount_breakdown into charge_off. A charge_off_recovery reduces charge_off only. Send amount_breakdown on every type, including dispute_won and charge_off_recovery. Lead applies the split to the dispute or charge_off block.

The details block

details.card_network

details.rewards

Send both fields whenever you send details.rewards. Lead adds details.rewards.amount to the user credit balance’s rewards block on every type that carries it, not only the three rewards types. To report rewards your customer earned on a card purchase, send details.rewards on the card_network user credit transaction. You do not need a separate rewards_earned transaction. Use rewards_earned for rewards that are not tied to another user credit transaction, such as a sign-up bonus.

Reversals

POST /v2/user_credit_transactions/{id}/reverse undoes a user credit transaction. No request body is needed. Idempotency-Key is required. Lead creates a new user credit transaction and returns it with a 200. The reversal:
  • Has the same type as the original.
  • Negates amount, every amount_breakdown field, details.rewards.amount, and the details.card_network authorization and settlement amounts.
  • Sets details.reversal.original_transaction_id to the original.
  • Sets effective_at to the time of the reversal.
Reversal has these limits:
  • The user credit balance must be active. Otherwise Lead returns a 422 with operation_not_allowed.
  • You can reverse a user credit transaction once. A second reversal with a new Idempotency-Key returns a 409 with operation_not_allowed and the ID of the existing reversal. Retrying with the same key returns the original reversal.
  • You cannot reverse a reversal. To restore an amount, post a new user credit transaction.
  • You cannot reverse a user credit transaction Lead posted, such as funding.

Post and update

POST /v2/user_credit_balances/{user_credit_balance_id}/user_credit_transactions requires an Idempotency-Key header. Without one, a retried request posts a second user credit transaction and double-counts the amount on the user credit balance. See Idempotency. The request body takes these fields from the object: type, description, currency_code, amount, amount_breakdown, details, effective_at, and metadata. Leave out everything else. Lead sets it, and rejects a request that sends it.
  • type, description, currency_code, amount, all three amount_breakdown fields, and effective_at are always required.
  • amount must equal amount_breakdown.principal + amount_breakdown.interest + amount_breakdown.fees, and must have the sign the type requires. See Types.
  • The user credit balance must be active. card_network user credit transactions can also post to inactive and closed user credit balances. Nothing posts to reporting_stopped. Otherwise Lead returns a 422 with operation_not_allowed.
  • Reusing an Idempotency-Key with the same body returns the original user credit transaction. Reusing it with a different body returns a 422 with idempotency_request_inconsistent.
PATCH /v2/user_credit_transactions/{id} changes only the fields you send. You can change:
  • description.
  • metadata. Send "metadata": null to clear it.
  • details.card_network.settlement_date, on card_network user credit transactions only.
Sending any other field returns a 422 with immutable_field. To change amounts, type, or effective_at, reverse the user credit transaction and post a new one. If another request changed the user credit transaction after yours was received, Lead returns a 409 with object_modified_concurrently. Retrieve it and retry.

List user credit transactions

GET /v2/user_credit_transactions returns your user credit transactions with cursor pagination. Filter with these query parameters: GET /v2/user_credit_transactions/{id} returns one user credit transaction. Lead returns a 404 if it does not exist.

Coming from the Transactions file

The User Credit Transactions API replaces the daily Transactions file for credit balances. These are the fields that differ: