question

artem avatar image
artem asked artem edited

Pass metadata to hosted checkout

Hi,

We are integrating hosted checkout and I'm looking for a way to pass metadata so that I can correctly identify user and the exact product to unlock in a webhook once purchase is accomplished.

Seem like it's not possible to pass metadata unlike when creating an order directly.


What is the recommended way of mapping the webhook data to the initial purchase?


In my case I need to pass userId and an id to the internal object that holds information about the exact product that was purchased in order to unlock it.


As a workaround, is it possible to create an order and then pass it to a checkout session so that it would use the existing fresh order rather than creating a new one?


I'm using the following endpoint to create a hosted checkout session:

https://apisandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts


And this one to grab the order details in the webhook:

https://apisandbox.dev.clover.com/v3/merchants/{merchantId}/orders/{orderId}?expand=payments&expand=refunds&expand=credits

(expand fields set to reliable get the paymentState field as was mentioned in another thread)


Any help is much appreciated

Orders
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community