End to end API flow

1000

Timeline of order flow

1. Send customer and order information to Slope

Create an order. When you create an order, you pass in information such as the total, currency, items, and customer information.

On your server:

POST https://api.slope.so/v3/orders HTTP/1.1
{
     "total": 1000,
     "currency": "USD",
     "items": [
         {
             "skut": "CL-SOCKS-2",
             "unitPrice": 500,
             "quantity": 2
         }
     ],
     "customer": {
         "email": "[email protected]",
         "phone": "+14151234567",
         "externalId": "my-identifier-1",
         "businessName": "Stark Industries, Inc.",
         "address": {
            "line1": "200 Park Avenue",
            "city": "New York",
            "countryCode": "US",
            "provinceCode": "NY",
            "postalCode": "10166"
        }
     }
 }

2. Generate an order intent

Generate an order intent token on your servers. This token will allow your customer to update the order with their payment methods and payment terms without using your secret key.

📘

Order intent tokens do expire

Order intent tokens expire after four hours. If an expired secret is passed to the Slope Popup the onFailure callback with a ORDER_INTENT_EXPIRED secret. You must generate a new one your server and re-initialize the popup.

On your server:

POST http://api.slope.so/v3/orders/{{orderId}}/intent HTTP/1.1
{
    "scope": "payment",
    "secret": "{{ORDER_INTENT_TOKEN}}"
}

3. Open Slope.js popup

Use Slope.js to display Slope's popup by using the {{ORDER_INTENT_SECRET}} generated by your server from the previous step. On the front-end:

<script src="https://checkout.slope.so/slope.min.js"></script>
<script type="text/javascript">
 window.initializeSlope({
     intentSecret: ORDER_INTENT_SECRET,
 })
</script>
<button onclick="window.Slope.open()">Pay with Slope</button>

4. Finalize the order

Finalize an order once you have confirmed the order is ready. Depending on the payment terms, this will trigger a payout and, in the case of installments, the customer will be charged their first payment.

On your server:

POST https://api.slope.so/v3/orders/{{ORDER_ID}}/finalize HTTP/1.1

Payouts

Depending on your reconciliation requirements, you can configured payouts to either occur instantly or on certain weekdays (also known as batched payouts). Regardless of your payout settings, payouts can be reconciled with their orders using the Merchant Dashboard or the Slope API.

Collections

Payment collection is largely the responsibility of Slope but the status of an outstanding order can be accessed via Slope's API or the Merchant Dashboard. If a customer becomes overdue this will affect the underwriting of other orders they may want financed.