Search for Customer Payment Method
The Search Payment Method API allows the user to find a particular payment method based on a number of variables.
Version | 2.0 |
Call | https://integration.shopatron.com/api/v2/customerPaymentMethod |
Supported Formats | JSON |
HTTP Method | GET |
Schema | https://integration.shopatron.com/api/v2/schema/customerPaymentMethodSearch.json |
The .json address above can be used to access the schema within Postman. An example use of the Customer Payment Method 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 a certain customer’s payment methods under a particular catalog would use the following format:
- https://integration.shopatron.com/api/v2/customerPaymentMethod/?customerID=[Customer ID]&catalogID=[Catalog ID]
In the case of performing a search with multiple terms of the same parameter, such as retrieving multiple customer IDs at once, use a comma-separated list as shown below.
- https://integration.shopatron.com/api/v2/customerPaymentMethod/?customerID=[Customer ID One],[Customer ID Two],[Customer ID Three]
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/customerPaymentMethod/?customerID=[Customer ID]&perPage=2&page=2
Example
In this example, the payment methods being searched for includes these particular properties:
- Payment methods of Customer ID 000000
- Payment methods used with Catalog ID 2
Required Parameters
A variety of possible properties can be used to locate an existing customer. The API call always requires at least one of these data points to reference as a search term:
Parameter | Type | Description |
customerID | string | A unique identifier for the customer, usually an integer. The minimum length is 1. |
paymentMethodID | integer | A unique identifier for the payment method. The minimum is “1”. |
page | integer | The page number to begin listing the results from. The default and minimum value is “1”. While this parameter is technically required, this default means that it does not have to be provided in the request unless a different page is specifically desired. Also, note that the page cannot be the sole parameter in the search query – if provided, there must be at least one of the other parameters in this table. |
Optional Parameters
There are several additional parameters that can be used to filter results:
Parameter | Type | Description |
manufacturerID | string | A single or list of manufacturerIDs, which must be positive integers. The minimum length is 1. |
catalogID | integer | The unique number for the manufacturer’s catalog. The minimum is “0”. |
catalogIDs | string | A single or list of catalogIDs, which must be positive integers. The minimum length is 1. |
retailerID | string | A single or list of retailerIDs, which must be positive integers. The minimum length is 1. |
paymentType | object | The payment type of the method. See the chart in the Create Order guide for the supported payment types. |
currency | enum | A International Standards Organization Code for the payment currency (e.g. USD, CAD). |
perPage | integer | The (max) 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 length is 1. |
The Full Request
Using the URL format as outlined above, the entire call is fairly simple to put together. This sample will search for customers matching the example’s parameters. Any amount of additional parameters could be appended if desired.
https://integration.shopatron.com/api/v2/customerPaymentMethod/?customerID=000000&catalogID=2
The Full Response
This is the full response returned by the API. This particular customer has two payment methods associated with this catalog, resulting in two data blocks.
{
"collection": [
{
"manufacturerID": 1111,
"catalogID": 2,
"currency": "GBP",
"paymentMethodID": 222111,
"customerID": "000000",
"billingAddressID": "012345",
"paymentType": "PP",
"payPalPaymentID": "O-CCCBBBAAA",
"payPalPayerID": "AA22BB22CC22",
"payPalToken": "EC-9HL55435GD638554J"
},
{
"manufacturerID": 1111,
"catalogID": 2,
"currency": "GBP",
"paymentMethodID": 111222,
"customerID": "000000",
"billingAddressID": "543210",
"paymentType": "PP",
"cardIssuer": "",
"payPalPaymentID": "O-AAABBBCCC",
"payPalPayerID": "AA22BB22CC22",
"payPalToken": "BB-AA1111111A"
}
]
}