Migrating from V3 API
Purpose
The purpose of a new V4 API is to support global Slope customer accounts, which allows for customers to apply once for pre-approval amounts and use a single account across any Slope merchant. Historically with the V3 API, the customer
object was created by merchants thus creating duplicate accounts for buyers.
Product enhancements
By eliminating the responsibility of customer management from merchants, developer API setup is simplified and additional product improvements are gained:
- Increased sales by leveraging a larger addressable market of users with a pre-existing Slope account
- Improved security & fraud protection with required authentication from Slope during checkout
- More accurate & up to date customer information directly from Slope's customer data set
V4 API changes
We've designed the new API to be nearly identical to V3 API to ease the transition. Most endpoints will look the same as before. At a high level, you'll only be calling the /v4/orders
endpoint during checkout.
POST /v4/orders
to create a new order. Note the customer
field is now gone.
{
"amount": 12345,
"currency": "usd",
"externalId": "your_reference_id"
// ... other fields similar to v3/orders API
}
This endpoint will return a JSON body response like this
{
"checkoutUrl": "https://checkout.slope.so/pay?code=1234",
"checkoutCode": "XXX",
"id": "ord_123",
"number": "12345678",
// ... other fields
}
Depending on your front-end implementation, you will use the checkoutCode
for the Slope.js
modal OR redirect the user to the checkoutUrl
for the low-code redirect flow.
Notable changes from V3 API
- There won't be any
/v4/customers
POST endpoints. GET endpoints will be available but only return customers that have linked an order to your merchant. - The
customerId
field will remain NULL until after an order isopen
status. - The standalone
pre_qualify
flow will be replaced by redirecting users topay.slope.so
to sign up and get their limits. - The
Slope.js
SDK now pre-loads an iframe in the background upon page-load. This provides a smooth user experience as the modal pop ups immediately.
Improved developer experience
- There won't be a need to make a separate call to POST
/v3/orders/intent
as the thecheckoutCode
will be returned automatically during order creation. Because authentication sessions are now handled by Slope, thecheckoutCode
will no longer expire. - Simple GET filter query params will be supported like
/v4/orders?status=open
and/v4/customers?phone=14151234567
Updated 5 months ago