Test your hosted checkout integration (macOS/Linux)

North America—United States and Canada

You can test the hosted checkout experience without much code with basic tools, such as cURL and a web browser.

  1. Generate a private token and view the merchantId to set up a hosted checkout integration.
  2. Copy the following cURL command:
curl --location --request POST 'https://apisandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts' \
--header 'X-Clover-Merchant-Id: {merchantId}' \
--header 'Authorization: Bearer {privateKey}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "customer" : {
    "email": "[email protected]",
    "firstName" : "Example",
    "lastName": "Customer",
    "phoneNumber": "555-555-0002"
  },
  "shoppingCart" : {
    "lineItems": [
      {
        "name": "Apple",
        "unitQty": 1,
        "price": 100
      },
      {
        "name": "Orange",
        "unitQty": 2,
        "price": 75
      }
    ]
  }
 }'
  1. In a text editor, paste the command and then replace the following placeholders:
    • merchantId
    • privateKey
    • emailAddress
  2. Copy the edited command.
  3. Start a terminal session.
  4. Paste the edited cURL command and press Enter to run it. A response is returned.
  5. Copy the URL value from the href field.
  6. In a web browser, paste the URL and press Enter.
  7. On the checkout page, verify the following information is correct:
    • Items and their quantities
    • Customer’s information
  8. Enter the following card information:
    • Card Number: 6011 3610 0000 6668
    • MM/YY: a month and year in the future
    • CVV: a 3-digit number
    • ZIP: a 5-digit number
  9. Click Pay. The payment is processed and a Payment Received message appears.
  10. Verify a receipt is sent to your email address.