Skip to main content
Glama

Get Direct Checkout URL

checkout.links.get_direct_url
Read-only

Generate the direct 1-click checkout purchase URL for a specific product handle and size variant index (https://s.polopan.com/p/{handle}/{size_index}).

PURPOSE & DISAMBIGUATION:

WHEN TO USE:

  • ONLY after the user has explicitly selected and confirmed their size (e.g. 'I want size M' or 'size 40').

WHEN NOT TO USE:

  • Do NOT provide direct checkout URLs with /{size_index} during initial product browsing, shortlisting, or if size is ambiguous (use base link https://s.polopan.com/p/{handle}).

BEHAVIOR & SAFETY:

  • Read-only link generator with no persistent state modifications or charges.

  • Automatically resolves variant index if a size string (e.g. 'M', 'L') is provided without size_index.

  • Encodes optional coupon parameters and quantity parameters into the final URL.

PARAMETERS & CONSTRAINTS:

  • 'handle' (string, required): Unique product handle identifier.

  • 'size' (string, optional): Size label confirmed by user (e.g. 'M', 'L', 'XL', '42').

  • 'size_index' (integer >= 0, optional): Zero-based index of the chosen size variant.

  • 'quantity' (integer 1-10, default 1): Number of units to purchase.

  • 'coupon' (string, optional): Optional discount coupon code to pre-apply (e.g. 'SAVE15').

  • 'address_id' (string, optional): ID of specific saved address to prefill.

  • 'address' (object, optional): Delivery address object to prefill directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoSize label confirmed by the user (e.g. 'M', 'L', 'XL', '40')
couponNoOptional discount coupon code to pre-apply in the checkout session
handleYesUnique product handle identifier (e.g. 'solid-linen-shirt', 'shopify_11206')
addressNoOptional ad-hoc address object to prefill
countryNoCountry name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.
quantityNoNumber of units to purchase (1 to 10, default 1)
address_idNoOptional saved address ID to prefill
size_indexNoZero-based index of the chosen size variant

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / address / description
      Previous value: -"Delivery address object to prefill directly into checkout link"New value: +"Optional ad-hoc address object to prefill"
    • addedInput schema / properties / address / properties / zip / minLength
      Added value: +1
    • changedInput schema / properties / address / required
      Previous value: -[
      -  "firstName",
      -  "address1",
      -  "city"
      -]New value: +[
      +  "firstName",
      +  "address1",
      +  "city",
      +  "zip"
      +]
    • addedInput schema / properties / address_id
      Added value: +{
      +  "description": "Optional saved address ID to prefill",
      +  "type": "string"
      +}
    • addedInput schema / properties / country
      Added value: +{
      +  "description": "Country name, city, currency, or 2-letter ISO code (e.g. 'US', 'United States', 'UK', 'Dubai', 'CA', 'IN'). Defaults to active saved region.",
      +  "type": "string"
      +}
    • changedInput schema / properties / coupon / description
      Previous value: -"Optional discount coupon code to pre-apply"New value: +"Optional discount coupon code to pre-apply in the checkout session"
    • changedInput schema / properties / handle / description
      Previous value: -"Unique product handle identifier"New value: +"Unique product handle identifier (e.g. 'solid-linen-shirt', 'shopify_11206')"
    • changedInput schema / properties / quantity / description
      Previous value: -"Number of units to purchase (1-10)"New value: +"Number of units to purchase (1 to 10, default 1)"
    • changedInput schema / properties / size / description
      Previous value: -"Size label confirmed by the user (e.g. 'M', 'L', 'XL')"New value: +"Size label confirmed by the user (e.g. 'M', 'L', 'XL', '40')"
  2. Changed2 schema fields changed
    • addedInput schema / properties / address
      Added value: +{
      +  "description": "Delivery address object to prefill directly into checkout link",
      +  "properties": {
      +    "address1": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "address2": {
      +      "type": "string"
      +    },
      +    "city": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "country": {
      +      "type": "string"
      +    },
      +    "email": {
      +      "type": "string"
      +    },
      +    "firstName": {
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "lastName": {
      +      "type": "string"
      +    },
      +    "phone": {
      +      "type": "string"
      +    },
      +    "province": {
      +      "type": "string"
      +    },
      +    "zip": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "firstName",
      +    "address1",
      +    "city"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "checkout_url": {
      -      "description": "Direct 1-click purchase permalink (https://s.polopan.com/p/{handle}/{size_index})",
      -      "type": "string"
      -    },
      -    "handle": {
      -      "description": "Product handle",
      -      "type": "string"
      -    },
      -    "size": {
      -      "description": "Selected size",
      -      "type": "string"
      -    },
      -    "size_index": {
      -      "description": "Selected size index",
      -      "type": "number"
      -    }
      -  },
      -  "required": [
      -    "handle",
      -    "size_index",
      -    "checkout_url"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.