Skip to main content

Text to Pay-Over-Time

Overview#

The Text to Pay-Over-Time API can be used to send a Text Message (SMS) to the customer's phone in order to complete an online-purchase transaction.

Customers will receive a URL which can be used to checkout with Sunbit for a specific transaction.

Please include representative details such as id, name and email which will enable Sunbit to improve the experience for associates and help them close more transactions.

Text to Pay-Over-Time#

POST https://api-sandbox.sunbit.com/epay/api/v1/epay/send-link#

Important

This is a new version of the Sunbit Text to Pay-Over-Time API and the following update is available: "advisorEmail" attribute in the request body has been replaced with "representativeEmail" in order to be consistent across all APIs and SDKs. Please upgrade to the latest version by 12/31/2022.

Request Headers#

AttributeRequiredTypeDescription
sunbit-keyyestextProvided to you by Sunbit

Body#

AttributeRequiredTypeDescription
phoneNumbernotextThe customer's phone number. this field is required when sendSMS is true
amountyesnumberThe purchase amount
customerDetailsnoCustomerDetailsCustomer's details
locationyestextYour location ID as provided by Sunbit
transactionIdyestextAn external transaction identifier (referral) sent by the integrator for Pre-Qualification or Text to Pay-Over-Time and used to match the Webhook to the request.
representativeFirstNamenotextFirst Name of the representative/associate.
representativeLastNamenotextLast Name of the representative/associate.
representativeEmailnotextEmail address of the representative/associate.
sendSMSnobooleanFalse if Sunbit should not send the link to the customer. Default to True
departmentIdnotextThis parameter create a differentiation of offers within a certain merchant. The DepartmentID should be provided to you by Sunbit. Please refrain from sending data in this field which was not provided for you.
sourcePlatformnotextThe originating platform on whose behalf the API request is being made, if different from the alliance.
redirectUrlnotextA url destination which the user will fallback after completing / aborting the application.

CustomerDetails#

AttributeRequiredTypeDescription
firstNamenotextCustomer's first name
lastNamenotextCustomer's last name
emailnotextCustomer's email address
phonenotextCustomer's phone number
dateOfBirthnotextCustomer's date of birth (format: yyyy-MM-dd)
addressDetailsnoAddressDetailsCustomer's address details

AddressDetails#

AttributeRequiredTypeDescription
addressnotextCustomer's address
citynotextCustomer's city
statenotextCustomer's state
zipCodenotextCustomer's zipcode

JSON example

{  "phoneNumber": "9302006381",  "amount": 120,  "customerDetails": {    "firstName": "Kelly",    "lastName": "Moore",    "email": "someone@nothing.com",    "phone": "9302006381",    "dateOfBirth": "1965-05-15",    "addressDetails": {      "address": "55 King St.",      "city": "Los Angeles",      "state": "CA",      "zipcode": "55555"    }  },  "location": "test",  "roNumber": "1234",  "transactionId": "9999",  "representativeName": "Jason",  "representativeEmail": "jason@email.com"}

Response#

The response is a JSON with a URL link:

AttributeTypeDescription
shortTokentextShort-Token of Pay-overtime
longTokentextLong-Token of Pay-overtime
retailerIdtextretailer id - Only if present
urltextURL for Pay-overtime

Example#

{  "shortToken": "<short-token>",  "longToken":  "<long-token>",  "retailerId": "<retailer-id>",  "url":"<sunbit-pay-overtime-link>"}

Example#

## Validation Call Example:## Request:curl --request POST \  --url https://api-sandbox.sunbit.com/epay/api/v1/epay/send-link \  --header 'Content-Type: application/json' \  --header 'accept: */*' \  --header 'sunbit-key: YOUR_KEY' \  --data '{ "phoneNumber": "9302006381", "amount": 120, "customerDetails": { "firstName": "Kelly", "lastName": "Moore", "email": "someone@nothing.com", "phone": "9302006381", "dateOfBirth": "1965-05-15", "addressDetails": { "address": "55 King St.", "city": "Los Angeles", "state": "CA", "zipcode": "55555" } },"location": "test", "roNumber": "1234", "transactionId": "9999", "representativeName": "Jason",  "representativeEmail": "jason@email.com", "sendSMS": true}'

Errors#

Error CodeMessageDescription
403Provided alliance is not allowedsunbit-key provided is not associated with the retailer
404Location does not existLocation provided is not associated with the retailer
422Invalid phone numberInvalid US phone number
422Email address is not validInvalid representative email address
500Internal Server ErrorMissing location attribute or something went wrong on Sunbit's side