Lopay Partner API
    Lopay Partner API
    • Introduction
    • Environments
    • Authentication
    • Webhooks
    • Terminal ordering
    • Reporting
    • Errors
    • Getting started
    • Payment Links
      • List all payment links
        GET
      • Create a new payment link
        POST
      • Get existing payment link
        GET
      • Update existing payment link
        PATCH
      • Revoke an existing payment link
        DELETE
      • Send a payment link via email and/or SMS
        POST
    • Webhook subscriptions
      • Get login link for Lopay Partner Webhook Portal
        GET
      • List webhook subscriptions
        GET
      • Create webhook subscription
        POST
      • Update existing webhook subscription
        PUT
      • Remove an existing webhook subscription
        DELETE
    • Merchants
      • List all merchants
        GET
      • Register a new merchant
        POST
      • Get merchant details
        GET
      • Update merchant bank details for receiving payouts.
        PUT
      • Get merchant onboarding link
        GET
      • Create account session with permissions for the specified embedded components.
        POST
      • Get list of available hardware for given merchant to purchase
        GET
      • Order terminal hardware for the specified merchant.
        POST
    • Marketing Deeplinks
      • List all affiliate marketing deeplinks.
      • Create a new affiliate marketing deeplink.
    • Reports
      • List all statement activity
    • Customers
      • Temporarily store customer details
    • Subscription Plans
      • Create a new subscription plan
      • List all subscription plans
      • Get existing subscription plan
    • Subscriptions
      • Get existing subscription

    Terminal ordering

    📌
    Terminal ordering is not enabled by default for partners. If you are interesting in this feature, please reach out to backend@lopay.com.
    Terminal ordering allows Partners to order Lopay terminals (WisePad 3, M2, S700, etc...) and accessories on behalf of merchants.

    Overview of Terminal Ordering Process#

    Step 1: Fetch Available Hardware#

    Call the GET /api/1/partner/merchant/{id}/hardware endpoint to retrieve a list of available terminals and accessories. This data is used to present hardware options to the user.
    Endpoint:
    GET /api/1/partner/merchant/{id}/hardware
    Sample Response:
    {
      "data": [
        {
          "id": "36e82a3c-91d0-4df4-8dd7-2ce7e57a6da5",
          "name": "m2",
          "imageUrl": null,
          "isDefaultCardReader": true,
          "pricing": [
            {
              "id": null,
              "primary": true,
              "baseCost": {
                "units": 2400,
                "currencyCode": "USD"
              },
              "totalCost": {
                "units": 3095,
                "currencyCode": "USD"
              },
              "postageCost": {
                "units": 695,
                "currencyCode": "USD"
              },
              "taxCost": {
                "units": 0,
                "currencyCode": "USD"
              },
              "billingCycle": null
            }
          ],
          "accessories": []
        },
        {
          "id": "ed21467d-3e0a-469c-9eb2-3b34361230bd",
          "name": "s700",
          "imageUrl": null,
          "isDefaultCardReader": false,
          "pricing": [
            {
              "id": null,
              "primary": true,
              "baseCost": {
                "units": 29900,
                "currencyCode": "USD"
              },
              "totalCost": {
                "units": 30795,
                "currencyCode": "USD"
              },
              "postageCost": {
                "units": 895,
                "currencyCode": "USD"
              },
              "taxCost": {
                "units": 0,
                "currencyCode": "USD"
              },
              "billingCycle": null
            }
          ],
          "accessories": []
        }
      ]
    }

    Step 2: Calculate the total and present the total to the user#

    Add together totalCost of each selected item and return display it to the user.

    Step 3: Create the order#

    Once the user has selected the items to purchase, use the POST /api/1/partner/merchant/{id}/order-hardware endpoint to create an order.
    Endpoint:
    POST /api/1/partner/merchant/{id}/order-hardware
    Sample Request:
    {
      "hardware": [
        {
          "id": "36e82a3c-91d0-4df4-8dd7-2ce7e57a6da5",
          "quantity": 1
        }
      ],
      "deliveryAddress": {
        "nameOrNumber": "#11",
        "street": "132 My Street",
        "town": "Kingston",
        "state": "NY",
        "postcode": "12401",
        "phone": "+15555551234",
        "deliveryNotes": "Leave at the back door"
      },
      // See React example below on how to obtain payment method ID
      "stripePaymentMethodId": "pm_xxx"
    }
    Sample Response:
    {
      "publishableKey": "pk_test_51KUBPnJLmLxc08DqBQBReWGPrCSwTAOIlVdkviZruZNq81LxtNNCtRjXRygJz5Z1YGCeqcjIkGjsGjqozjkpPzOj00BITCxYhp",
      "clientSecret": "client_secret",
      "ephemeralKey": {
        "id": "ephemeral_key_id",
        "object": "ephemeral_key",
        "created": 1737546937,
        "expires": 1737548393,
        "livemode": false,
        "secret": "ephemeral_key_secret"
      },
      "stripeCustomerId": "cus_xxx"
    }
    The response provides the necessary information to initialise Stripe Elements for payment processing.

    Integrating Stripe Elements#

    Below is an example of how to use the Stripe React SDK to initialise Stripe Elements, generate a payment method, and handle the checkout process.

    Installation#

    Ensure you have the Stripe React SDK installed:

    Example TypeScript Code#

    Summary#

    Fetch available hardware using GET /api/1/partner/merchant/{id}/hardware.
    Submit the order via POST /api/1/partner/merchant/{id}/order-hardware.
    Use the Stripe SDK to handle payments with the provided publishable key, client secret, and ephemeral key.
    Modified at 2025-01-22 15:54:43
    Previous
    Webhooks
    Next
    Reporting
    Built with