Create Virtual Cart

POST https://api.paytomorrow.com/api/ecommerce/application/create/cart

Request for creating a virtual cart application on PayTomorrow. It responds with a the url for the customer's PayTomorrow application and the application token, which needs to be stored and linked to the order on the ecommerce platform.

{
"orderId": The order's ID on the ecommerce site,
"personalFirstName": Consumer's First Name,
"personalLastName": Consumer's Last Name,
"residenceStreetName": Shipping address must be equal to billing address,
"residenceCity": Shipping address' city,
"residenceZip": Shipping address' zip code (must match billing zip code),
"residenceState": Shipping address' state,
"personalEmail": Consumer's email (must be a valid email),
"returnUrl": The url we will redirect the user to once the application is finished,
"cancelUrl": The url we will redirect the user if the application is cancelled,
"notifyUrl": The url we will use to postback the application status back to your site,
"personalCellPhone": The customer's cell phone number (optional),
"loanAmount": The total cart amount (the amount that will be financed),
"shipping": Shipping costs,
"taxes": Taxes,
"items": An array of cart items (ApplicationItem). See below fo the description.
}
// Items
{
"description": Product description,
"quantity": Quantity of the product,
"price": Price of the product,
"brand": (optional) Product brand,
"model": (optional) Product model
}

Request Params Requirements

  • "orderId": Required, any string is valid.
  • "personalFirstName": Required, any string is valid.
  • "personalLastName": Required, any string is valid.
  • "residenceStreetName": Any string is valid.
  • "residenceCity": Any string is valid.
  • "residenceZip": 5 character length string.
  • "residenceState": 2 character length string.
  • "personalEmail": Required, must be a valid email.
  • "returnUrl": Must be a valid http or https url pattern.
  • "cancelUrl": Must be a valid http or https url pattern.
  • "notifyUrl": Must be a valid http or https url pattern.
  • "personalCellPhone": Must be a valid US phone number. Numbers only and no country code.
  • "loanAmount": Required, must be a number.
  • "shipping": must be a number.
  • "taxes": must be a number.
  • "items": Required.

Headers

Authorization: Bearer the-access-token // The access token
Content-Type: application/json

Request Body

{
"loanAmount": 1500,
"taxes": 0,
"shipping": 0,
"personalCellPhone": "2342342343",
"personalFirstName": "Ely",
"personalLastName": "Cheikh",
"personalEmail": "ely.test@gmail.com",
"orderId": "https://www.test.com",
"notifyUrl": "https://www.test.com",
"redirectUrl": "https://www.test.com",
"cancelUrl": "https://www.test.com",
"residenceStreetName": "123 somewhere",
"residenceCity": "Cornelius",
"residenceState": "NC",
"residenceZip": "28031",
"items": [
{
"description": "sdfs",
"brand": "sdf",
"model": "sdf",
"price": 500,
"quantity": 3,
"total": 1500
}
]
}

Success Response Example

{
"url": "http://ecom-staging.paytomorrow.com/verify/personal?app=d7f5b8ee-380c-4559-be18-0311e9922f98&auth=80576fc3-2ef5-41c1-a499-d9fb1fb1eea4",
"token": "d7f5b8ee-380c-4559-be18-0311e9922f98"
}