Skip to content

Instantly share code, notes, and snippets.

@jon-by
Last active September 9, 2023 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jon-by/f3da7dbc5f03339252e44a08767ae086 to your computer and use it in GitHub Desktop.
Save jon-by/f3da7dbc5f03339252e44a08767ae086 to your computer and use it in GitHub Desktop.
How to send customData to vtex orderform

First you need to make a new app in your orderform configuration. To do that:

Send a GET request here: https://{{vendor}}.vtexcommercestable.com.br/api/checkout/pvt/configuration/orderForm

Copy the response and change the apps section. Add a new object there

"apps": [
	 {
	  "fields": [
		"YOUR_FIELD"
		],
		"id": "YOUR_APP"
	 }
       ], 
  

Send a POST request on the same endpoint with your updated payload.

After that, you can add custom data using the next method from checkout js:

vtexjs.checkout.setCustomData({app: 'YOUR_APP', field: 'YOUR_FIELD', value: 'VALUE_HERE'});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment