Search for Payment
The Search Payments API offers a means of locating an existing payment by specifying one or more possible properties. A specific Payment ID does not have to be known to perform the search, as the response will return all results that fit the criteria. However, if a Payment ID is not provided then an Order ID is required instead, so one of those values must be known to get a list of payments.
The .json address above can be used to access the schema within Postman. An example use of the Payment API follows here — or go directly to the schema or the sample Postman Collection.
The request itself is built within the URL by adding a “/?” to the call followed by specific parameters joined by the “&” symbol. For instance, searching for the payment for a particular order and retailer would use the following format:
- https://integration.shopatron.com/api/v2/payment/?orderID=[order ID]&retailerID=[retailer ID]
This example case creates a call that will search for the payment used for a specific order. The request will specify:
- Payment for Order #1000000
This guide will demonstrate how to put together each section of the request to find the appropriate payments.
A variety of possible properties can be used to locate an existing payment. The API call always requires at least one of the following:
|orderID||integer||A unique identifier for the order. The minimum value is "1".|
|paymentID||integer||A unique identifier for the payment. The minimum value is "0".|
The API can also search for any of these additional elements:
|page||integer||The maximum number of results to return. The minimum value is "1" and the maximum value is "100". The default is "10".|
|perPage||integer||The maximum number of items to return per page. The minimum value is "1" and the maximum value is "100". The default is "10".|
|sortBy||string||The field(s) to sort results by, use a minus (-) in front of field name for descending, a plus (+) for ascending. The minimum value is "1".|
|manufacturerID||string||A single or list of manufacturerIDs. They must be positive integers.|
|retailerID||string||A single or list of retailerIDs. They must be positive integers.|
The Full Request
Using the URL format as outlined above, the entire call is fairly simple to put together. This sample will search for payments matching the example’s parameters. Any amount of additional parameters could be appended if desired.
The Full Response
The API returns the following response. The object returned is a Collection, which contains all of the payment results that fit the provided information. The response details all of the information associated with Order 1000000. It follows the same organizational structure as the standard Get Payment Information response.
In this case, the search returned a single result.