snailgram Developer center

A LITTLE CODE. A REAL CONNECTION.

From your app.
To their letterbox.

Give your app or AI assistant a way to send something that matters. Find a card, check delivery and turn the sender’s words into real ink on paper.

Public MCPStripe or USDCPosted from Australia
01

HELLO, LETTERBOX

Your first request

Find a cover without creating an account. The public MCP endpoint accepts JSON-RPC over Streamable HTTP and returns JSON. All examples below call production.

curl https://snailgram.com.au/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_cards","arguments":{"query":"birthday","limit":3}}}'

Read the results at result.structuredContent.cards. Use a card’s id for API orders, or its personalise link to open the studio.

Let the person finish in the studio.

Call start_card with a card_id or a cover description. Return the link so they can write their message, add the address and pay through Stripe.

02

CONNECT AN ASSISTANT

MCP reference

Add the following URL to any client that supports remote MCP over Streamable HTTP. Authentication is not required.

POSThttps://snailgram.com.au/mcp

Clients initialize with initialize, send notifications/initialized, then discover schemas with tools/list. Supported protocol versions: 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. The server is stateless: no session ID is needed and GET returns 405.

Client configuration · remote HTTP
{
  "mcpServers": {
    "snailgram": {
      "url": "https://snailgram.com.au/mcp"
    }
  }
}

Configuration keys vary by client. Use the remote HTTP connection option and the URL above.

search_cardsSearch ready-made cards

Search Snailgram's ready-made greeting cards by words (forgiving typos, e.g. "30th birthday", "cat", "christmas") and/or occasion. Each result has a cover image, a details page and a link to personalise it. Every card costs A$8.99 with regular post (untracked) anywhere in Australia included; tracked Express Post is A$8 more. If nothing fits, start_card can make a new cover from a description.

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "maxLength": 200,
      "description": "Words to search for. Leave out to list cards."
    },
    "occasion": {
      "type": "string",
      "enum": [
        "thinking",
        "birthday",
        "love",
        "christmas",
        "congrats",
        "fun"
      ],
      "description": "Only cards for this occasion."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 10
    }
  },
  "additionalProperties": false
}
delivery_datesDelivery dates

When a card ordered now is posted and the earliest day it can arrive at an Australian postcode, counting business days and public holidays. The dates are for Express Post; regular post usually takes about three business days more. Give arrive_by to learn the last day to order for that date, and whether it can still make it. For a card overseas there is no postcode: it goes by International post (untracked) and usually arrives 15 days or more after the posting day this gives.

{
  "type": "object",
  "properties": {
    "postcode": {
      "type": "string",
      "pattern": "^\\d{4}$",
      "description": "The recipient's 4-digit Australian postcode."
    },
    "arrive_by": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Optional date it should arrive by, YYYY-MM-DD."
    }
  },
  "required": [
    "postcode"
  ],
  "additionalProperties": false
}
start_cardStart a card

A link to the Snailgram studio where the person finishes their card: either a ready-made card (card_id from search_cards) or a new cover made from a one-sentence description. In the studio they write their own message, enter the address, choose the arrival day and pay. Give them the link; this tool orders nothing.

{
  "type": "object",
  "properties": {
    "card_id": {
      "type": "string",
      "description": "A ready-made card's id, from search_cards."
    },
    "cover": {
      "type": "string",
      "maxLength": 140,
      "description": "Or a one-sentence description of a new cover, e.g. \"a corgi in a party hat surfing at Bondi\". Not the message inside."
    }
  },
  "additionalProperties": false
}
buy_cardBuy a card with Stripe or USDC

Prepare the HTTP request to buy a ready-made card or use the person's own image. Choose payment stripe to POST for a hosted payment_url that the buyer opens to pay in AUD through Stripe (Link when enabled). Or choose usdc (default) for an x402 client to pay USDC on Base. A$8.99 posted in Australia; Express Post A$8 more, International post A$6 more. Confirm the recipient, message and price first. This tool only returns a request: it creates no order and pays nothing. Preserve the returned Idempotency-Key for Stripe retries.

