Send Pay Links
Guides

CRM & Customer Service Integration

Pre-fill checkout links with customer data from your CRM or customer service platform

CRM & Customer Service Integration

Integrate Send Pay Links with your CRM, customer service platform, or any external system to automatically pre-fill customer information in the checkout link generator.

Overview

When your customer service representatives or sales team are on a call with a customer, they can instantly create a checkout link with all customer details pre-filled - no manual data entry required.

This integration works by:

  1. Your external system sends customer data via a POST request
  2. Send Pay Links redirects to the link generator with data pre-populated
  3. Your team only needs to select products and generate the link

Prerequisites

  • A Send Pay Links account with admin access
  • Your CRM or customer service platform must be able to:
    • Submit HTML forms, OR
    • Make HTTP POST requests

Quick Start

Option 1: HTML Form (Simplest)

Add this form to your CRM or customer service dashboard:

<form action="https://sendpaylinks.com/api/admin/tools/link-generator/prefill" method="POST">
  <!-- Customer Info -->
  <input type="hidden" name="firstName" value="{{customer.firstName}}">
  <input type="hidden" name="lastName" value="{{customer.lastName}}">
  <input type="hidden" name="email" value="{{customer.email}}">
  <input type="hidden" name="phone" value="{{customer.phone}}">

  <!-- Address -->
  <input type="hidden" name="address1" value="{{customer.address}}">
  <input type="hidden" name="city" value="{{customer.city}}">
  <input type="hidden" name="state" value="{{customer.state}}">
  <input type="hidden" name="postalCode" value="{{customer.zip}}">

  <!-- Optional: Sales Attribution -->
  <input type="hidden" name="salespersonId" value="{{agent.id}}">
  <input type="hidden" name="source" value="phone_sale">

  <button type="submit">Create Checkout Link</button>
</form>

Replace {{customer.firstName}}, etc. with your CRM's template variables.

Option 2: JavaScript/AJAX

For more control, use JavaScript to open the link generator in a new tab:

function createCheckoutLink(customer, agent) {
  const form = document.createElement('form');
  form.method = 'POST';
  form.action = 'https://sendpaylinks.com/api/admin/tools/link-generator/prefill';
  form.target = '_blank'; // Opens in new tab

  const fields = {
    firstName: customer.firstName,
    lastName: customer.lastName,
    email: customer.email,
    phone: customer.phone,
    address1: customer.address,
    city: customer.city,
    state: customer.state,
    postalCode: customer.zip,
    salespersonId: agent.id,
    source: 'phone_sale'
  };

  for (const [key, value] of Object.entries(fields)) {
    if (value) {
      const input = document.createElement('input');
      input.type = 'hidden';
      input.name = key;
      input.value = value;
      form.appendChild(input);
    }
  }

  document.body.appendChild(form);
  form.submit();
  document.body.removeChild(form);
}

// Usage
createCheckoutLink(
  { firstName: 'John', lastName: 'Doe', email: 'john@example.com', ... },
  { id: 'sp_123' }
);

Option 3: Server-Side Request

For server-to-server integration, make a POST request and redirect the user:

// Node.js example
const response = await fetch('https://sendpaylinks.com/api/admin/tools/link-generator/prefill', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cookie': userSessionCookie // User must be authenticated
  },
  body: JSON.stringify({
    firstName: 'John',
    lastName: 'Doe',
    email: 'john@example.com',
    phone: '555-123-4567',
    address1: '123 Main St',
    city: 'New York',
    state: 'NY',
    postalCode: '10001'
  }),
  redirect: 'manual' // Don't follow redirect automatically
});

// Get the redirect URL
const redirectUrl = response.headers.get('location');
// Redirect the user's browser to this URL

API Reference

Endpoint

POST /api/admin/tools/link-generator/prefill

Authentication

The user must be logged into Send Pay Links. The request uses the same session cookie as the admin dashboard.

Content Types

  • application/json
  • application/x-www-form-urlencoded
  • multipart/form-data

Request Fields

Customer Information

FieldTypeRequiredDescription
firstNamestringYesCustomer's first name
lastNamestringYesCustomer's last name
emailstringYesCustomer's email address
phonestringNoCustomer's phone number

