RecurringApplicationCharge: "trial_ends_on" is always null

Hey there. At the moment the field “trial_ends_on” always returns null for me, even though I’m starting a trial properly and everything.
My only guess would be that this value is always null when “test” is set to true in the payload? Or because it’s a development store?

I am unable to test certain scenarios in that case until my app hits the app store. Not a problem, but I just want to know for sure what’s causing “trial_ends_on” to be null

I don’t have anything to show, the JSON is straight from the API:

{
   "id":"REMOVED",
   "name":"REMOVED",
   "api_client_id":"REMOVED",
   "price":"10.00",
   "status":"accepted",
   "return_url":"REMOVED",
   "billing_on":null,
   "created_at":"2020-12-28T20:09:36-05:00",
   "updated_at":"2020-12-28T20:09:57-05:00",
   "test":true,
   "activated_on":null,
   "cancelled_on":null,
   "trial_days":14,
   "trial_ends_on":null,
   "decorated_return_url":"REMOVED"
}

And I create charges with the following payload:

{
   "recurring_application_charge":{
      "name":"REMOVED",
      "price":"10.00",
      "return_url":"REMOVED",
      "trial_days":14,
      "test":null
   }
}

Test becomes true depending on which store is trying to install the app. Let me know!

You haven’t activated the charge, so it doesn’t know when to start the trial, so it will be null.

Incredible timing! Just before you commented I tried using the 2021-01 API, and it’s automatically set to active now.

1 Like

This is a nice change in 2021-01, its caught a few people out in the past so glad its finally been fixed!