Payment Links
What are Payment Links?
Payment Links allow Datacap partners to accept payments without building an additional standalone website or application. Send Payment Links via SMS, e-mail or both.
URLs
Type | URL |
|---|---|
Certification | https://paylink-cert.dcap.com/api/v1/ |
Production | https://paylink.dcap.com/api/v1/ |
Authorization
For Payment Links the authorization is the same as V2 Pay API. which consists of Basic Authorization on all endpoints as Authorization: Basic BASE64(eCommerceMID:ApiKey) API Key acquired via the endpoint /AcquireInitialApiKey and rotated via the endpoint /AcquireApiKey.
Refer to Pay API AuthorizationPay API Authorization for more info.
Headers
Payment Links API only accepts JSON. The following headers are required.
headers: {
'Content-Type': 'application/json', // JSON is required
'Authorization': `Basic ${encodedAuth}`, // Basic authentication
'Accept': 'application/json', // JSON accepted back
},
Creating a Payment Link
A payment link POST request consists of 6 objects:
- transactionProperties will contain information about the transaction like amount, tip, and line items.
- displayProperties contains properties that control the look and feel of the resulting payment page.
- paymentTypesAllowed enumerates different types of Datacap MIDs that will be used for the payment request.
- apiKeys (optional) is used for integrators to bring their own SMS provider account (Twilio supported today).
- communicationMethods (optional) enumerates through different ways to automatically send the payment link to the customer (email,SMS).
- webhookEndpoints (optional) will contain webhook urls and desired webhook events to be returned to the webhook page.
Example POST Request Body outline:
{ *"transactionProperties": { // transactionProperties sub properties here }, *"displayProperties": { // displayProperties sub properties here }, *"paymentTypesAllowed": [ // paymentTypesAllowed sub properties here ], "apiKeys": { // apiKeys sub properties here }, "communicationMethods": [ // communicationMethods sub properties here ], "webhookEndpoints": [
// "URL": "URL to receiverURL to receiver" , "events": Webhook EventsWebhook Events
]
* fields Required
Operations
Payment Link Operations
Operation | HTTP Method | URL |
|---|---|---|
Generate Payment Link | POST | /paymentrequest |
Update Payment Link | PUT | /credit/sale/paymentrequest/{requestId} |
Cancel Payment | PUT | /paymentrequest/{requestId}/cancel |
Mark Link As Paid | PUT | /paymentrequest/{requestId}/markaspaid |
Resend Payment Link | PUT | /paymentrequest/{requestId}/sendcommunication |
Find Sent Payment Links | GET | /paymentrequest/merchant |
Request Full Access to Payment Links
Get started: Request developer credentials for free access to every product's integration guide.