Documentation

Checkout Integration

This guide will help you get started with the integrating a retail checkout to your existing website.

Prerequisites

To use the retail checkout feature, you must have a brand activated for retail in MidwayPlus. To get started, you need API credentials. API credentials can be managed in Settings > Integrations > API/Webhooks sandbox.

Creating a checkout session

When your user is ready to checkout, create a checkout session using the /v1/Cart/CreateCheckout endpoint. The endpoint requires a list of items and their quantities, identified by the Part Number, as well as a successUrl and ID. The ID should be a unique identifier to your user's session, login, or cart. The price is optional - if not specified, the price will be populated from the "Retail Selling Price" you manage in MidwayPlus. Note that you must be authenticated with the MidwayPlus API - more details can be found on the dedicated page here.

{
   "id": "df4f3fe2-460c-4bec-9e6a-05db5fd28907",
   "successUrl": "https://mywebsite.com/checkout/thankyou",
   "items": [
       {
           "partNumber": "BRK-001",
           "quantity": 1,
           "priceEach": 249.99
       }
   ]  
}

Checkout

Once you have successfully started a checkout session via the API, you will receive a redirect URL that you should send your user to.

{
    "redirectUrl": "https://shop.mywebsite.com/Checkout/Start/zhf8m1o1%2fYVXhEeasx42WQ%3d%3d"
}

Notification of a placed order

Once your customer has completed their checkout, they will be redirected to the URL you submitted as the successUrl with the id you submitted, and the MidwayPlus order number in the URL. For example, https://mywebsite.com/checkout/thankyou?id=df4f3fe2-460c-4bec-9e6a-05db5fd28907&midway_order_number=165338-1