{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","br","details","admonition"]},"type":"markdown"},"seo":{"title":"Billing address","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"billing-address","__idx":0},"children":["Billing address"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn about customisation options for the billing address component."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"styling","__idx":1},"children":["Styling"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"val billingAddressConfig = BillingAddressComponentConfig(\n    fields = BillingAddressFields(\n        countrySelection = CountrySelectionComponentConfig(\n            isRequired = Boolean,\n            availableCountries = List<Country>,\n            defaultCountry = String,\n            showFlags = Boolean,\n            searchPlaceholderText = String,\n            noCountryText = String,\n            style = CountrySelectionStyle?,\n            label = String,\n            placeholder = String,\n            showTrailingIcon = Boolean,\n            showValidIcon = Boolean,\n            validIcon = Int,\n            invalidIcon = Int,\n            showInvalidIcon = Boolean,\n            validations = CountrySelectionValidations\n        ),\n        postcode = PostcodeComponentConfig(\n            isRequired = Boolean,\n            maxLength = Int,\n            style = PostcodeStyle?,\n            validations = PostcodeValidations,\n            label = String,\n            placeholder = String,\n            showTrailingIcon = Boolean,\n            showValidIcon = Boolean,\n            validIcon = Int,\n            invalidIcon = Int,\n            showInvalidIcon = Boolean\n        ),\n        address = AddressComponentConfig(\n            isRequired = Boolean,\n            maxLength = Int,\n            style = AddressStyle?,\n            validations = AddressValidations,\n            label = String,\n            placeholder = String,\n            showTrailingIcon = Boolean,\n            showValidIcon = Boolean,\n            validIcon = Int,\n            invalidIcon = Int,\n            showInvalidIcon = Boolean\n        ),\n        prefillBillingAddressCheckbox = PrefillBillingAddressCheckboxConfig(\n            countrySelectionComponent = CountrySelectionComponent?,\n            postcodeComponent = PostcodeComponent?,\n            addressComponent = AddressComponent?,\n            shippingAddress = ShippingAddress?,\n            checked = Boolean,\n            styles = PrefillBillingAddressCheckboxStyle,\n            label = String\n        )\n    ),\n    allowPrefillBillingAddress = Boolean,\n    layoutMode = BillingAddressLayoutMode,\n    style = BillingAddressStyle?,\n    localisation = BillingAddressLocalisation,\n    displayRequiredIcon = Boolean?\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fields"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["BillingAddressFields?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Configuration for the individual fields."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowPrefillBillingAddress"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to enable prefill from shipping address. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["layoutMode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["BillingAddressLayoutMode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The layout arrangement for the fields. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HORIZONTAL"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["style"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["BillingAddressStyle?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom styling configuration."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["localization"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["BillingAddressLocalization"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The localisation settings."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["displayRequiredIcon"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to display a required icon for required fields."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"callbacks","__idx":2},"children":["Callbacks"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"data class BillingAddressComponentConfig(\n    var onTriggerFieldValidation: ((ValidationResult) -> Unit)? = null,\n    var onValidationPassed: ((List<ValidationResult>) -> Unit)? = null,\n    var onValidationFailed: ((List<ValidationResult>) -> Unit)? = null\n)\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Callback"},"children":["Callback"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onTriggerFieldValidation: (ValidationResult) -> Unit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for or individual field validation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onValidationPassed: (List<ValidationResult>) -> Unit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when all billing address validations pass."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onValidationFailed: (List<ValidationResult>) -> Unit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when any billing address validation fails."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information about callbacks, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/android/card/events"},"children":["Events"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":3},"children":["Examples"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.pxp.checkout.components.billingaddress.BillingAddressFields\nimport com.pxp.checkout.components.address.AddressComponentConfig\nimport com.pxp.checkout.components.countryselection.CountrySelectionComponentConfig\nimport com.pxp.checkout.components.postcode.PostcodeComponentConfig\n\nval customFields = BillingAddressFields(\n    countrySelection = CountrySelectionComponentConfig(\n        label = \"Country of Residence\",\n        isRequired = true,\n        showCountryFlags = true\n    ),\n    postcode = PostcodeComponentConfig(\n        label = \"Postal Code\",\n        isRequired = true,\n        maxLength = 10\n    ),\n    address = AddressComponentConfig(\n        label = \"Street Address\",\n        placeholder = \"123 Main Street, City\",\n        isRequired = true,\n        maxLength = 100\n    ),\n    prefillBillingAddressCheckbox = PrefillBillingAddressCheckboxConfig(\n        label = \"Same as shipping address\",\n        isVisible = true\n    )\n)\n\nval config = BillingAddressComponentConfig(\n    fields = customFields,\n    allowPrefillBillingAddress = true,\n    layoutMode = BillingAddressLayoutMode.VERTICAL,\n    style = customBillingAddressStyle,\n    displayRequiredIcon = true\n)\n\nval billingAddressComponent = checkout.createComponent<BillingAddressComponent, BillingAddressComponentConfig>(\n    type = ComponentType.BILLING_ADDRESS,\n    config = config\n)\n","lang":"kotlin"},"children":[]}]},"headings":[{"value":"Billing address","id":"billing-address","depth":1},{"value":"Styling","id":"styling","depth":2},{"value":"Callbacks","id":"callbacks","depth":2},{"value":"Examples","id":"examples","depth":2}],"frontmatter":{"seo":{"title":"Billing address"}},"lastModified":"2026-02-26T12:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/android/card/billing-address","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}