Payments

Custom Payment Data

Associate user IDs, custom payment IDs, order details, and more with any payment.

To include custom purchaseData in webhooks or payment history, pass a purchaseData object to any prepare function:

import { Bridge } from "thirdweb";
const preparedQuote = await Bridge.Buy.prepare({
originChainId: 42161,
originTokenAddress: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
destinationChainId: 10,
destinationTokenAddress:
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
amount: 10_000_000n,
sender: "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709",
receiver: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
client,
purchaseData: {
userId: "75750df7-ec39-4724-9995-6c75e7a59ef6",
itemId: "af4a7350-a89b-4329-8262-0cdf09557803",
size: "L",
shippingAddress: {
addressLine1: "2 Marina Blvd",
city: "San Francisco",
state: "CA",
postalCode: "94123",
country: "US",
},
},
});

Any purchase data you provide to a payment will be included on all webhooks, status responses, and payment history for that payment.

Going further

To connect with other auth strategies, use external wallets, or sponsor gas for users, check out the following guides:

Explore Full API References