comecerodocs

Retrieve a browser payment request

GET
/carts/{cart_id}/user_agent_payment_request/{payment_method_type}

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.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

cart_id*string

The 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.

Value in"apple_pay"

Response Body

The browser payment request.

application/json
  1. 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*string

The URL of this payment request.

Formaturi
payment_url*string

Where to send the payment when the shopper approves, POST /carts/{cart_id}/payments.

Formaturi
methodData*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?string

Present for Apple Pay. Send the browser's validation URL here from the onmerchantvalidation handler.

Formaturi
Example Request
curl -X GET 'https://api.comecero.com/api/v1/carts/string/user_agent_payment_request/apple_pay'
Example Response
{  "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"}