Using Postman with the REST Pay API

Clover provides a complete Postman collection for testing REST Pay and working through common payment scenarios for POS integrations. The collection also allows you to easily generate and use an OAuth token for your test merchants.

📘

NOTE

For ease of setup, the collection only supports cloud connections.

Setting up your test app

To use Postman for testing all available endpoints, you need to create a Clover app configured with proper permissions for REST Pay. See Creating a sandbox app instructions.

📘

NOTE

When setting up the app's REST Configuration, set the Site URL for the Postman client you will be using:

  • Desktop - https://www.postman.com/oauth2/callback
  • Web - https://oauth.pstmn.io/v1/browser-callback

Install the test app

  1. On the App Settings page, select More > Preview in App Market.
  2. Copy the App ID and App Secret values to a temporary location for use in a later section.
    The More Tools page appears.
  1. In the test app box, click Connect and then click Accept.

Opening the collection

Click this button to open the collection in a workspace of your choice.

Run in PostmanRun in Postman

Set environment variables

There are a few variables which are used in requests to identify your app and test merchant. To set these variables, do the following.

  1. Log on the sandbox developer dashboard.
  2. Navigate to your apps dashboard.
  3. In the Your Apps list, click your REST Pay app.
    The App Settings page appears. Leave this browser tab open.
  4. In Postman, click Environments.
  5. Click the Clover Sandbox environment.
    The variables table appears.
  6. For the appId variable, copy your App ID value from the App Settings page and paste it in the Current Value field.
  7. For the appSecret variable, copy your App Secret value from the App Settings page and paste it in the Current Value field.
  8. On the side-nav, click Dev Kits.
  9. For the mId variable, copy your test merchant's ID (the thirteen-character alphanumeric string in the Test Merchant column) and paste it in the Current Value field.
  10. For the deviceId variable, copy the serial number of the device and paste the device serial number in the Current Value field.
  11. For the clientId variable, enter a name for the client that is making requests through your app (for example, myPOS).
  12. For the email variable, enter a valid email address to receive web receipts for test transactions.
  13. For the phone variable, enter a ten-digit phone number to receive SMS receipts for test transactions.
  14. Select the checkbox for the siteUrl variable with the same value as that configured for your test app.
  15. Click Save and then close the Clover Sandbox environment tab.
  16. In the Environments list, point to Clover Sandbox and click Set active (check mark).

Retrieve an OAuth token with Postman

Once your test app is installed to your test merchant and you've set up your environment, you can request an OAuth token which will have the necessary permissions to access and update merchant information. To create the token, complete the following steps.

  1. In Postman, click Collections and select Clover REST Pay API.
    The Clover REST Pay API tab appears.
  2. On the Authorization tab, click Get New Access Token.
    The Postman OAuth 2.0 window appears and redirects to the Clover dashboard login.
  3. Enter your sandbox credentials and click Log in.
  4. If you have multiple test merchants, the Select a Merchant page appears. Click the merchant that installed the REST Pay API app.
    The request is processed and an API token is returned.
  1. Click Use Token.
  2. Click Save.
    The collection's authorization setup is complete.

Connect to a Clover device

Once you have set the needed variables and obtained an API token, complete the following steps to finish setting up the collection and test the connection to your Clover device.

  1. In Postman, click Collections and select Clover REST Pay API > Setup.
  2. Send each of the setup requests to check connectivity, configure the device printer, and finalize the setup.
    Your environment is configured and ready for use.

Did this page help you?