SDK ReferenceMethods

Methods

SDK Methods

createPaymentInvoice

Creates a payment invoice and returns a payment URL to redirect the customer.

Node.js

const paymentUrl = await client.createPaymentInvoice({
  paymentLinkId: "YOUR_PAYMENT_LINK_ID",
  amount: "100.00",
  currency: "USD",
  customerOrderId: "order_001",
  productDetails: { name: "Premium Subscription" },
  individual: { firstName: "Jane", lastName: "Doe", email: "jane@example.com" },
  successRedirectUrl: "https://yoursite.com/success",
  failureRedirectUrl: "https://yoursite.com/failed",
});

// paymentUrl is a string — redirect customer to it

Python

payment_url = api.create_payment_invoice(
    payment_link_id="YOUR_PAYMENT_LINK_ID",
    amount="100.00",
    currency="USD",
    customer_order_id="order_001",
    product_details={"name": "Premium Subscription"},
    individual={"first_name": "Jane", "last_name": "Doe"},
    success_redirect_url="https://yoursite.com/success",
    failure_redirect_url="https://yoursite.com/failed",
)

Java

PaymentInvoiceRequest request = new PaymentInvoiceRequest.Builder()
    .paymentLinkId("YOUR_PAYMENT_LINK_ID")
    .amount("100.00")
    .currency("USD")
    .productDetails(new ProductDetails("Premium Subscription"))
    .individual(new Individual("Jane", "Doe"))
    .successRedirectUrl("https://yoursite.com/success")
    .failureRedirectUrl("https://yoursite.com/failed")
    .build();

String paymentUrl = api.createPaymentInvoice(request);

PHP

$paymentUrl = $api->createPaymentInvoice([
    'paymentLinkId'      => 'YOUR_PAYMENT_LINK_ID',
    'amount'             => '100.00',
    'currency'           => 'USD',
    'productDetails'     => ['name' => 'Premium Subscription'],
    'individual'         => ['firstName' => 'Jane', 'lastName' => 'Doe'],
    'successRedirectUrl' => 'https://yoursite.com/success',
    'failureRedirectUrl' => 'https://yoursite.com/failed',
]);

All implementations return: a string checkout URL.