'How to setup Paypal subscriptions with multiple currencies?
For each product we do the following:
- When a new product is added, create a new Product with
POST /v1/catalogs/products - Using the
product_idfrom step 1, create a new planPOST /v1/billing/plans - Whenever a customer clicks "Subscribe" button, we create a new subscription using
plan_idfrom step 2 withPOST /v1/billing/subscriptions
Problem: When creating the subscription we are able to change the price the customer will be billed by passing the plan object to POST /v1/billing/subscriptions endpoint to override the amount of the plan. However passing in a different currency throws an error:
"The currency code is different from the plan's currency code."
With that being said, is there a way to setup paypal subscriptions where we can pass in a different currency? Is it required to create a new plan for each currency because this does not seem like a good solution
We create a billing plan with the following body:
{
product_id: productId,
name: planName,
status: 'ACTIVE',
billing_cycles: [
{
frequency: {
interval_unit: 'MONTH',
interval_count: 1
},
tenure_type: 'REGULAR',
sequence: 1,
// Create a temporary pricing_scheme. This will be replaced
// with a variable amount when a subscription is created.
pricing_scheme: {
fixed_price: {
value: '1',
currency_code: 'CAD'
}
},
total_cycles: 0
}
],
payment_preferences: {
auto_bill_outstanding: true,
payment_failure_threshold: 2
}
}
We create subscription with the following body (however passing in a different currency than the plan (CAD) throws an error):
{
plan_id: planId,
subscriber: {
email_address: email
},
plan: {
billing_cycles: [
{
sequence: 1,
pricing_scheme: {
fixed_price: {
value: amount,
currency_code: currency
}
}
}
]
},
custom_id: productId
};
Solution 1:[1]
Is it required to create a new plan for each currency
Yes
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Preston PHX |