Shipping Address

FieldTypeRequiredDescription
address1 or line1stringYesStreet address
address2 or line2stringNoApartment, suite, etc.
citystringYesCity
statestringYesState (2-letter code)
postalCode, zip, or zipCodestringYesZIP/Postal code
countrystringNoCountry (2-letter code, defaults to US)

Options

FieldTypeRequiredDescription
platformstringNoPayment provider: stripe, nmi, epd, konnektive, shopify, sticky, ultracart, custom
salespersonIdstringNoSalesperson ID for commission tracking
sourcestringNoSale source: phone_sale, chat, email, in_person, social, referral, other
commissionRatestringNoCommission rate as decimal (e.g., 0.10 for 10%)

Response

The endpoint returns a 303 See Other redirect to:

/admin/tools/link-generator?prefilled=1&firstName=...&lastName=...

Platform-Specific Examples

Zendesk

Add a custom app or macro that opens a link:

// Zendesk App Framework
client.get('ticket.requester').then(function(data) {
  const requester = data['ticket.requester'];

  const params = new URLSearchParams({
    firstName: requester.name.split(' ')[0],
    lastName: requester.name.split(' ').slice(1).join(' '),
    email: requester.email,
    salespersonId: '{{current_user.id}}',
    source: 'chat',
    prefilled: '1'
  });

  window.open('/admin/tools/link-generator?' + params.toString(), '_blank');
});

Salesforce

Create a Lightning Web Component (LWC) Quick Action to generate checkout links directly from Contact or Account records.

1. Create the Apex Controller

// CreateCheckoutLinkController.cls
public with sharing class CreateCheckoutLinkController {
    @AuraEnabled(cacheable=true)
    public static Contact getContactDetails(Id contactId) {
        return [
            SELECT FirstName, LastName, Email, Phone,
                   MailingStreet, MailingCity, MailingState,
                   MailingPostalCode, MailingCountry
            FROM Contact
            WHERE Id = :contactId
            LIMIT 1
        ];
    }
}

2. Create the Lightning Web Component

// createCheckoutLink.js
import { LightningElement, api, wire } from 'lwc';
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import getContactDetails from '@salesforce/apex/CreateCheckoutLinkController.getContactDetails';

export default class CreateCheckoutLink extends LightningElement {
    @api recordId;
    contact;
    isLoading = true;
    error;

    // Send Pay Links domain
    checkoutDomain = 'https://sendpaylinks.com';

    @wire(getContactDetails, { contactId: '$recordId' })
    wiredContact({ error, data }) {
        this.isLoading = false;
        if (data) {
            this.contact = data;
        } else if (error) {
            this.error = error.body?.message || 'Failed to load contact';
        }
    }

    handleCreateLink() {
        if (!this.contact) return;

        // Build the prefill URL with query parameters
        const params = new URLSearchParams({
            prefilled: '1',
            firstName: this.contact.FirstName || '',
            lastName: this.contact.LastName || '',
            email: this.contact.Email || '',
            phone: this.contact.Phone || '',
            line1: this.contact.MailingStreet || '',
            city: this.contact.MailingCity || '',
            state: this.contact.MailingState || '',
            postalCode: this.contact.MailingPostalCode || '',
            country: this.contact.MailingCountry || 'US',
            source: 'salesforce'
        });

        // Open the checkout link generator in a new tab
        const url = `${this.checkoutDomain}/admin/tools/link-generator?${params.toString()}`;
        window.open(url, '_blank');

        // Show success message and close the action
        this.dispatchEvent(new ShowToastEvent({
            title: 'Success',
            message: 'Opening checkout link generator...',
            variant: 'success'
        }));

        this.dispatchEvent(new CloseActionScreenEvent());
    }

