Create Payment Link
Create new Payment Link.
To avoid duplicate payments, you must provide a unique_reference_id which uniquely identifies the bill/invoice being paid. This allows you to safely create/retry Payment Links multiple times using the same unique_reference_id, for example if a user restarts the payment flow on a different device. Finverse will only allow a single payment per unique_reference_id. See “Implementation guidance” section below for additional details on how to generate a unique_reference_id.
Authorization: customer_token
integration_metadata (object, optional)
Use the following optional parameters to pass custom values for Finverse-supported integrations (e.g. ERP/CRM/accounting integrations).
link_customizations (object, optional)
You can use the following optional parameters to customize the behaviour of Finverse Link’s UI to fit your implementation requirements.
payment_details (object, conditionally required)
Details describing the Payment transaction.
Required if mode = PAYMENT.
payment_setup_options (object, conditionally required)
Additional parameters to configure payment methods and future payments.
Required if mode = SETUP.
Impact of future_payments on payment methods displayed
When enabling future_payments:
-
In
mode=SETUP: the Finverse Link UI will only display payment methods which support recurring “pull” payments (e.g direct debit & cards). -
In
mode=PAYMENT, the Finverse Link UI will continue to show all available payment methods, including one-time payment methods (in order to encourage payment completion).-
The future payments setting will only apply if the user selects a payment method which supports recurring payments (e.g. direct debit or cards).
-
To enable future payments and display only recurring payment methods, use the (optional)
payment_method_typesfilter to explicitly limit the payment methods displayed.
-
autopay_enrollment_configurations (object, optional)
Configures the FInverse Link UI to enroll users into autopay (i.e. collects consent for future payments).
This controls whether the Finverse UI will prompt users to opt-in to autopay, when autopay is not already enforced (i.e. when future_payments ≠ AUTOPAY).
When a user consents to autopay, the payment user property autopay_consent is set to true, which allows:
-
User can be charged for payments (using
POST /payments) without obtaining additional user consent for each charge; -
Finverse can automatically initiate charges on bill/invoice due dates (for customer apps where Finverse ingests bill/invoices via ERP integrations or API).
Note: autopay_enrollment_configurations cannot be set when future_payments = AUTOPAY (since this already enforces autopay for all users; no autopay enrollment screen is shown).
mandate_details (object, optional)
Optional configurations for any direct debit mandate setup by the user.
receipient_account_filters (object, optional)
Optional filter to narrow the list of accounts receiving money (also called “settlement accounts”). This is typically used for more complex payment scenarios, for example when a Customer App needs multiple settlement accounts:
-
For different business units, or
-
With different collection fee rules (e.g. with or without transaction fee surcharges paid by senders)
In these cases the Customer App can use recipient_account_filters to explicitly filter the receiving accounts matching its business requirements.
Note: settlement accounts are configured by Finverse during initial onboarding of each Customer App. By default, Finverse creates 1 recipient account per payment method. Contact [email protected] if you have complex payment flows, use cases or business units which may benefit from setting up multiple settlement accounts.
sender (object, required)
Details on the sender of the payment.
View More
Response fields
The response is a Payment Link object.
Refer to Payment Link object data model in GET /payments_links/{payment_link_id}.
Implementation guidance
Handling retries/revisit and avoiding duplicate payments: using unique_reference_id as idempotency key
-
To enable retries/revisit, Finverse allows creating payment links using a previously-used
unique_reference_id, if all payment link details are identical (amount, etc). This returns the same payment link ID and URL as originally created. This allows usingunique_reference_idsimilarly to an idempotency key. -
To avoid duplicate payments, Finverse will only allow 1 executed payment per
unique_reference_id. -
When a user revisits a payment link, the Finverse Link UI will show end-users a “Payment in progress” screen if a payment is already pending for the same
unique_reference_id.- Example: if a user revisits a payment link after previously using the payment link to setup a direct debit mandate => the user will see “Payment in progress” if the direct debit mandate is still being processed; a payment will automatically be executed when the direct debit mandate becomes successful.
-
unique_reference_idgeneration: we recommend generatingunique_reference_idbased on a composite/hash of the key payment details. The composite/hash should include any payment link details that could change between 2 user sessions, for example:-
Bill/invoice/purchase reference (
external_transaction_reference) -
Payment
amount -
Sender details (
sender.name,sender.email) -
Metadata (
metadata,payment_metadata). -
This ensures that a new
unique_reference_idis generated if any payment link details are modified (for example if the amount is updated or if the user changes their name/email between 2 user sessions).
-
-
If a payment link creation request is sent using an existing
unique_reference_idbut different payment link details, the following API error will be returned:
// HTTP 400 Bad Request
{
"error": {
"details": "Trying to update existing paymentLink. Not supported.",
"error_code": "INVALID_PARAMETER",
"message": "The parameters provided are invalid. See details.",
"request_id": "1689652320",
"type": "API_ERROR"
}
}
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Parameters required to create a payment link
Currency of the payment (e.g. HKD)
3"HKD"
Specified payment link mode. Accepted values: - PAYMENT: payment link is used to collect the specified payment amount now; - SETUP: payment link is used to register a payment method to be charged later (using POST /payments).
PAYMENT, SETUP "PAYMENT"
Details on the sender of the payment
Customer-supplied string, uniquely identifying the payment to be collected. See “Handling retries and avoiding duplicate payments” below.
1Amount of the payment (in minor currency unit). Required if mode = PAYMENT.
x >= 1100
Optional parameters to pass custom values for Finverse-supported integrations (e.g. ERP/CRM/accounting integrations)
Optional parameters to customize the behaviour of Finverse Link's UI to fit your implementation requirements
Customer-supplied attributes in key:value format. E.g. contract_id: 1234
Details on the payment Only used if mode = PAYMENT.
Customer-supplied attributes associated with the payment, in key:value format. Use this to pass any information you later need to tie a successful payment back to its original context (e.g. user, bill, invoice, checkout). E.g. contract_id: 1234. These attributes will be added as metadata on any payment object directly created by the Payment Link, and will be included in: (i) any API response with a payment object; (ii) Payments webhooks; and (iii) Finverse's reporting (e.g. statements issued to customer apps). Only used if mode = PAYMENT. Will be ignored if mode = SETUP.
Additional parameters to configure payment methods and future payments Required if mode = SETUP.
Response
Success (payment mode, future payments disabled)
Amount of the payment (in minor currency unit). Only returned if mode = PAYMENT.
100
Timestamp when the payment link was first created
Currency of the payment (e.g. HKD)
"HKD"
Optional parameters to customize the behaviour of Finverse Link's UI to fit your implementation requirements. See POST /payment_links.
Customer-supplied attributes in key:value format. E.g. contract_id: 1234.
Specified payment link mode. Possible values: - PAYMENT: payment link is used to collect the specified payment amount now; - SETUP: payment link is used to register a payment method to be charged later (using POST /payments).
PAYMENT "PAYMENT"
Latest Payment object (if any) associated with the payment link Only returned if mode = PAYMENT.
Details on the payment Only returned if mode = PAYMENT.
Finverse Payment Link ID for this payment link. Always unique. Creating a payment link with different unique_reference_id values will result in two payment links with different IDs.
Customer-supplied attributes in key:value format, to facilitate payment reconciliation. E.g. contract_id: 1234. These will be added as metadata on any Payment object directly created by the Payment Link, and will be included in Finverse's reporting (e.g. statements issued to customer apps). Only used if mode = PAYMENT. Will be ignored if mode = SETUP.
Details on the payment method authorized by the end-user
Additional parameters recording how payment methods and future payments have been configured
Details on the sender of the payment
Current session status of the payment link. Possible values: OPEN, PROCESSING, COMPLETE, FAILED. Session status returns interim status details on a payment link in status = CREATED: - Session status starts as OPEN, then may progress to PROCESSING (indicating an async payment method or payment is currently processing), COMPLETE (for successful payment links), or FAILED (for failed payment method setup or payments). - Session status is computed at read-time based on the status of any payment method setup or payment initiated by the payment link, until the payment link is successful. - Session status may reset if a user retries a payment method setup or payment using the same payment link until it is successful (e.g. session_status may go from FAILED > PROCESSING, FAILED > COMPLETE, etc). - The final session_status is COMPLETE, which corresponds to payment link status = PAID or SETUP_SUCCEEDED. We recommend using the payment link status as the primary indicator of payment link success (e.g. status = PAID or SETUP_CREATED). However, if your user flow or UI needs interim session details while the payment link status is still CREATED, then you should use session_status (for example to display to the user a "Your payment is processing" or "Your payment failed" message).
OPEN, PROCESSING, COMPLETE, FAILED Status of the payment link. Possible values: CREATED, PAID, SETUP_SUCCEEDED, CANCELLED. The status for a successful payment link varies based on the payment link mode: - mode = PAYMENT => success status = PAID - mode = SETUP => success status = SETUP_SUCCEEDED.
CREATED, PAID, EXPIRED Customer-supplied string, uniquely identifying the payment to be collected. See “Handling retries and avoiding duplicate payments” under POST /payment_links.
1Timestamp of the last update to the payment link's record
URL to launch the Finverse Link UI flow, for the end-user to select a payment method & authorize the payment.