This API object is provided to extensions registered for the `Checkout::ShippingMethodDetails::RenderAfter` or `Checkout::ShippingMethodDetails::RenderExpanded` extension points. It extends the [StandardApi](/docs/api/checkout-ui-extensions/apis/standardapi), provides a [target](#properties-propertydetail-target) object with information about the shipping method the extension is attached to, and a [targetSelected](#properties-propertydetail-targetselected) boolean indicating whether the shipping method is currently selected in the UI.
import React, {useState} from 'react';
import {
render,
Text,
useExtensionApi,
useSubscription,
} from '@shopify/checkout-ui-extensions-react';
render(
'Checkout::ShippingMethodDetails::RenderAfter',
() => ,
);
function Extension() {
const {target, targetSelected} =
useExtensionApi();
const {title} = useSubscription(target);
const selected = useSubscription(
targetSelected,
);
return (
Shipping method: {title} is{' '}
{selected ? '' : 'not'} selected.
);
}
import {extend} from '@shopify/checkout-ui-extensions';
extend(
'Checkout::ShippingMethodDetails::RenderAfter',
(root, {target, targetSelected}) => {
const titleText = root.createText(
`Shipping method title: ${target.current.title}`,
);
root.appendChild(titleText);
target.subscribe((updatedTarget) => {
titleText.updateText(
`Shipping method title: ${updatedTarget.title}`,
);
});
const selectedText = root.createText(
getSelectedText(targetSelected),
);
root.appendChild(selectedText);
targetSelected.subscribe(
(updatedSelected) => {
selectedText.updateText(
getSelectedText(updatedSelected),
);
},
);
function getSelectedText(selected) {
return selected
? 'Selected'
: 'Not selected';
}
},
);
See the [StandardApi examples](/docs/api/checkout-ui-extensions/apis/standardapi#examples) for more information on how to use the API.
The shipping option the extension is attached to.
Whether the shipping option the extension is attached to is currently selected in the UI.
Represents a delivery option that is a shipping option.
The type of this delivery option.
Information about the carrier.
The cost of the delivery.
The cost of the delivery including discounts.
Information about the estimated delivery time.
The unique identifier of the delivery option.
The title of the delivery option.
The description of the delivery option.
The name of the carrier.
The price amount.
The ISO 4217 format for the currency.
'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL'
The estimated time in transit for the delivery in seconds.
The lower bound of the number range.
The upper bound of the number range.