Skip to main content
renderForm() renders the buyer-details form used before your backend creates a payment session. It collects data; it does not create an order, contact a gateway, or confirm payment. Create the Elements instance once, then render into a CSS selector or an existing DOM Element.
Calling renderForm() again on the same Elements instance destroys the previous form before mounting the new one. Call form.destroy() or elements.destroy() when your checkout page unmounts.

Customer fields

The package renders these fields in this order. The country selector has keyboard access and search. On narrow screens, the form becomes a single column.

All renderForm() options

Required, optional, and excluded fields

Default-required fields remain visible even if listed in exclude. To omit a default-required field, first make it optional.
This keeps the standard required fields, removes the now-optional phone field plus two optional fields, and makes ZIP/postal code required.
Browser required attributes improve the buyer experience, but they are not your payment validation boundary. Validate every field again in your backend before calling createOrder().

Labels and a compact form

Read the form result

form.value() returns the fields currently rendered by the component. It returns the country name, the phone number in an E.164-style format, and the selected dial code.
If a buyer enters a phone number beginning with +, the package preserves that international number after removing spaces and common punctuation. Otherwise it combines the selected dial code with the entered national number and removes one leading 0 from that local part. Do not use this client-side normalization as proof that a phone number is valid or owned. Apply your own server-side validation and any gateway-specific requirements.

Send details to your backend endpoint

checkout() reads the mounted form automatically and passes its value to the createOrder callback together with the selected gateway, mode, and public providerOptions.
/your-checkout-endpoint is a placeholder for a route in your application. Your backend loads its own order, checks the allowed method against fresh availability, validates customer, and uses the AvraAPI SDK. It must not accept a browser value as the final amount, currency, order ID, gateway environment, or completion authority. Continue with Render Payment Methods.

Visual & Samples

A dedicated Visual & Samples page will provide the approved light and dark examples with the exact code used to create each view. It will be linked here when its visual layout and screenshots are finalized.
Last modified on October 1, 2026