{
  "type": "object",
  "properties": {
    "payment": {
      "type": "string",
      "enum": [
        "usdc",
        "stripe"
      ],
      "default": "usdc",
      "description": "stripe returns a request for a buyer-paid checkout URL; usdc returns an x402 purchase request."
    },
    "card_id": {
      "type": "string",
      "description": "A ready-made card's id, from search_cards. Leave out to use the person's own image."
    },
    "message": {
      "type": "string",
      "maxLength": 800,
      "description": "The message written inside, in the sender's own words, up to 160 characters on a fun size card. Never write it for them."
    },
    "sign_off": {
      "type": "string",
      "maxLength": 40,
      "description": "Optional, like \"Love, Sam\"."
    },
    "sender_name": {
      "type": "string",
      "maxLength": 100,
      "description": "Who it's from, for the envelope."
    },
    "email": {
      "type": "string",
      "description": "The buyer's email, for the receipt and tracking."
    },
    "recipient": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "street": {
          "type": "string"
        },
        "suburb": {
          "type": "string",
          "description": "Suburb, or town or city overseas."
        },
        "state": {
          "type": "string",
          "description": "In Australia: NSW, VIC, QLD, WA, SA, TAS, ACT or NT."
        },
        "postcode": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "Two-letter code; AU if left out."
        }
      },
      "required": [
        "name",
        "street",
        "suburb"
      ]
    },
    "postage": {
      "type": "string",
      "enum": [
        "regular",
        "express",
        "international"
      ],
      "description": "regular (untracked, the default in Australia), express (tracked), or international (overseas)."
    },
    "arrive_by": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Optional YYYY-MM-DD; defaults to the earliest."
    },
    "handwriting": {
      "type": "string",
      "description": "Optional handwriting style; easy (the default) or quick are always offered."
    },
    "card_size": {
      "type": "string",
      "enum": [
        "5x7",
        "fun"
      ],
      "description": "5x7 (default) or fun, 2″ × 3″."
    }
  },
  "required": [
    "message",
    "sender_name",
    "email",
    "recipient"
  ],
  "additionalProperties": false
}
about_snailgramAbout Snailgram

The facts about Snailgram: price, card sizes, covers, message length, delivery, tracking, payment, privacy and contact. Use it rather than guessing.

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

Download the complete tool schemas. Successful calls return result.structuredContent and a text copy in result.content. Tool validation failures return result.isError: true; JSON-RPC errors use the top-level error object. Check both even on HTTP 200.

03

GIVE IT A GO

Tool explorer

Run a public tool against production. These calls read public information or make a studio link; they never place an order.

No account or wallet needed.
Response
// Run a request to see the JSON response here.
04

CODE TO CARD

Buy a card

POST/api/x402/cards

A card costs A$8.99, posted anywhere in Australia by regular post. Tracked Express Post is A$8 more, and International post A$6 more. Choose a Stripe checkout link for the buyer to pay in AUD, or pay USDC on Base over x402 at the live AUD to USD rate, rounded up to the cent. No API key or account is required; payment authorizes the order.

Choose a ready-made card from search_cards, or supply an image as base64 JPEG or PNG. AI cover generation is available in the studio. The API prints the chosen cover and a machine writes the sender’s message with a real pen.

order.json · example request body
{
  "card": "christmas-tree",
  "message": "Thanks for everything this year, Jo!",
  "sign_off": "Love, Sam",
  "sender_name": "Sam",
  "email": "sam@example.com",
  "recipient": {
    "name": "Jo Park",
    "street": "1 George Street",
    "suburb": "Sydney",
    "state": "NSW",
    "postcode": "2000",
    "country": "AU"
  },
  "postage": "regular",
  "card_size": "5x7"
}
Request a quote · does not pay
curl -i https://snailgram.com.au/api/x402/cards \
  -H 'Content-Type: application/json' \
  --data-binary @order.json

Save the body above as order.json, then run the command. A valid request returns 402 Payment Required with a quote. It places an order only after a signed payment is verified and settled.

Request fields

sender_name, email and recipient are required. Supply exactly one of card or image. A message may be empty; when present, use the sender’s own words.

