Pass customer_id to a payment link

Hey @ThingsAreRatherStran!

Customer IDs with the CreatePaymentLink endpoint are derived based on the entered customer information, so the customer_id field in an order won’t apply here.

As far as passing metadata goes, I’d recommend trying something like this:

  1. In your CreatePaymentLink request, set the metadata field in your order. Alternatively, if you’re specifically looking to set an internal customer ID, you can consider using reference_id. Please note that the order created here is an order template, which is not the same order that gets paid in a subscription’s invoice.
  2. Listen for the subscription.created webhook, which will fire when a new subscription is created.
  3. In that webhook body, you’ll find an order_template_id field.
  4. If you retrieve that order_template_id via the Orders API, you’ll get back the order you created for your Payment Link, including metadata and reference_id if those were set.

Let us know if you have any follow up questions!