Update a browser payment request
Sends a change from the Apple Pay sheet (a new shipping address or shipping option) to the cart. The cart's customer and shipping method change, tax and shipping are worked out again, and the new payment request comes back for updateWith(). Only apple_pay is supported. A closed cart is 422. Any token type may call it; a limited token only for a bound cart.
AuthorizationBearer <token>A secret, trusted or limited token. See Authentication.
cart_id*stringThe id of the cart.
payment_method_type*"apple_pay"The payment method type. Only apple_pay is supported; another valid type is 404, an unknown one 400.
"apple_pay"application/json- body
What changed on the browser's payment sheet. Send it from the shippingaddresschange and shippingoptionchange handlers. The field names follow the W3C Payment Request API.
shippingAddress?The address the shopper picked. It becomes the customer's shipping address, so tax and shipping are worked out again.
shippingOption?stringThe id of the shipping option the shopper picked. It becomes the cart's shipping_method_id.
details?Read but not used.
The browser payment request for the changed cart.
application/json- response
The arguments for the browser's Payment Request API (new PaymentRequest(methodData, details, paymentOptions)) for this cart, built from its items, tax, shipping quotes and required customer fields. Only Apple Pay (apple_pay) is built this way. The field names inside follow the W3C Payment Request API, so they are camel case.
url*stringThe URL of this payment request.
uripayment_url*stringWhere to send the payment when the shopper approves, POST /carts/{cart_id}/payments.
urimethodData*array<>The payment methods the browser may offer.
details*What the payment sheet shows.
paymentOptions*Which shopper details the sheet asks for, from the cart's required customer fields.
merchant_validation_url?stringPresent for Apple Pay. Send the browser's validation URL here from the onmerchantvalidation handler.
uricurl -X POST 'https://api.comecero.com/api/v1/carts/string/user_agent_payment_request/apple_pay' \ -H 'Content-Type: application/json' \ -d '{ "shippingAddress": { "recipient": "John Smith", "addressLine": [ "1 Main St" ], "city": "High Point", "region": "NC", "postalCode": "27265", "country": "US" }, "shippingOption": "standard-us"}'{ "url": "https://api.comecero.com/api/v1/carts/0091307952465CafhFSTa1/user_agent_payment_request/apple_pay", "payment_url": "https://api.comecero.com/api/v1/carts/0091307952465CafhFSTa1/payments", "methodData": [ { "supportedMethods": "https://apple.com/apple-pay", "data": { "version": 1, "merchantIdentifier": "merchant.com.example.shop", "merchantCapabilities": [ "supports3DS", "supportsCredit", "supportsDebit" ], "supportedNetworks": [ "visa", "masterCard", "amex" ], "countryCode": "US", "requiredBillingContactFields": [ "postalAddress" ] } } ], "details": { "displayItems": [ { "label": "PDF Viewer Pro", "amount": { "currency": "USD", "value": "199.90" }, "pending": false }, { "label": "Tax", "amount": { "currency": "USD", "value": "14.99" }, "pending": false } ], "shippingOptions": [ { "id": "digital", "label": "Digital", "amount": { "currency": "USD", "value": "0.00" }, "selected": false } ], "modifiers": [], "total": { "label": "Total", "amount": { "currency": "USD", "value": "214.89" }, "pending": false } }, "paymentOptions": { "requestPayerName": true, "requestPayerEmail": true, "requestPayerPhone": false, "requestShipping": true }, "merchant_validation_url": "https://api.comecero.com/api/v1/carts/0091307952465CafhFSTa1/user_agent_payment_request/apple_pay/merchant_validate"}Retrieve a browser payment request GET
Returns the arguments for the browser's Payment Request API for an Apple Pay checkout on this cart: the method data, the display items, shipping options and total, and which shopper details to ask for. Only `apple_pay` is supported (`404` for another type). Google Pay is set up from the `wallet` payment option in the cart options instead. A currency with no Apple Pay gateway is `400`. Any token type may call it; a limited token only for a bound cart.
Validate the Apple Pay merchant POST
Gets an Apple Pay merchant session for this checkout. Call it from the browser's `onmerchantvalidation` handler with the validation URL Apple gave, then pass `data` to `event.complete()`. Only `apple_pay` is supported. A closed cart is `422`. Any token type may call it; a limited token only for a bound cart.