Search

Introduction

This request displays how you can use an Elasticsearch query to pull transaction data from Secure Payments. Changing the type in the endpoint allows you to search for different objects and determine if the results should be exported and emailed in a report.

For more information, see our article on The NACHA Process – Start to Finish.

{
  "search": {
    "size": 10,
    "from": 0,
    "aggregations": {
      "aggs": {
        "terms": {
          "field": "batch.keyword",
          "size": 100
        }
      }
    },
    "sort": [],
    "query": {
      "bool": {
        "must": [
          {
            "bool": {
              "should": {
                "query_string": {
                  "query": "*Wells Fargo*",
                  "default_operator": "AND",
                  "fields": [
                    "customer_name",
                    "processor",
                    "metadata",
                    "status",
                    "batch"
                  ]
                }
              }
            }
          },
          {
            "bool": {
              "must": [
                {
                  "range": {
                    "created": {
                      "gte": "2021-04-22",
                      "lte": "2021-04-29"
                    }
                  }
                }
              ]
            }
          },
          {
            "match": {
              "status": "PROCESSING"
            }
          }
        ]
      }
    }
  }
}

📘

Try It

To receive a 200 response, simply click the button. The payload is a standard Elasticsearch query object, which you can change in the Body Params section.

This example is linked to our demo account. If you'd like to use a different account, enter values for Authorization and Secret in the Headers section above the payload.

Path Params
string
enum
required
Defaults to transaction

The type of search. For transactions, you can specify a get value of export as true or false (transaction?export=false)

Allowed:
string
enum
required
Defaults to false

Whether you want to export the data. True indicates export.

Allowed:
Body Params
json
Defaults to { "search": { "size": 10, "from": 0, "aggregations": { "aggs": { "terms": { "field": "batch.keyword", "size": 100 } } }, "sort": [], "query": { "bool": { "must": [ { "bool": { "should": { "query_string": { "query": "*Wells Fargo*", "default_operator": "AND", "fields": [ "customer_name", "processor", "metadata", "status", "batch" ] } } } }, { "bool": { "must": [ { "range": { "created": { "gte": "2021-04-22", "lte": "2021-04-29" } } } ] } }, { "match": { "status": "PROCESSING" } } ] } } } }
Headers
string
Defaults to application/json
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
text/plain