#ibgoldbergs-schedule-metadata

1 messages ยท Page 1 of 1 (latest)

livid lodgeBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

sterile wedge
drifting imp
#

Hmm. We tried this route, but when we created the schedule with one phase AFTER we created the subscription, for some reason there were two phases in the schedule and it didnt seem to work as intended.

Seems odd that theres this limitation of not being able to write metadata to the subscription

sterile wedge
#

Yeah part of the reason is that the subscription might not get created right away (not until the schedule begins)

#

The other option could be to listen to webhooks and update the subscription object separately by calling the API

drifting imp
#

Yeah but when the subscription is created, it should be able to support metadata out of the box. A bit confused about this limitation still.

sterile wedge
drifting imp
#

Are you able to look at a test mode subscription and tell me why there are two phases on this subscription? sub_1OK38BFNVbYFceRMCTWMcDer

Basically I was thinking we could create the subscription withoutout a phased schedule but with the proper metadata and then update the subscription with a 1 phase schedule. However, whenever we did this, it resulted in two phases on the schedule instead of the one we sent.

livid lodgeBOT
sterile wedge
#

hmm not sure, it seems like the call to create the schedule with from_subscription parameter generated two phases automatically

drifting imp
#

yeah but it seems wrong because we were just creating one phase on the schedule

sterile wedge
#

this might be expected, asking a colleague to take a look too.
We will respond as soon as we have something

drifting imp
#

thanks

sterile wedge
#

Looks like the subscription was in a trial period when the schedule was created

#

so the API seem to have created one phase for the trial period, and then one phase for the remainder of the Subscription.

drifting imp
#

Yeah. End result of what we want:

  • 1 phase on the subscription schedule that is a trial
  • schedule end behavior = cancel
#

Is there a better way for us to do this?

Maybe create a subscription that is scheduled to start in the future and then update it with a schedule that will move it to trialing

undone terrace
#

Hello, hanzo had to step out, catching up here....

drifting imp
#

Thanks @undone terrace

undone terrace
#

I'm sorry but I'm still having trouble wrapping my head around your intended behavior here. Is the goal just to have a trialing subscription with a schedule and metadata set on the subscription?

drifting imp
#

End goal:

  • Create a subscription with metadata on the subscription
  • Have one phase on the subscription schedule that is trialing
  • End behavior of the schedule is to cancel subscription
undone terrace
#

And the issues that we are running in to are that schedules don't support metadata, and creating a schedule from a trialing subscription creates two phases?

drifting imp
#

Yeah I tried both routes, and those were the issues. So I have not yet been able to achieve my goal

undone terrace
#

Gotcha, unfortunately I think those are the two best routes here. You'll basically need to create one and then modify the other. So either create a subscription, then create the schedule, then remove the schedule's first phase. Or create the schedule and then directly update the subscription to add metadata

#

Apologies I was going to fast and thought that we had already tried it but am not seeing it brought up in the thread. I think that that param should set metadata on the subscription itself.

drifting imp
#

hmm let me check about this

drifting imp
#

sub_1OKO0UFNVbYFceRM05oSW24X

#

I think it worked

undone terrace
#

Nice! Sorry we initially missed that

drifting imp
#

ended up just being like this:

{
  "customer": "cus_P8DcntHrRM35Jc",
  "default_settings": {
    "collection_method": "charge_automatically",
    "on_behalf_of": "acct_1GBmQYJxD7Yve411"
  },
  "end_behavior": "cancel",
  "expand": {
    "0": "subscription"
  },
  "phases": {
    "0": {
      "end_date": "1702213200",
      "items": {
        "0": {
          "price": "price_1IEJh4FNVbYFceRMMvoqZPF8"
        }
      },
      "metadata": {
        "ovaid": "ovaid-98264017-d154-4bd9-98e5-05be5aeadffa",
        "ovpid": "5319",
        "partner name": "Tutones Custom AV",
        "source": "ov-api",
        "type": "Membership"
      },
      "trial_end": "1702213200"
    }
  },
  "start_date": "now"
}
undone terrace
#

Nice! Thanks for sharing

livid lodgeBOT