FieldDescription
cardA ready-made card id (the Snailgram MCP server's search_cards, or /browse). Or, instead:
imageYour own picture for the cover, JPEG or PNG, base64 (a data: URL is fine), 4 MB at most, at least 1200 pixels on its shorter side to print sharp. Printed as it is; refused if it isn't fit for a card.
messageThe message written inside, up to 800 characters (160 on a fun size card), line breaks kept. It must be the sender's own words. Refused if the pen can't fit it on the card.
sign_offOptional, up to 40 characters, e.g. "Love, Sam".
sender_nameWho it's from, for the back of the envelope.
emailThe buyer's email, for the receipt, posting and tracking emails and their Snailgram account.
recipient{ name, street, suburb, state, postcode, country }. In Australia state is NSW, VIC, QLD, WA, SA, TAS, ACT or NT with a 4-digit postcode; overseas, country is a two-letter code, suburb the town or city.
postageregular (default in Australia), express, or international (overseas).
arrive_byOptional YYYY-MM-DD, no earlier than it can arrive; it's posted in time for it. Defaults to the earliest.
handwritingOptional style: easy, neat, joined, quick, fountain, copperplate, school, friendly, print, tall; only those the studio offers now are taken. Default easy.
handwriting_sizemedium (default) or large.
card_size5x7 (default) or fun (2″ × 3″).

For Australia, recipient requires name (100 characters), street (150), suburb (60), a state abbreviation and a four-digit postcode. country defaults to AU. Overseas, use a supported two-letter country code and international postage; state and postcode are optional. See OpenAPI for the destination list and complete schema.

05

LET THE BUYER PAY

Stripe payment links

POST/api/checkout/cards

Send the same order.json fields shown above to create an order-specific Stripe checkout URL. The buyer opens the returned payment_url to pay in AUD. Stripe Link and other payment methods are offered according to the Stripe account settings. Creating the link does not charge anyone or queue a card.

Create a buyer-paid checkout
curl https://snailgram.com.au/api/checkout/cards \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 87db44a1-5667-4bcb-9424-ad95fe062fc0' \
  --data-binary @order.json
Example response · HTTP 200
{
  "reference": "SG-ABCD2345",
  "status": "awaiting payment",
  "paid": false,
  "payment_url": "https://checkout.stripe.com/c/pay/cs_…",
  "expires_at": "2026-11-14T10:00:00.000Z",
  "price": { "aud": "8.99", "currency": "AUD" }
}

Generate a new random UUID for each new order. On a network retry, preserve the Idempotency-Key and the exact request body. The API returns the same checkout, returns 202 while it is preparing, or rejects a changed body with 409. A new key creates another checkout. Treat the payment URL as private and share it only with the buyer.

Check GET /api/checkout/cards/{reference} for order status. This response never exposes the payment URL, email, address or message. The signed Stripe webhook verifies the payment before the card is queued; a redirect alone is not proof of payment. Buyers return to a confirmation page that checks with the server.

Checkout links expire within 24 hours; an expired retry returns 410. A failed attempt keeps its failure result for that key; use a new key to try again. Interrupted preparation returns 503 after two minutes rather than remaining pending. New attempts are capped at five per email and 200 total per UTC day, plus 20 POSTs per IP in five minutes at the WAF. These orders charge the full card and postage price; studio promotions and referral credits do not apply.

For an assistant, call buy_card with payment: "stripe". It returns this HTTP request with a fresh idempotency key; the tool itself creates no order. POST the request, then give payment_url to the buyer.

06

PAY PER CARD

The x402 payment flow

  1. Request a quote.

    POST the order as JSON. The API checks the cover and whether the pen can fit the message, then returns 402 and a base64-encoded x402 v2 PAYMENT-REQUIRED header. Read price.usdc, price.aud and price.quote_expires in the JSON body.

  2. Confirm, sign and retry.

    Confirm the recipient, message and quoted price with the buyer. An x402-compatible client uses the exact scheme with USDC on Base (eip155:8453) to sign the quoted requirements. Send the identical order body with PAYMENT-SIGNATURE before the quote expires in 10 minutes.

  3. Keep the reference.

    A 200 response returns the card’s reference and status. The buyer receives a receipt by email. Poll the status endpoint for progress.

Retry the same payment safely.

The payer and payment nonce identify the order. Reusing the same signed payment finds the same card. If the API returns 202 confirming payment, keep the reference and check status; do not create a new payment. A new nonce can buy another card.

Use a server or agent with a wallet for paid requests. The HTTP purchase API does not expose browser CORS headers. The MCP server supports browser calls.

Cancellation and USDC refunds are handled through support@snailgram.com.au. Include the order reference and contact us before writing starts.

07

FOLLOW THE POST

Order status

GET/api/x402/cards/{reference}

Use the reference returned by the paid request. Status responses contain the reference, status, arrival day, and transaction or posting date when available. They never include the message or recipient’s address.

Example · HTTP 200
{
  "reference": "SG-ABCD2345",
  "status": "queued",
  "arrive_by": "2026-12-18"
}

queued means paid and waiting for the pen; received means writing has started. The order then moves to posted and, for tracked Express Post, delivered. It can also be cancelled. HTTP 202 with confirming payment means payment needs confirmation.

Regular and International post are untracked: they do not provide arrival confirmation. For delivery estimates, call delivery_dates with an Australian postcode. Orders paid before noon Sydney time on a business day are posted that day; otherwise, the next business day.

08

WHEN SOMETHING NEEDS A FIX

Errors & limits

HTTP API errors usually return {"error": "what to fix"}. Infrastructure responses such as a rate limit may have no JSON body.

HTTPWhat to do
400Fix the JSON, address, payment signature or invalid field described in error.
402Read the quote and retry with a signed payment. An expired or mismatched quote requires a fresh one.
404No x402 order matches that reference. Check the returned reference.
405Check the HTTP method. MCP accepts POST and OPTIONS; status accepts GET.
409Read the error: the cover may need a fresh quote, or a payment may conflict with an existing order.
422The cover was refused or the message does not fit. Change the cover, shorten the text or try small handwriting.
429Back off before trying again. Avoid concurrent retries.
503Payments or exchange rates are unavailable, or payment verification failed. Retry later, preserving the same signed payment when one was already submitted.

The WAF rate limits MCP to 3,000 requests per IP in five minutes, and POST /api/x402/cards to 20 per IP in five minutes. Quotes and paid retries each count. Other infrastructure limits can also apply. MCP request bodies are limited to 20,000 characters.