Skip to main content
Glama

Create a payment link

order_create_payment_link
Destructive

Create a Stripe embedded-checkout link, only when the customer asks to pay.

The payment link is the order: the customer sees it here for the first time. It attaches each cart line's design and checks its print file. Until the order is paid, a later link attaches a changed design again. Never create it just because the customer picked or finished a design: the link is the order.

Every line needs artwork first: a design, or the customer's own finished file uploaded through order_get_artwork_upload_page. LinesWithoutArtworkError names the lines that have none. A line whose design was made before the product was chosen needs design_adapt first (AdaptStepRequiredError). Each design goes on with its latest version. CheckoutRenderFailedError names a line whose print file failed: that line needs new artwork. Any other failure keeps what was done, so call again once the cause is fixed. NoSnapshotError means a design is not saved yet; a photo book can take a few minutes after it resolves. Wait a little and call this again.

A product this link does not pay for needs a checkout link of its own: other_lines names those products. Tell the customer they need a new checkout link, and call this again when they ask to pay for them. Pass order_id only to pay an order that already had a payment link.

After a line changed, pass the offer the customer chose from its new quote in offer_ids, so the link changes that item on the order.

Returns a job — poll until SUCCEEDED for the checkout_url. Put checkout_url in your reply as a markdown hyperlink (never the raw URL), and call order_get yourself to confirm payment. When the payment card is displayed, it shows a "Pay securely" button wired to the link and polls order_get itself once clicked, so just confirm the payment step is ready and share the link again only if the customer asks for it. From here on, reference_id is the customer's order reference.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>"
    },
    "name": "order_create_payment_link"
  }
}

Input Schema

NameRequiredDescriptionDefault
order_idNo
offer_idsNo
session_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / offer_ids
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / order_id / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / order_id / default
      Added value: +null
    • removedInput schema / properties / order_id / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "session_id",
      -  "order_id"
      -]New value: +[
      +  "session_id"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare destructiveHint=true and idempotentHint=false; the description goes well beyond them by naming concrete failure modes (LinesWithoutArtworkError, AdaptStepRequiredError, CheckoutRenderFailedError, NoSnapshotError) and their recovery paths, plus the retry-safe semantics ("Any other failure keeps what was done, so call again once the cause is fixed"). The one gap is that it never states what the destructiveHint actually invalidates, though "a later link attaches a changed design again" implies replacement of the pending link.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The governing rule is front-loaded and error handling is grouped into a compact block, so the length is mostly earned. Some prose is repetitive, notably the repeated restatement that "the link is the order," which could be trimmed without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the full lifecycle an agent needs despite the 3-parameter, 0%-coverage schema: preconditions, error recovery, the async job contract (poll until SUCCEEDED for checkout_url), how to present the URL as a markdown hyperlink, and the requirement to verify with order_get. The output schema exists, and the description still adds the job-polling workflow rather than duplicating field names.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must carry all parameter meaning, and it mostly does: order_id is limited to paying an order that already has a link, and offer_ids is explained as the customer's chosen offer from a new quote driving the item change. session_id is never mentioned, leaving one of three parameters undocumented in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ("Create a Stripe embedded-checkout link") plus a hard scoping condition ("only when the customer asks to pay"), and immediately reframes what the artifact is: "The payment link is the order." That single framing distinguishes it from order_create, design_start_for_order and the design_* tools without needing their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to call, when NOT to call ("Never create it just because the customer picked or finished a design"), and the prerequisites that route to siblings: artwork via order_get_artwork_upload_page, design_adapt for pre-product designs, and a separate checkout link for products listed in other_lines. It also constrains order_id to an existing payment link, which is precise routing rather than inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources