<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ApplePayontheWeb",
  "identifier" : "/documentation/ApplePayontheWeb/ApplePaySession/completeShippingContactSelection",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Pay on the Web"
    ],
    "preciseIdentifier" : "instm/ApplePaySession/completeShippingContactSelection"
  },
  "title" : "completeShippingContactSelection"
}
-->

# completeShippingContactSelection

Completes the selection of a shipping contact with an update.

```
undefined completeShippingContactSelection(
	unsigned short,
	ApplePayLineItem newTotal,
	sequence<ApplePayLineItem> newLineItems
);
```

## Discussion

This method must be called by [`onshippingcontactselected`](/documentation/ApplePayontheWeb/ApplePaySession/onshippingcontactselected).

In Apple Pay JS API version 3, the parameter is an [`ApplePayShippingContactUpdate`](/documentation/ApplePayontheWeb/ApplePayShippingContactUpdate).

### completeShippingContactSelection in Apple Pay JS version 1 and 2

In version 1 and 2 of the Apple Pay JS API, [`completeShippingContactSelection`](/documentation/ApplePayontheWeb/ApplePaySession/completeShippingContactSelection) has the following parameters:

|status            |The status of the shipping contact update. For valid values, see <doc://com.apple.documentation/documentation/ApplePayontheWeb/apple-pay-status-codes>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|newShippingMethods|A sequence of ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayShippingMethod`` dictionaries that represents shipping costs (if any).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|newTotal          |An ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayLineItem`` dictionary representing the total price for the purchase. Set the ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayLineItem/label`` to the merchant’s name, and the ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayLineItem/amount`` to the total price. The amount must be greater than zero.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|newLineItems      |A sequence of ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayLineItem`` dictionaries. Use ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayLineItem`` dictionaries to represent all other costs or discounts. Do not use line items to represent the individual items purchased by the user. Instead, combine all the purchases into a single subtotal item. Use additional line items to represent other costs or discounts (tax, shipping, coupons, and so forth.). If you do not have any additional costs or discounts, do not use this argument. Set the ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayPaymentMethodUpdate/newTotal`` argument with the total cost of all the purchased items, and either pass an empty array or null for ``doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayShippingContactUpdate/newLineItems``.|

## See Also

[`supportsVersion`](/documentation/ApplePayontheWeb/ApplePaySession/supportsVersion)

Detects whether a web browser supports a particular Apple Pay version.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)