Appearance
Amazon Pay
Amazon Pay
Provider key: Amazon:AmazonPay
Renders: an Amazon Pay button using Amazon Pay Checkout v2.
Options — AmazonPayOptions
Required
| Field | Type | Description |
|---|---|---|
merchantId | string | Amazon Pay merchant ID. |
publicKeyId | string | Public key ID for signature verification. Use SANDBOX- prefix for sandbox. |
currencyCode | string | ISO 4217 currency code (e.g. 'EUR', 'USD'). |
Optional
| Field | Type | Description |
|---|---|---|
locale | string | Checkout UI locale. Accepts collana pay format (de-DE) or Amazon Pay format (de_DE). |
productType | 'PayAndShip' | 'PayOnly' | 'PayAndShip' requires shipping; 'PayOnly' does not. |
placement | 'Home' | 'Product' | 'Cart' | 'Checkout' | 'Other' | Where the button appears in the checkout flow. |
estimatedOrderAmount | number | Estimated order amount in minor units. Gives buyer a price preview. |
region | 'EU' | 'NA' | 'FE' | Amazon Pay SDK region. Determines which checkout.js endpoint is loaded. Default: 'EU'. |
isShippingCustomerDataRequired | boolean | See Checkout Flow Flags. Default: false. |
isBillingCustomerDataRequired | boolean | See Checkout Flow Flags. Default: false. |
Checkout Flow Flags
Amazon Pay supports two combinations of isShippingCustomerDataRequired and isBillingCustomerDataRequired:
isShippingCustomerDataRequired | isBillingCustomerDataRequired | Behaviour |
|---|---|---|
false | false | Express flow (default) — Amazon Pay collects all customer data natively. |
true | true | Amazon Pay skips its native address collection. Shipping and billing data must be provided by the integrator's backend. |
Mixed combinations not supported
Setting one flag to true and the other to false is not supported for this provider and may lead to undefined behaviour.
Style — AmazonPayStyle
| Field | Type | Description |
|---|---|---|
color | 'Gold' | 'LightGray' | 'DarkGray' | Button background color |
size | 'small' | 'medium' | 'large' | Predefined button size |
Example
html
<div id="amazonpay-container"></div>js
const buttons = CollanaPay.ExpressButtons({
providers: [
{
providerProtocolType: 'Amazon',
paymentMethodType: 'AmazonPay',
container: '#amazonpay-container',
style: {
color: 'Gold',
size: 'medium',
},
options: {
merchantId: 'YOUR_AMAZON_MERCHANT_ID',
publicKeyId: 'SANDBOX-ABCXYZ',
currencyCode: 'EUR',
checkoutLanguage: 'de_DE',
productType: 'PayAndShip',
placement: 'Cart',
estimatedOrderAmount: 19300, // €193.00
region: 'EU',
},
},
],
onClick: async (identity, options) => {
const res = await fetch('/api/orders', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ provider: identity }),
});
const transaction = await res.json();
return transaction.checkoutData;
},
onCancel: (identity) => {
console.log('Amazon Pay cancelled', identity);
},
onError: (identity, error) => {
console.error('Amazon Pay error', error);
},
});
buttons.render();Note: Amazon Pay uses a full-page redirect to Amazon's checkout. If the buyer cancels there,
onCanceldoes not fire in the browser — your backend is informed via the collana pay server-to-server cancel callback instead.
