Funding and billing
Request reusable advertising credit and track verified payments.
Create a deposit once, then use the verified credit across eligible Meta campaigns. The owner pays in hosted checkout; creating a payment link does not charge a saved card or launch an ad.
Explicit deposit terms
curl https://marketingrouter.com/api/v1/balance/topups \
-H "Authorization: Bearer $MARKETINGROUTER_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: advertising-deposit-001' \
-d '{"deposit_cents":10000,"currency":"USD","funding_terms":"net_deposit_v1"}'
Use a live campaigns:write key or owner session. Deposits are $25–$1,000 in integer USD cents. Read the current minimum, maximum, funding_terms, and availability from GET /api/v1/balance first. Advertiser setup, owner consent, purchasing readiness, funding allowance and deployment gates are checked before checkout. At most ten unresolved top-ups may exist.
A deposit is not a promise of the same amount of advertising credit. Verified payment costs are deducted at cost, without a MarketingRouter markup. Taxes do not buy credit. Exact processing costs are not quoted by this API before payment: they depend on the verified transaction. The owner sees the deposit terms in the dashboard and checkout description, and reviews applicable tax and the total to pay in checkout. Do not tell the owner a $100 deposit guarantees $100 of advertising.
After verification:
deposit_cents: requested deposit subtotal.funding_terms: immutablenet_deposit_v1for new deposits.charged_cents: provider payment total including tax, excluding any separate buyer fee. The provider receipt contains any additional buyer fee and full card statement amount.tax_cents: verified tax, excluded from credit.payment_cost_cents/processing_cost_cents: verified seller payment costs deducted from the deposit. Null means unknown, not zero.credited_cents: current spendable credit created by this receipt. Use it only withstatus: funded.processing_cost_payer: customer: costs reduce the deposit before credit is granted.
Credit equals the verified provider net proceeds after tax and seller payment costs. For example, a hypothetical $100 deposit with $25 exclusive tax and $8.53 payment costs creates $91.47 credit, not $100. This is an accounting example, not a quote. If tax is included in the deposit, it is also deducted before credit. A refund, dispute, duplicate paid receipt or later change to the credited net amount places the receipt and workspace on review; retries cannot remove that hold.
The separate campaign service fee is 5% of actual ad spend. It is not charged on the deposit. A $100 media plan reserves $105 of verified credit; unused fee reserves remain subject to final reconciliation. Read GET /api/v1/campaigns/{id}/billing for campaign accruals. Payment costs must not be confused with that service fee.
Owner checkout and retry safety
Give next_action.url to the owner. Poll GET /api/v1/balance/topups/{id} with bounded backoff (2, 4, 8, then 30 seconds), or POST its /reconcile endpoint to retrieve the original payment. Only funded establishes credit. A redirect or browser success message never does.
Keep the exact body and Idempotency-Key on timeout or outcome_unknown. Do not create a replacement payment. Normal payment updates arrive automatically through our authenticated webhook; customers and agents do not configure it. No automatic refill or off-session charging mandate is created.
States: creating, checkout_ready, payment_pending, funded, outcome_unknown, failed, review_required. Pending can be skipped. Review requires operator resolution, not a new payment. Stored card setup is optional and separate; see saved payment methods.
Read and verify the balance
GET /api/v1/balance and GET /api/v1/balance/topups require a live campaigns:read key. Top-ups paginate 50 at a time; follow next_cursor until null. The authenticated workspace determines ownership; a foreign receipt returns 404. Sandbox keys never access real balances.
Available credit = funded − reserved − spent, or zero during a funding hold. Launch reserves media and the maximum campaign service fee atomically. Recorded costs move from reserved to spent. Pausing keeps unused reserves; closing permanently prevents restart and requires final billing verification before unused credit is released. Wallet credit release is not a card refund.
For many receipts, POST /api/v1/balance/reconcile with no body. Each call advances a durable workspace review by up to five receipts. Follow retry_after_seconds while pending (HTTP 202); GET reads progress without provider calls. Ready reviews remain fresh for five minutes after completion and at most thirty minutes after starting. New unscanned credit or an adverse receipt overrides readiness. The scheduled worker also advances the review. A review never grants spending authority.
On funding_verification_pending, follow error.details and retry the original approval only after the review is ready. For campaign controls, read performance and retain any unresolved command's exact key/body. Terminal failures require a new key and current control revision.
Funding, owner budget approval, operator allocation and provider purchasing capacity remain separate checks. Processor settlement delays and reserves do not establish available Meta purchasing funds. Creative generation uses a separate workflow and does not debit advertising credit.
Historical receipts and API migration
Existing receipts remain fixed_credit_v1. They retain their promised requested_credit_cents; MarketingRouter covers those receipts' seller processing costs. They are never silently converted to net deposits. amount_cents is a deprecated request-amount alias: use deposit_cents for new orders or requested_credit_cents for historical promises.
The legacy {amount_cents,currency} request is accepted only to replay an existing request using its original Idempotency-Key and exact amount, including the $1 pilot. A new legacy request returns funding_terms_changed. Change to explicit deposit terms with a fresh key only when no original payment is pending.
New direct campaign checkout requests return balance_deposit_required. Fund the balance instead, then approve the exact campaign plan and total. Historical campaign checkouts remain readable and reconcilable through /api/v1/funding; their original request keys can be replayed. Never fund the same intended spend twice.
Acquisition-cost reporting
Service fees and deposit payment costs are reconciled automatically as verified media spend is recorded. Credit from the oldest funded deposit is consumed first, including the campaign service fee. Each campaign receives only the proportional payment cost of the credit it consumes; cent rounding is conserved across campaigns. These costs were already deducted at deposit and are never charged again. Downward corrections return that campaign’s allocation without changing another campaign’s costs. Unspent credit keeps its remaining payment-cost allocation. Historical fixed-credit receipts carry zero customer payment cost because MarketingRouter covered processing. Funding taxes and the advertised product’s checkout fees are excluded.
Read GET /api/v1/campaigns/{id}/billing for payment_cost_status, payment_cost_cents, payment_cost_allocated_credit_cents, payment_cost_observed_at and payment_cost_method: fifo_credit_slices_v1. Read /economics for media + service fees + allocated payment costs and cost per paying customer. service_reconciled requires matching verified billing and payment-cost allocation. Missing cost sources return null with payment_cost_allocation_pending; reconcile campaign delivery and retry. A reversed or changed funding receipt produces payment_cost_review_required and requires operator resolution. Never interpret null as zero or pay again to clear a review.
Fit a new campaign to verified credit
After a top-up becomes funded, read GET /api/v1/balance. media_capacity gives the largest media budget that the currently available credit can cover under the new-campaign pricing version, plus maximum_service_fee_cents, total_reservation_cents and remaining_credit_cents. The service fee rounds up once on cumulative media spend. Already-deducted deposit payment costs are not deducted again.
For example, 2500 cents of verified available credit covers 2380 cents of media plus 119 cents of service fees, leaving one cent. A 2500-cent deposit is not the same as 2500 cents of verified credit: payment costs and tax may reduce the credit. Use the verified balance response, not the checkout redirect or requested deposit amount.
This is a wallet calculation only (basis=available_credit_only, authorizes_spending=false). It does not check network minimums, campaign schedule, request limits or remaining operator allowance, reserve money, change historical campaign fees or approve a launch. A held wallet returns zero capacity. Other campaigns and refunds may change availability immediately after this read; approval rechecks funds atomically.
Choose a budget no greater than this capacity, then validate it through the quote/campaign API and GET /api/v1/readiness?campaign_id=ID. Network minimums still apply, and live daily budgets remain unavailable without a provider-enforced total cap. If available credit cannot cover the intended plan, propose a smaller valid unapproved plan or an owner-authorized deposit. Do not silently change an approved campaign or increase spending authority.