#amfpaulo_api

1 messages ¡ Page 1 of 1 (latest)

mystic meadowBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1409891229524688958

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

zealous harness
#

Hello @quasi onyx

quasi onyx
#

Hey there. what is not working like you expect here?

zealous harness
#

I am ground zero, I have no idea if this is possible

#

Documentation is confuse

#

I tried this and got this error:

#

var paymentLinkService = new PaymentLinkService();
var paymentLink = await paymentLinkService.CreateAsync(new PaymentLinkCreateOptions
{
LineItems = new List<PaymentLinkLineItemOptions>
{
new PaymentLinkLineItemOptions
{
Price = request.PriceId,
Quantity = 1
}
},
SubscriptionData = new PaymentLinkSubscriptionDataOptions
{
Metadata = new Dictionary<string, string>
{
{ "student_id", request.StudentId.ToString() },
}
},
CustomerCreation = "if_required",
Metadata = new Dictionary<string, string>
{
{ "student_email", email },
{ "student_id", request.StudentId.ToString() }
}
});

#

ERRRO: "customer_creation can only be used if the payment link does not contain any recurring prices."

quasi onyx
#

What are you your trying to do / figure out if it is possible?

zealous harness
#

I thougt it was the oposite looking the docs

#

I need to send to a current client a payment link to a subscription

#

Its a client the had membership expired he ask for a link to start a new membership, but I do not want another client being created

#

and stripe creates new clients using same email

quasi onyx
#

Payment Links have no way to link to existing customers, they always create new customers when a customer is required

zealous harness
#

I see, thank you. So the checkou session using the api will generate a link right , that I can send to the client and they can just pay , correct ?

quasi onyx
#

Yes, but note that the session url is only valid for 24h, not indefinitely like a payment link

#

so you either need tob e clear about this in whatever contact your send, or alternatively create it on demand when they visit a page you control and you can redirect them to the hosted session

zealous harness
#

Ok, got it, perfect, thank you