Skip to content
Terra WalletDevelopers

Early access. The Terra API and SDKs may change before launch, and the SDK packages are not published yet.

View as Markdown

Terra Pay

Early access

Payment links

A payment link is a reusable URL, https://pay.terrawallet.us/l/plink_..., that anyone can open to pay you. No code is needed on your side: share it in a message, an email, a bio or a QR code.

Create one#

POST /v1/payment_links:

FieldTypeRequiredNotes
namestringyesWhat the customer is paying for
amountdecimal stringone ofA fixed amount, for example "25.00"
customer_choosesbooleanone oftrue lets the customer choose the amount (tips, donations)
currencystringyesA fiat ISO code
accepted_assetsarray of assetsyesSee Payment intents
max_usesintegernoStop accepting payments after this many
expires_attimestampnoStop accepting payments after this time

Send either amount or customer_chooses: true.

Shell

curl https://terrawallet.us/api/v1/payment_links \  -H "Authorization: Bearer $TERRA_SECRET_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: link-workshop-ticket" \  -d {    "name": "Workshop ticket",    "amount": "25.00",    "currency": "USD",    "accepted_assets": [      { "chain": "polygon", "symbol": "USDC", "contract": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", "decimals": 6 }    ],    "max_uses": 50  }

Response:

JSON

{ "id": "plink_...", "url": "https://pay.terrawallet.us/l/plink_..." }

What happens when someone pays#

Each visit creates its own payment intent from the link (the page calls POST /v1/checkout/plink_.../intents with the chosen asset, and the quantity or amount where the link allows it). From there it is a normal payment intent: an exact quote, on-chain verification and a payment_intent.succeeded webhook.

Open standards#

Payment requests use the standard URI formats wallets already understand where they fit: EIP-681 on EVM chains, BIP-21 for Bitcoin, Solana Pay and TRON URIs.