Payment Link Integration Guide

Payment Links allow you to securely accept E-commerce payments by generating a URL link via our API which can then be sent out in an email to your customers directly. This keeps your system out of PCI scope while giving you access to fraud prevention and diverse payment methods.


🚀 Getting Started

To initiate a payment link API call, your application must build the JSON request body with a proper Basic Auth header and submit an HTTP_POST request to one of the following endpoints:

  • Live Environment: https://api.e-xact.com/payment_links
  • Sandbox/Demo Environment: https://api.demo.e-xact.com/payment_links

Essential Form Fields

At a minimum, your POST request must include the following fields. If any are missing or invalid, the customer will see an error.

FieldDescription
amountThe total amount to be charged on this payment link transaction in smallest currency unit. (5000 would result in a charge for $50.00)
minutes_until_expiryThe number of minutes the payment link should be active for before it is considered expired and no longer valid
transaction_typeThe type of transaction this payment link should be processing. Options are:
AUTH_CAPTURE - Purchase
AUTH_ONLY - Preauthorization
AUTH_TOKEN - Tokenized Preauthorization (returns a token for follow up transactions)
PURCHASE_TOKEN - Tokenized Purchase (returns a token for follow up transactions)

🚧

Unlike our standard Transaction API (which formats amounts with a decimal, e.g. 15.99), the Payment Link API requires all transaction amounts to be passed as an integer representing the total value in cents.

You must remove all decimals from your payload for this endpoint.

  • $15.99 must be passed as 1599
  • $1,250.00 must be passed as 125000

Transaction and Display Fields

Customer Fields

Field CategoryIncluded Fields
Customer informationfirst_name
last_name
company
ip_address
email
phone
fax
Customer Address Fields
Field CategoryIncluded Fields
Customer addressline1
city
state
country_code
postal_code
Customer Ship To Fields
Field CategoryIncluded Fields
Customer ship to informationfirst_name
last_name
state
company
Customer Ship To Address Fields
Field CategoryIncluded Fields
Customer ship to addressline1
city
state
country_code
postal_code

Reference Fields

Field CategoryIncluded Fields
Reference detailscustomer_ref - Purchase order number
reference_no - Invoice number
reference_3 - Merchant defined reference

Line Item Fields

Field CategoryIncluded Fields
Line item details
  • used to display a breakdown of items and their costs on the payment form
item_id
quantity
price
title
description
taxable

Split Customer Fields

Field CategoryIncluded Fields
Split customer details
  • used to display a breakdown of costs between customers on one bill on the payment form
customer_name
amount

Option Fields

Field CategoryIncluded Fields
Additional optionsgenerate_qr_code - return a QR code of the payment link URL in the response
tos_url - displays a terms of service URL on the payment form
privacy_url - displays a terms of privacy policy URL on the payment form

Extra Fields

Field CategoryIncluded Fields
Extra detailscustomer_id
customer_tax_id
tax_exempt
tax_amount
freight_amount
duty_amount

Sample Request

require 'uri'
require 'net/http'
require 'json'

url = URI("https://api.demo.e-xact.com/payment_links")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
# basic auth username is the payment page ID. (eg. WSP-E-XBC-kLS1GQAB0g)
# basic auth password is the payment page's payment link API key. (eg. sk_...)
request["authorization"] = 'Basic V1NQLUUtWEFDLWtMUzZHUUFCMGc6c2tfRHhwMWdxOU1EM1V2ZkN0M1hRZlgyNEJKTFhOd0J1OXg='
params = {
  amount: 5000,
  minutes_until_expiry: 1320,
  transaction_type: "AUTH_TOKEN"
}
request.body = params.to_json

response = http.request(request)
puts response.read_body


Did this page help you?