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 below, or view 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]
GET calls that support pagination for numerous results, such as when searching, also accept a perPage parameter that defines how many results can be returned on each page. The default is 10 and the maximum is 100. Switch between pages of results by appending the page parameter to the call. For example:
- https://integration.shopatron.com/api/v2/payment/?orderID=[order ID]&perPage=2&page=2
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:
|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.