Node.js Python Java PHP
{
paymentLinkId: "string", // Required
amount: "string", // Required — e.g. "100" or "49.99"
currency: "string", // Required — ISO 4217, e.g. "USD"
successRedirectUrl: "string", // Required
failureRedirectUrl: "string", // Required
productDetails: { ... }, // Optional — see below
individual: { ... }, // Optional — see below
customerOrderId: "string", // Optional — your internal order ID
}PaymentInvoiceRequest(
payment_link_id="string", # Required
amount="string", # Required — e.g. "100" or "49.99"
currency="string", # Required — ISO 4217, e.g. "USD"
success_redirect_url="string", # Required
failure_redirect_url="string", # Required
product_details=ProductDetails(), # Optional — see below
individual=Individual(), # Optional — see below
customer_order_id="string", # Optional — your internal order ID
)//Builder pattern for creating payment requests:
paymentInvoiceRequest.builder()
.paymentLinkId(String) // Required: Payment link identifier
.amount(String) // Required: Payment amount
.currency(String) // Required: Currency code (USD, EUR, etc.)
.productDetails(productDetails) // Optional — see below
.individual(individual) // Optional — see below
.successRedirectUrl(String) // Required: Success redirect URL
.failureRedirectUrl(String) // Required: Failure redirect URL
.customerOrderId(String) // Optional — see below
.build();
$paymentData = new PaymentInvoiceRequest(
'LINK_ID',
'100',
'USD',
'https://example.com/success',
'https://example.com/failure'
);
$paymentData->productDetails = $product;
$paymentData->individual = $individual;
$paymentData->customerOrderId = 'order-001';
Parameter Node.js key Python key PHP Key Java Key Type Required Description Payment Link ID paymentLinkIdpayment_link_idpaymentLinkIdpaymentLinkIdstring Yes The Payment Link ID from your TransFi dashboard Amount amountamountamountamountstring Yes Amount to charge, e.g. "100" or "49.99" Currency currencycurrencycurrencycurrencystring Yes ISO 4217 code, e.g. "USD", "EUR", "SGD" Success URL successRedirectUrlsuccess_redirect_urlsuccessRedirectUrlsuccessRedirectUrlstring Yes Redirect URL after successful payment Failure URL failureRedirectUrlfailure_redirect_urlfailureRedirectUrlfailureRedirectUrlstring Yes Redirect URL after failed payment Product Details productDetailsproduct_detailsproductDetailsproductDetailsobject No Product info shown at checkout Customer individualindividualindividualindividualobject No Customer details for pre-fill / KYC Order ID customerOrderIdcustomer_order_idcustomerOrderIdcustomerOrderIdstring No Your internal order reference ID
Product information displayed on the checkout page.
Field Node.js key Python key Required Description Name namenameYes Name of the product or service Description descriptiondescriptionNo Short description of the product Image URL imageUrlimage_urlNo URL of a product image
Node.js Python Java PHP
productDetails: {
name: "Premium Annual Plan",
description: "12-month access to all features",
imageUrl: "https://example.com/product.png",
}from transfi.types import ProductDetails
ProductDetails(
name="Premium Annual Plan",
description="12-month access to all features",
image_url="https://example.com/product.png",
)productDetails(productDetails.builder()
.name("Premium Subscription")
.description("Monthly subscription plan")
.build())'productDetails' => [
'name' => 'Premium Plan',
'description' => 'Monthly subscription',
]
Customer information used to pre-fill the checkout form or speed up KYC verification.
Field Node.js key Python key Required Description First name firstNamefirst_nameYes Customer's first name Last name lastNamelast_nameYes Customer's last name Email emailemailYes Customer's email address Phone phonephoneNo Phone number without country code Phone code phoneCodephone_codeNo Dialing code, e.g. "+1", "+91" Country countrycountryNo ISO 3166-1 alpha-3 (Node.js: "USA") or alpha-2 (Python: "US") Address addressaddressNo Customer's address (see below)
Node.js Python Java PHP
individual: {
firstName: "Jane",
lastName: "Smith",
email: "[email protected] ",
phone: "9876543210",
phoneCode: "+1",
country: "USA",
address: {
street: "123 Main St",
city: "New York",
state: "NY",
postalCode: "10001",
},
}from transfi.types import Individual, Address
Individual(
first_name="Jane",
last_name="Smith",
email="[email protected] ",
phone="9876543210",
phone_code="+1",
country="US",
address=Address(
street="123 Main St",
city="New York",
state="NY",
postal_code="10001",
),
)individual(individual.builder()
.firstName("John")
.lastName("Doe")
.email("[email protected] ")
.phone("1234567890")
.phoneCode("+1")
.country("US")
.build())'individual' => [
'firstName' => 'John',
'lastName' => 'Doe',
'email' => '[email protected] ',
'phone' => '1234567890',
'phoneCode' => '+1',
'country' => 'US',
]
Field Node.js key Python key Description Street streetstreetStreet address City citycityCity name State statestateState or province Postal code postalCodepostal_codeZIP or postal code