About the API Tester Tool

The API Tester tool provides a request and response mechanism that enables you to verify functionality of the ROM APIs. The tool is a test harness that allows direct interaction with a store's exchange API. It provides sample request XML files for the available APIs. You can use a sample request as is, customize it, or copy it to a different XML test program.

Procedure

To access the API Tester tool, select Tools > API Tester from the top menu.

To use the API Tester, follow these steps.

  1. Select the Organization, Channel, and Environment from the drop-down menus to enable loading of existing rules.
  2. Select Service Type from the drop-down menu.
  3. Select the API for the particular type of service selected. The table below shows the available services and their associated APIs from the drop-down menus.
    Service API

    Inventory

    Allocation.Create

    Allocation.Rollback

    Details.Request

    InStoreQuantity.Request

    Quantity.Request

    Order

    Cancel

    Create

    Detail

    Search

    Search.RelatedOrder

    Payments

    CreditCard.Auth

    CreditCard.Auth.Cancel

    NoAccountNumberAuth.Cancel

    Paypal.DoAuth

    Paypal.DoExpress

    Paypal.SetExpress

    Paypal.GetExpress

    Paypal.Void

    Pan.Protect

    Settlement.Request

    Settlement.Request.NoPan

    StoredValue.Balance

    StoredValue.CashOut

    StoredValue.Fund

    StoredValue.FundAndActivate

    StoredValue.Redeem

    StoredValue.RedeemVoid

    TenderType.Lookup

    Risk

    Fraud.Access

    Store Locator

    Search by Postal Code

    Search by Latitude/Longitude

    Search by Storefront ID

    TDF (Tax Duty Free)

    Taxes.Quote

  4. As you select a service and API, the URL field automatically updates to reflect your selections.
  5. To test header values, enter a header string in the Header field, then enter the value for that string in the Value field. You cannot change the Content-Type or ApiKey fields. You can enter as many Headers as you like.
  6. The Request field automatically populates with a sample XML request, based on the the service and API that you choose. You can use this sample as is, customize it, or copy it to use in another API testing tool.
  7. Click Submit Request. The API Tester evaluates the request and returns a response.

Note: For the Payments service APIs, you must also enter the Tender Type (for example, MC for Master Card). For the Store Locator service, you must supply additional parameters, which vary with the specific API chosen.

Additional Information

URL

The URL string includes the name of the channel that you selected in Step 1; for example, https://tst01-epapi-na.gsipartners.com/v1.0/stores/TMSUS/address/validate.xml. In this case, you selected TMSUS for the Channel; therefore, TMSUS was incorporated into the URL string.

Headers

As noted above, you can check header values by entering a header string into the Header field and a value into the Value field.

This value could also be an additional API key where:

Header = API key

Value = Key itself

You can verify multiple headers and values at once. To delete header information, click the Remove Header button, which appears when header information is entered.

Request

The APIs of most services use the HTTP method POST. The Store Locator Service uses GET for its APIs.

There are several ways to invoke your Request:

  • Paste your own XML directly into the Request field.
  • Select the URL that is built dynamically (URI) and copy it into a different tool. Note: You can also take the copied URI and verify it using another web service API call.
  • Copy the sample XML request into a code editor and use it as a starting point for creating your request data. You can then paste your customized request into the Request field.
  • For the Store Locater service, provide specific input data into the Parameters section. When you choose Store Locator as a service, each API chosen under that service will display a specific set of parameters. Enter text directly into the fields next to each parameter.

Response

Response codes in the 400 level generally mean that the user made an error; while response codes in the 500 level indicate that the system is in error.

Examples:

  • 404 – specified resource does not exist
  • 500 - internal server error.

For additional information about the APIs, consult the API Reference.