Skip to main content

Sunbit Estimate

Overview#

The Sunbit Estimate "As Low As" API allows you to get a quick view into monthly payments with a simple API call. You can easily retrieve a monthly payment amount for one or more items in a single request.

Sunbit Estimate API#

PUT https://api-sandbox.sunbit.com/purchase/api/v1/payment-estimation#

Request Headers#

PropertyRequiredTypeDescription
sunbit-keyyestextProvided to you by Sunbit

Query Parameters#

ParameterDefaultDescription
timeZoneAmerica/Los_AngelesTimezone of the client.
location---Store Id, or Store Name, or any other identifier of the location.
representative---Representative Employee Id, or Representative Name, or any other identifier of the representative.

TimeZone, location, and representative request parameters are optional.

Body#

Array of objects containing the following fields:

AttributeTypeDescription
idtextClient Id for the total amount.
totalAmountnumberTotal amount of a purchase in USD.

In order to resolve timezone in a browser the following JS snippet can be used:

let timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;

Response#

The response will contain an array of objects with the following fields:

Important

Returned payment estimation of '-1' indicates that the amount sent was inapplicable for financing.

AttributeTypeDescription
idtextThe id that was provided for this estimation
monthlyAmountnumberThe monthly payment of the loan
amountFinancednumberThe amount borrowed
downPaymentnumberThe required down payment; amount due at checkout
aprnumberThe APR of the loan
downPaymentPercentnumberThe percentage of the amount financed that will be required as down payment

Example#

Estimate monthly payment amount for one or more items in a single request.

curl "https://api-sandbox.sunbit.com/purchase/api/v1/payment-estimation?timeZone=America%2FLos_Angeles&location=ABC123&representative=John%20Doe"  -X PUT  -H "sunbit-key: YOUR_KEY"  --data-binary $'[{ "id":"123", "totalAmount":600},{ "id":"567", "totalAmount":1200},{ "id":"999", "totalAmount":12500}]'

The above command returns an array of payment plans consisting of monthly payment amount in USD, financed amount in USD, down payment amount in USD, and APR:

[  { 'id': '123', 'monthlyAmount': 46.56, 'amountFinanced': 480, 'downPayment': 120, 'apr': 28.99908327584324 },  { 'id': '567', 'monthlyAmount': 93.12, 'amountFinanced': 960, 'downPayment': 240, 'apr': 29.002176259712886 },  { 'id': '999', 'monthlyAmount': -1, 'amountFinanced': -1, 'downPayment': -1, 'apr': -1 },]

Errors#

Error CodeMessageDescription
403Bad credentialsSunbit key or secret is not valid
422LocationNotFoundLocation is required for multiple-vertical alliance
422LocationNotFoundLocation not found for alliance
422LocationNotFoundAlliance vertical not found
500Internal Server ErrorSomething went wrong on Sunbit's side