Skip to content

previewChangePlan: mixed currencies in response with no per-line-item conversion #233

@codeweft

Description

@codeweft

Description

The previewChangePlan response mixes two currencies in a single payload — line items are in USD while the summary is in the customer's adaptive currency (e.g. AUD). There are no converted amounts provided, making it impossible to build a fully localised plan change confirmation UI.

Steps to Reproduce

  1. Enable Adaptive Currency in Business Settings (Test Mode)
  2. Customer billing country: AU — triggers AUD adaptive currency
  3. Products: Pro at $9/mo USD, Teams at $29/mo USD
  4. Call subscriptions.previewChangePlan(subId, { product_id: teamsProductId, proration_billing_mode: "prorated_immediately", quantity: 1 })

Actual Response (abbreviated)

{
  "immediate_charge": {
    "summary": {
      "total_amount": 147,
      "currency": "AUD",
      "settlement_amount": 100,
      "settlement_currency": "USD"
    },
    "line_items": [
      { "name": "Pro",   "unit_price": 900,  "currency": "USD", "proration_factor": -0.9997 },
      { "name": "Teams", "unit_price": 2900, "currency": "USD", "proration_factor": 1.0 }
    ]
  }
}

Problem

  • Line items have currency: "USD" with USD unit_price values
  • The summary total_amount is in AUD (the customer's card currency)
  • The summary settlement_amount is in USD
  • There is no AUD-converted amount on each line item

This means a single response contains three currency contexts (USD line items, AUD card charge, USD settlement) with no per-line-item conversion. It is not possible to show the customer what each proration line is worth in their local currency without implementing exchange rate conversion independently.

Expected Behaviour

Either:

  • Option A: Provide converted unit_price amounts on each line item in the customer's local currency alongside the existing USD values
  • Option B: Document clearly that line items are always in USD and the summary total_amount / currency is the card charge in local currency — so integrators know to display them as separate sections

Environment

  • SDK: dodopayments 2.23.2
  • Mode: Test Mode
  • Adaptive Currency: Enabled
  • Customer billing country: AU (Australia)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions