#jen_stilletoz-metadata

1 messages · Page 1 of 1 (latest)

peak jewel
#

How are you trying to add the metadata to the payment objects?

dusk rain
#

export function createInvoiceItem(cus, price, tax_rates,discount,product,taxAmount) {
return key.invoiceItems.create({
customer: cus,
price: price,
tax_rates: [tax_rates],
discounts: [discount],
metadata: {'membership': product, 'taxAmount': taxAmount}
})
.then(function (err, invoiceitem) {
if (err) {
return Promise.resolve(err); //does not work
}
return Promise.resolve(invoiceitem);
})
.catch((err) => {
return err;
});
}

#

this is my backend coding

#

this is the same way i did for createcustomer

peak jewel
#

So that would put metadata on the invoice item that is created but metadata is not usually copied between related objects

#

What object(s) do you want the metadata to be on that are related to that invoice item?

dusk rain
#

i want to pass custom info

#

the product they purchase and the taxamount

#

i want them as metadata

#

cause the client is setting up subscription manually so they want to know the product they purchase through metadata when they export to a csv file

peak jewel
#

On what object?

#

You should be able to do that, you just need to explicitly set it on the object you want it on

dusk rain
#

can you send me an example

peak jewel
#

I am still a bit unclear on where you want it to be set

#

Do you have an example ID of an object that you want this data do be on?

dusk rain
#

in payments in stripe

#

there's a section here as metadata

#

i want to pass this info

#

i followed this api

peak jewel
#

What is the ID of the object from the screenshot?

dusk rain
#

invoice id in_1K3urOAiIteXI5oGOxL7rxcR

peak jewel
dusk rain
#

oh i see

peak jewel
#

Unfortunately not with that call by itself. You'd want to update the invoice and then finalize it

#

Actually you can do it in either order because this is just metadata

patent frost
#

@dusk rain taking over. Just try to call that API and see if it works!