#ddr3ram

1 messages ยท Page 1 of 1 (latest)

glad snowBOT
lament slate
#

Hello

#

code says there is no metadata and discord id isnt definded but i have enterd the discord id on the purchase page a few times 100% and its a required box

hidden flint
#

Hi! Let me help you with this.

lament slate
#

Thanks

hidden flint
#

Could you please share the Subscription ID sub_xxx?

lament slate
#

sure

#

sub_1NL1QtE36rZQjhzLOttwbxds

hidden flint
#

Where are you adding this field?

lament slate
#

in the purchase page

hidden flint
#

I see, the result is saved into one of the related objects. I haven't seen this used with Payment Links yet, so I need a moment to find where the custom fields live.

lament slate
#

Okay thanks

hidden flint
#

Sorry, it's taking some time, it's actually not that straightforward.

lament slate
#

Its fine just happy for any support.

hidden flint
#

I see where it's saved but I am looking for a way you can access it, it's a bit hidden. But it won't be saved in the metadata though.

lament slate
#

Hm how come it doesnt go into metadata tho? its a custom field

hidden flint
#

metadata is meant to be updated via API/Dashboard, but this is entered by customers on the checkout, that's why it's kept separate. But I see what you mean.

lament slate
#

Ah alright thanks for the support so far.

hidden flint
#

We will find it, don't worry!

lament slate
#

Thanks ๐Ÿ˜„

broken oak
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

lament slate
#

Alright, is this a first time this has happend?

broken oak
#

just trying to read through the thread, give me please a second

lament slate
#

Alright take ur time

broken oak
lament slate
#

Yeah but there is no custom fields there

broken oak
#

and then you can check custom_fields[0].numeric.value

lament slate
#

Processing subscription sub_1NL1QtE36rZQjhzLOttwbxds with status trialing
Discord ID: undefined
Error: Discord ID is undefined
Fetching subscriptions...
Subscriptions: {
object: 'list',
data: [
{
id: 'sub_1NL1QtE36rZQjhzLOttwbxds',
object: 'subscription',
application: null,
application_fee_percent: null,
automatic_tax: [Object],
billing_cycle_anchor: 1687341907,
billing_thresholds: null,
cancel_at: null,
cancel_at_period_end: false,
canceled_at: null,
cancellation_details: [Object],
collection_method: 'charge_automatically',
created: 1687255507,
currency: 'gbp',
current_period_end: 1687341907,
current_period_start: 1687255507,
customer: 'cus_O7FwoLBcZh23iR',
days_until_due: null,
default_payment_method: 'pm_1NL1QNE36rZQjhzLKgKZYEd8',
default_source: null,
default_tax_rates: [],
description: null,
discount: null,
ended_at: null,
items: [Object],
latest_invoice: 'in_1NL1QtE36rZQjhzLDKlhGW8V',
livemode: true,
metadata: {},
next_pending_invoice_item_invoice: null,
on_behalf_of: null,
pause_collection: null,
payment_settings: [Object],
pending_invoice_item_interval: null,
pending_setup_intent: null,
pending_update: null,
plan: [Object],
quantity: 1,
schedule: null,
start_date: 1687255507,
status: 'trialing',
test_clock: null,
transfer_data: null,
trial_end: 1687341907,
trial_settings: [Object],
trial_start: 1687255507
}
],
has_more: false,
url: '/v1/subscriptions'
}

#

Discord ID: undefined
Error: Discord ID is undefined

broken oak
#

that's the subscription ID

#

you need to list Checkout Sessions and filter by subscription

#

as I described above

lament slate
#

So i can get the custom field discord id ?

broken oak
#

yes

#

the Custom Fields live on the Checkout Session that created the Subscription

#

and not the Subscription object itself

lament slate
#

Alright let me try.

broken oak
#

what you can do, is using webhooks, specifically the checkout.session.completed event, you can then take the custom_fields and update the subscription's metadata

lament slate
#

you can do that all on the website correct?

broken oak
lament slate
#

alr thanks

broken oak
#

let me know if you need any more help

lament slate
#

Ok thanks