Update subscription to end trial period and execute regular billing cycle using PayPal APIs - Stack Overflow

admin2025-04-18  2

I have a subscription for a product with PayPal, such that it has some free trial given for n days. The trial period is on, and I want to end the trial period, and execute the regular cycle for the subscription. What can be done to update the subscription and handle this case?

I hope the approach will trigger webhook by its own.

billing_info: {
      outstanding_balance: { currency_code: 'USD', value: '0.0' },
      cycle_executions: [
        {
          tenure_type: 'TRIAL',
          sequence: 1,
          cycles_completed: 1,
          cycles_remaining: 0,
          total_cycles: 1
        },
        {
          tenure_type: 'REGULAR',
          sequence: 2,
          cycles_completed: 0,
          cycles_remaining: 0,
          current_pricing_scheme_version: 1,
          total_cycles: 0
        }
      ],
      next_billing_time: '2025-02-01T10:00:00Z',
      failed_payments_count: 0
    }

I have tried to use the update subscription API provided in the document, to update value for total_cycles for trial to 0

Update subscription API docs

I have a subscription for a product with PayPal, such that it has some free trial given for n days. The trial period is on, and I want to end the trial period, and execute the regular cycle for the subscription. What can be done to update the subscription and handle this case?

I hope the approach will trigger webhook by its own.

billing_info: {
      outstanding_balance: { currency_code: 'USD', value: '0.0' },
      cycle_executions: [
        {
          tenure_type: 'TRIAL',
          sequence: 1,
          cycles_completed: 1,
          cycles_remaining: 0,
          total_cycles: 1
        },
        {
          tenure_type: 'REGULAR',
          sequence: 2,
          cycles_completed: 0,
          cycles_remaining: 0,
          current_pricing_scheme_version: 1,
          total_cycles: 0
        }
      ],
      next_billing_time: '2025-02-01T10:00:00Z',
      failed_payments_count: 0
    }

I have tried to use the update subscription API provided in the document, to update value for total_cycles for trial to 0

Update subscription API docs

Share Improve this question edited Jan 29 at 15:45 James Z 12.3k10 gold badges27 silver badges47 bronze badges asked Jan 29 at 15:10 Raj ShahRaj Shah 462 silver badges6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I have found the solution for my use case. Instead of updating the subscription, I tried to revise my subscription plan by updating the plan ID.

Referred documentation can be found here: Revise Subscription

转载请注明原文地址:http://www.anycun.com/QandA/1744957877a90026.html