    handleCancel() {
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
<!-- createCheckoutLink.html -->
<template>
    <lightning-quick-action-panel header="Create Checkout Link">
        <template if:true={isLoading}>
            <lightning-spinner alternative-text="Loading"></lightning-spinner>
        </template>

        <template if:true={error}>
            <div class="slds-text-color_error slds-p-around_medium">
                {error}
            </div>
        </template>

        <template if:true={contact}>
            <div class="slds-p-around_medium">
                <p class="slds-text-body_regular slds-m-bottom_medium">
                    Create a checkout link for <strong>{contact.FirstName} {contact.LastName}</strong>
                </p>
                <dl class="slds-list_horizontal slds-wrap">
                    <dt class="slds-item_label slds-text-color_weak">Email:</dt>
                    <dd class="slds-item_detail">{contact.Email}</dd>
                    <dt class="slds-item_label slds-text-color_weak">Phone:</dt>
                    <dd class="slds-item_detail">{contact.Phone}</dd>
                </dl>
            </div>
        </template>

        <div slot="footer">
            <lightning-button
                label="Cancel"
                onclick={handleCancel}
                class="slds-m-right_x-small">
            </lightning-button>
            <lightning-button
                variant="brand"
                label="Create Checkout Link"
                onclick={handleCreateLink}
                disabled={isLoading}>
            </lightning-button>
        </div>
    </lightning-quick-action-panel>
</template>
<!-- createCheckoutLink.js-meta.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>59.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>ScreenAction</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

3. Create the Quick Action

  1. Go to Setup > Object Manager > Contact
  2. Click Buttons, Links, and Actions > New Action
  3. Select:
    • Action Type: Lightning Web Component
    • Lightning Web Component: c:createCheckoutLink
    • Label: Create Checkout Link
  4. Save and add to your Contact page layout

HubSpot

Use a custom CRM card or workflow action:

// HubSpot CRM Extension
exports.main = async (context, sendResponse) => {
  const { firstName, lastName, email, phone, address, city, state, zip } = context.propertiesToSend;

  const prefillUrl = new URL('https://sendpaylinks.com/admin/tools/link-generator');
  prefillUrl.searchParams.set('prefilled', '1');
  prefillUrl.searchParams.set('firstName', firstName);
  prefillUrl.searchParams.set('lastName', lastName);
  prefillUrl.searchParams.set('email', email);
  // ... add more fields

  sendResponse({
    actions: [{
      type: 'OPEN_URL',
      url: prefillUrl.toString()
    }]
  });
};

Intercom

Add a custom action in your Intercom app:

// Intercom Canvas Kit
const user = conversation.user;

const checkoutUrl = `https://sendpaylinks.com/admin/tools/link-generator?prefilled=1` +
  `&firstName=${encodeURIComponent(user.name.split(' ')[0])}` +
  `&lastName=${encodeURIComponent(user.name.split(' ').slice(1).join(' '))}` +
  `&email=${encodeURIComponent(user.email)}`;

// Return as a button action
return {
  canvas: {
    content: {
      components: [{
        type: 'button',
        label: 'Create Checkout Link',
        action: { type: 'url', url: checkoutUrl }
      }]
    }
  }
};

Sales Attribution

When you include a salespersonId, the generated checkout link will automatically track the sale for commission purposes.

Automatic Salesperson Lookup

If the salespersonId matches a salesperson in your Send Pay Links account, their details will be pre-filled automatically.

Custom Attribution

You can also pass custom attribution that doesn't require a pre-existing salesperson record:

<input type="hidden" name="salespersonId" value="agent_{{agent.id}}">
<input type="hidden" name="source" value="phone_sale">
<input type="hidden" name="commissionRate" value="0.10">

Security Considerations

  1. Authentication Required: The endpoint requires an active admin session. Users must be logged into Send Pay Links.

  2. HTTPS Only: Always use HTTPS for production requests.

  3. Sensitive Data: Customer data is passed via URL parameters after redirect. Ensure your network is secure.

  4. Session Cookies: For cross-origin requests, ensure cookies are properly configured with SameSite=None; Secure.

Troubleshooting

"Unauthorized" Error

The user is not logged into Send Pay Links. Ensure they have an active session before making the request.

Form Not Submitting

Check that your form action URL is correct and includes the full domain.

Data Not Pre-filling

Verify the field names match exactly (case-sensitive). Use the browser's Network tab to inspect the redirect URL.

Cross-Origin Issues

If your CRM is on a different domain, you may need to:

  1. Use form submission (works cross-origin)
  2. Open in a new tab/window
  3. Configure CORS on your Send Pay Links domain

Next Steps

On this page