POST Create Payment Link
This API enables merchants to generate a payment link. The returned paymentLink URL can be shared with customers through Email, SMS, or social media. When a customer opens a payment link, they are redirected to a secure, AndDone-hosted payment page.
This API enables merchants to generate a payment link. The returned paymentLink
URL can be shared with customers through Email, SMS, or social media. When a customer opens a payment link, they are redirected to a secure, AndDone-hosted payment page.
Webhook Notifications: This API supports webhook notifications for real-time tracking of payment link events. To receive notifications, subscribe to the Payment Link webhook module in the AndDone Merchant Portal. For detailed payload and event information, see Payment Link Webhook Payloads.
API Versioning:
- Version 2.1: allows the merchant to specify a single payment reference ID.
- Version 2.2: allows the merchant to specify multiple payment reference IDs.
API Endpoint |
https://api.uat.anddone.com/secure/paymentlinks |
This API is used to create a payment link.
API Data | Details |
URI | secure/paymentlinks |
Method | POST |
Authorization | API Key Authorization |
Authorization | |
x-api-key | API key {env_merchantAccessKey} |
Request Headers | |
x-app-key | Merchant ID or App Key {env_merchantId} |
x-version | API version (e.g., 2.1) |
Origin | URL or IP address provided to AndDone as an allowed origin. |
Content-Type | application/json |
API Version 2.1
Request Parameters (v2.1)
Field Name | Data Type | Mandatory | Field Length | Description |
Body Request Example (JSON)
Response Parameters (v2.1)
Body Response Example (JSON)
API Version 2.2
Request Parameters (v2.2)
Field Name | Data Type | Mandatory | Field Length | Description |
title | String | true | NA | The unique ID (Merchant Reference) assigned to the payment by the merchant. If this value is not unique, the payment link will not be generated. |
merchantId | String | true | NA | The env_merchantId or app-key. |
paymentDescription | String | true | NA | This is the purpose of the payment. (Purpose of Payment in the merchant portal UI) |
amount | Number | true | NA | The payment amount in USD. Example: A payment for Ten Dollars and Fifty Cents, is represented as ‘10.50’. Supports up to two decimal places. |
suppressTechnologyFee | Boolean | false | NA | This parameter enables authorized merchants to suppress the AndDone technology fee on payment transactions. If set to true, no technology fee is assessed on the transaction. If set to false, the technology fee is assessed on the transaction. |
expireIn | Number | true | NA | Indicates the period of time that the payment link is valid for. Based on expireInUnit. The default value is 0. |
expireInUnit | Number | true | NA | The units used to define the expiration period (expireIn) for the payment. Values are: 0 - seconds, 1 - minutes, 2 - hours, 3 - days, 4 - weeks. The default value is 0. |
referenceDataList | Array | true | NA | This array contains the reference identifiers associated with the payment link. ReferenceType, ReferenceKey, and ReferenceNumber are nested parameters under this array. |
- referenceType | Number | true | NA | Indicates the type of reference ID (referenceNumber) associated with the payment. Accepted values are: 1 - QuoteId, 2 - AccountNumber, 3 - PolicyNumber, 4 - InvoiceNumber, 5 - Other. |
- referenceKey | String | false | NA | If referenceType is set to 5 (Other), the referenceKey parameter is used to provide a descriptive tag for the reference number. |
- referenceNumber | String | true | NA | The payment reference ID number or string. |
responseType | Number | false | NA | This parameter sets the payment confirmation page option. Accepted values are: 1 - A custom confirmation message (callbackMessage) and/or URL redirect (callbackApiUrl) is specified. 2 - The default confirmation page/message is displayed. |
callbackParameters | Object | false | NA | This object contains the callback parameters for responseType option 1. |
- callbackApiUrl | String | false | NA | If responseType is set to 1, this parameter can be used to specify the URL that the customer is redirected to after payment confirmation. |
- callBackMessage | String | false | NA | If responseType is set to 1, this parameter can be used to specify a custom message that is displayed to the customer in the payment confirmation page. |
- redirectionTime | Number | false | NA | This parameter allows you to set a delay in seconds before the customer is redirected to the callbackApiUrl after payment confirmation. The default delay is 10 seconds. |
customers | Object | false | NA | If additionalDetailsPreference is set to 2 (Merchant enters details), this object contains the customer information that is displayed in the payment form. |
- firstName | String | false | NA | Customer's first name. |
- lastName | String | false | NA | Customer's last name. |
String | false | NA | Customer's contact Email address. | |
- phone | String | false | NA | Customer's contact phone number. |
settings | Object | false | NA | |
- additionalDetailsPreference | Number | true | NA | Sets the option for the customer details to be displayed or collected in the payment link form. Accepted values are 1 - AskShopper. The customer enters details. 2 - ManualEnter - Merchant enters details, 3 - NoDetails. |
- selectedCustomerFields | String | false | NA | If additionalDetailsPreference is set to 1 (Customer enters details) this parameter indicates the information required from the shopper: Accepted values are: First Name, Last Name, Email, Phone Number. |
- intent | Object | NA | NA | This object defines the accepted payment methods for the transaction. |
- paymentTypes | Array[string] | true | NA | The accepted payment types for the transaction. Accepted values are: CreditCard, DebitCard, and ACH. |
Body Request Example (JSON)
{
"merchantId": "ABv9G58a",
"title": "PMTlnk-21125rynx6",
"paymentDescription": "Premium down payment.",
"amount": 125,
"suppressTechnologyFee": true,
"expireIn": 60,
"expireInUnit": "Minutes",
"referenceDataList": [
{
"referenceType": "2",
"referenceNumber": "86753023413"
},
{
"referenceType": "5",
"referenceKey": "CustomerNumber",
"referenceNumber": "CST-54327890321"
}
],
"responseType": "CallBack",
"callbackParameters": {
"callbackApiUrl": "",
"callbackMessage": "Thank you for your payment!",
"redirectionTime": ""
},
"customers": [
{
"firstName": "Bill",
"lastName": "Billingsly",
"email": "[email protected]",
"phone": "5555555555",
"address": {
"addressLine1": "57342 Sunset Palms Drive",
"addressLine2": "Apt. 231",
"city": "Anchorage",
"state": "AK",
"country": 1,
"postalCode": "11235"
}
}],
"settings": {
"additionalDetailsPreference": "2",
"intent": {
"PaymentTypes": [
"ACH",
"CreditCard",
"DebitCard"
]
}
}
}
Response Parameters (v2.2)
Body Response Example (JSON)
{
"id": "adJnoG9d",
"merchantId": "ABv9G58a",
"title": "PMTlnk-21125rynx6",
"paymentLink": "https://link.dev.anddone.com/#/adJnoG9d",
"shortLink": "https://link.dev.anddone.com/#/adJnoG9d",
"amount": 125.0,
"paymentDescription": "Premium down payment.",
"expireIn": 60,
"expireInUnit": "Minutes",
"expireOn": "01-19-2024 16:07:46",
"applyPaymentAdjustments": null,
"enablePartialPayment": false,
"enableMultiplePayment": false,
"customers": [
{
"firstName": "Bill",
"lastName": "Billingsly",
"email": "[email protected]",
"phone": "5555555555",
"notifyViaSMS": false,
"notifyViaEmail": false,
"createdOn": "01-19-2024 15:07:46",
"accounts": null,
"billingAddress": {
"addressLine1": "57342",
"addressLine2": "Sunset Palms",
"city": "Anchorage",
"state": "AK",
"country": 1,
"postalCode": "11235",
"timeZone": null
}
}
],
"lineItems": [],
"payments": [],
"noOfPaymentMade": 0,
"totalPaidAmount": 0.0,
"enableProtection": false,
"protectionMode": null,
"displayReceipt": null,
"linkStatus": "Enabled",
"invoiceNumber": null,
"createdOn": "01-19-2024 15:07:47",
"createdBy": "UserAzhar",
"modifiedOn": "01-19-2024 15:07:47",
"modifiedBy": "UserAzhar",
"shortDescription": null,
"responseType": "CallBack",
"callbackParameters": {
"callbackSuccessUrl": null,
"callbackFailureUrl": null,
"accessKey": null,
"secretKey": null,
"referenceNo": null,
"referenceType": null,
"transactionId": null,
"callbackApiUrl": "",
"callbackMessage": "",
"redirectionTime": null
},
"displaySettings": {
"selectedCustomerFields": null,
"additionalDetailsPreference": "ManualEnter",
"displaySummary": false,
"acceptCustomerInfo": false,
"removeHeader": false,
"acceptCard": false,
"acceptBankAccount": false,
"saveCustomer": false,
"saveCustomerAccount": false,
"intent": {
"paymentTypes": [
"ACH",
"CreditCard"
]
}
},
"splits": null,
"saveForFuture": null,
"quoteKey": null,
"accountNumber": null,
"referenceType": "None",
"referenceNumber": null,
"referenceKey": null,
"referenceDataList": [
{
"referenceType": "AccountNumber",
"referenceNumber": "86753023413",
"referenceKey": null
},
{
"referenceType": "Other",
"referenceNumber": "CST-54327890321",
"referenceKey": "CustomerNumber"
}
],
"enablePremiumFinance": false,
"suppressTechnologyFee": false
}