Skip to main content
@qonto/embed-sdk / paymentLinks

Variable: paymentLinks

const paymentLinks: object = paymentLinksNamespace.paymentLinks
The paymentLinks namespace contains all the functions related to paymentLinks operations such as starting the payment link creation flow. It can be accessed like this:
import { paymentLinks } from '@qonto/embed-sdk/paymentLinks';
const url = paymentLinks.getPaymentLinkCreationFlowUrl({accessToken, items, redirectUrl});
window.open(url, '_blank');

Type declaration

getPaymentLinkCreationFlowUrl()

getPaymentLinkCreationFlowUrl: (params) => Promise<string>
Generates the URL for initiating a payment link creation flow with specified items.

Parameters

params
PaymentLinkParams<CreatePaymentLinkSettings> An object containing:
  • paymentLinkSettings: An object containing:
    • items: An array of items to be included in the payment link. Each item must conform to the Item type and will be validated.
    • callbackUrl: Required callback URL to redirect to after payment link creation.
  • operationSettings: An object with operation-level settings such as proxyRequestFunction, accessToken, stagingToken, etc.

Returns

Promise<string> Promise resolving to the full URL as a string, which can be used to launch the payment link creation flow in an iframe or browser.

Example

const url = await getPaymentLinkCreationFlowUrl({
  paymentLinkSettings: {
    items: [{ id: '1', title: 'Item 1', type: 'service', quantity: 1, measureUnit: 'unit', unitPrice: { currency: 'EUR', value: '10' }, vatRate: '20' }],
  },
  operationSettings: {
    proxyRequestFunction: async (encodedCall) => {
      // Implement your proxy logic here
    },
  }
});

Throws

InvalidParametersError If the provided items array is invalid or if callbackUrl is missing or invalid.

Throws

AuthenticationError If authentication fails (e.g., invalid or missing access token).