The currency code across plan mismatch

UndercoverNL
Contributor
Contributor

Hi there, so I ran in to an issue trying to use the plan creation API from the PayPal docs: https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create

Which works fine, expect for 1 thing, which is setting the currency_code for the pricing_scheme. As when I input EUR, which should be a valid currency ISO string following to: https://developer.paypal.com/reference/currency-codes/ it returns me the following error message: The currency code across plan mismatch

When I use USD as the currency code everything works fine. Anyone an idea why this is happening? Can it be a limitation for testing in sandbox? 

 

Thanks in advance.

Login to Me Too
2 REPLIES 2

MTS_Jennifer
Moderator
Moderator

Hello @UndercoverNL,

Thank you for posting to the PayPal Community.

If you are using a trial period, or a setup fee, make certain that EUR is referenced for the trial period and the regular monthly fee.

 

Here is an example after a product was created (you will need to reference your own product):

{
  "product_id": "PROD-98Y4774918255XXXX",
    "name": "New Plan",
    "description": "My testing plan",
      "billing_cycles": [
        {
          "frequency": {
            "interval_unit": "MONTH",
            "interval_count": 1
          },
          "tenure_type": "TRIAL",
          "sequence": 1,
          "total_cycles": 1
        },
        {
          "frequency": {
            "interval_unit": "MONTH",
            "interval_count": 1
          },
          "tenure_type": "REGULAR",
          "sequence": 2,
          "total_cycles": 12,
          "pricing_scheme": {
            "fixed_price": {
              "value": "15",
              "currency_code": "EUR"
            }
          }
        }
      ],
      "payment_preferences": {
        "auto_bill_outstanding": true,
        "setup_fee": {
          "value": "10",
          "currency_code": "EUR"
        },
        "setup_fee_failure_action": "CONTINUE",
        "payment_failure_threshold": 3
      },
      "taxes": {
        "percentage": "10",
        "inclusive": false
      }
    }

 I just tested in Postman, and was able to create a subscription with no issues using the newly created plan.

This is the full subscription details after subscribing in sandbox:

After I subscribed to the plan in sandbox. 
Response from GET call to https://api.sandbox.paypal.com/v1/billing/subscriptions/I-D7MUY75TXXXX
{
    "status": "ACTIVE",
    "status_update_time": "2023-02-25T21:30:11Z",
    "id": "I-D7MUY75TXXXX",
    "plan_id": "P-04N24679999101356MPXXXX",
    "start_time": "2023-02-25T21:27:12Z",
    "quantity": "1",
    "shipping_amount": {
        "currency_code": "EUR",
        "value": "0.0"
    },
  {{Redacted subscriber information}}
    "billing_info": {
        "outstanding_balance": {
            "currency_code": "EUR",
            "value": "11.0"
        },
        "cycle_executions": [
            {
                "tenure_type": "TRIAL",
                "sequence": 1,
                "cycles_completed": 0,
                "cycles_remaining": 1,
                "total_cycles": 1
            },
            {
                "tenure_type": "REGULAR",
                "sequence": 2,
                "cycles_completed": 0,
                "cycles_remaining": 12,
                "current_pricing_scheme_version": 1,
                "total_cycles": 12
            }
        ],
        "next_billing_time": "2023-02-25T21:27:56Z",
        "final_payment_time": "2024-02-25T10:00:00Z",
        "failed_payments_count": 0
    },
    "create_time": "2023-02-25T21:27:56Z",
    "update_time": "2023-02-25T21:30:11Z",
    "plan_overridden": false,

Thanks,

Jennifer

MTS

PayPal

Login to Me Too

UndercoverNL
Contributor
Contributor

Hello @MTS_Jennifer,

Thanks for your reply in the first place.

 

But I do not have a trial or setup fees, I only have 1 REGULAR monthly cycle which includes:

 

          "pricing_scheme": {
            "fixed_price": {
              "value": "15",
              "currency_code": "EUR"
            }

 

This is the very only place in the request in which I define the currency code, I did leave the payment prefferances to be an empty object as I do not have any prefferances and all its variables aren't required. I am not sure if this might be the cause?

 

Thanks in advance.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.