> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mercoa.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mercoa.com/_mcp/server.

# Find Process Jobs

GET https://api.mercoa.com/payment-gateway/process-jobs

Search payment gateway process jobs

Reference: https://docs.mercoa.com/virtual-card-agent/process/find

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `status` (enum, optional) — Filter jobs by status
  - Allowed values: `PENDING`, `COMPLETED`, `FAILED`
- `startDate` (datetime, optional) — Start date filter for job creation time
- `endDate` (datetime, optional) — End date filter for job creation time
- `orderBy` (enum, optional) — Field to order jobs by. Defaults to CREATED_AT.
  - Allowed values: `CREATED_AT`, `UPDATED_AT`, `STATUS`
- `orderDirection` (enum, optional) — Direction to order jobs by. Defaults to desc.
  - Allowed values: `ASC`, `DESC`
- `limit` (integer, optional) — Number of jobs to return. Limit can range between 1 and 100, and the default is 10.
- `startingAfter` (string, optional) — The ID of the job to start after. If not provided, the first page of jobs will be returned.

## Response

### 200

- `jobs` (list of object, required) — List of payment gateway process jobs matching the search criteria
  - `jobStatus`: `pending`
    - `createdAt` (datetime, required) — The timestamp when the job was created
    - `jobId` (string, required) — The job ID of the payment gateway processing job
    - `updatedAt` (datetime, required) — The timestamp when the job was last updated
  - `jobStatus`: `success`
    - `attempts` (list of object, required) — List of payment gateway attempts for this job
      - `id` (string, required) — The unique identifier for the payment gateway attempt
      - `status` (enum, required) — The status of the attempt
        - Allowed values: `PENDING`, `COMPLETED`, `FAILED`
      - `createdAt` (datetime, required) — The timestamp when the attempt was created
      - `amount` (double, optional) — The amount processed in this attempt
      - `receiptUrl` (string, optional) — The URL of the receipt for this attempt
    - `createdAt` (datetime, required) — The timestamp when the job was created
    - `jobId` (string, required) — The job ID of the payment gateway processing job
    - `updatedAt` (datetime, required) — The timestamp when the job was last updated
    - `gatewayAmount` (double, optional) — The amount displayed on the payment gateway (may include fees)
    - `invoiceAmount` (double, optional) — The invoice amount detected from the payment gateway
    - `receiptUrl` (string, optional) — The URL of the receipt that was downloaded from the payment gateway
    - `requiredData` (object, optional) — Information about what data is required to proceed with payment
      - `needsAccountNumber` (boolean, optional) — Whether the payment gateway requires an account number to proceed
      - `needsPostalCode` (boolean, optional) — Whether the payment gateway requires a postal code to proceed
      - `needsEmail` (boolean, optional) — Whether the payment gateway requires an email address to proceed
      - `needsAccountHolderFirstName` (boolean, optional) — Whether the payment gateway requires the account holder's first name to proceed
      - `needsAccountHolderLastName` (boolean, optional) — Whether the payment gateway requires the account holder's last name to proceed
      - `needsFullServiceAddress` (boolean, optional) — Whether the payment gateway requires a full service address to proceed
      - `needsPhoneNumber` (boolean, optional) — Whether the payment gateway requires a phone number to proceed
    - `vendorName` (string, optional) — The vendor name detected from the payment gateway
  - `jobStatus`: `failed`
    - `createdAt` (datetime, required) — The timestamp when the job was created
    - `errorType` (enum, required) — The error that occurred during the payment gateway processing job
      - Allowed values: `NO_VALID_PAYMENT_GATEWAY_FOUND`, `PAYMENT_GATEWAY_UNSUPPORTED`, `CARD_DETAILS_INVALID`, `CARD_DECLINED`, `INVOICE_AMOUNT_MISMATCH`
    - `jobId` (string, required) — The job ID of the payment gateway processing job
    - `updatedAt` (datetime, required) — The timestamp when the job was last updated
    - `errorMessage` (string, optional) — The error message that occurred during the payment gateway processing job
- `hasMore` (boolean, required) — Whether there are more jobs available beyond the current page

## Errors

### 400 Bad Request

- `errorName` ("BadRequest", required)
- `content` (string, required)

### 401 Unauthorized

- `errorName` ("Unauthorized", required)
- `content` (string, required)

### 403 Forbidden

- `errorName` ("Forbidden", required)
- `content` (string, required)

### 404 Not Found

- `errorName` ("NotFound", required)
- `content` (string, required)

### 409 Conflict

- `errorName` ("Conflict", required)
- `content` (string, required)

### 500 Internal Server Error

- `errorName` ("InternalServerError", required)
- `content` (string, required)

### 501 Unimplemented

- `errorName` ("Unimplemented", required)
- `content` (string, required)

## Examples

**Response**

```json
{
  "jobs": [
    {
      "jobStatus": "pending",
      "createdAt": "2024-01-01T00:00:00Z",
      "jobId": "pgp_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
      "updatedAt": "2024-01-01T00:00:00Z"
    },
    {
      "jobStatus": "success",
      "attempts": [
        {
          "id": "pgpa_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
          "status": "COMPLETED",
          "createdAt": "2024-01-01T00:00:00Z",
          "amount": 150.75,
          "receiptUrl": "https://www.payment-gateway.com/receipt/123123"
        }
      ],
      "createdAt": "2024-01-01T00:00:00Z",
      "jobId": "pgp_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
      "updatedAt": "2024-01-01T00:00:00Z",
      "gatewayAmount": 155.5,
      "invoiceAmount": 150.75,
      "receiptUrl": "https://www.payment-gateway.com/receipt/123123",
      "vendorName": "Acme Corporation"
    },
    {
      "jobStatus": "failed",
      "createdAt": "2024-01-01T00:00:00Z",
      "errorType": "NO_VALID_PAYMENT_GATEWAY_FOUND",
      "jobId": "pgp_8f86116b-3b4d-4ded-99ef-3bc929d8c33c",
      "updatedAt": "2024-01-01T00:00:00Z",
      "errorMessage": "No valid payment gateway was found in the document or HTML"
    }
  ],
  "hasMore": true
}
```

**SDK Code**

```python Find failed process jobs
import requests

url = "https://api.mercoa.com/payment-gateway/process-jobs"

querystring = {"status":"FAILED","startDate":"2024-01-01T00:00:00Z","endDate":"2024-12-31T23:59:59Z"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```typescript Find failed process jobs
import { MercoaClient } from "@mercoa/javascript";

const client = new MercoaClient({ token: "YOUR_TOKEN" });
await client.paymentGateway.process.find({
    status: "FAILED",
    startDate: new Date("2024-01-01T00:00:00.000Z"),
    endDate: new Date("2024-12-31T23:59:59.000Z")
});

```

```go Find failed process jobs
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Find failed process jobs
require 'uri'
require 'net/http'

url = URI("https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Find failed process jobs
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Find failed process jobs
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Find failed process jobs
using RestSharp;

var client = new RestClient("https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Find failed process jobs
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mercoa.com/payment-gateway/process-jobs?status=FAILED&startDate=2024-01-01T00%3A00%3A00Z&endDate=2024-12-31T23%3A59%3A59Z")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```