---
title: "Create Validation Job"
method: POST
path: "/payment-gateway/validate"
tags: ["payment-gateway > validate"]
---

# Create Validation Job

`POST /payment-gateway/validate`

## Request

- Base URL: `https://api.mercoa.com`
- URL: `https://api.mercoa.com/payment-gateway/validate`
- Auth: HTTP bearer

Create a job to validate a payment gateway

## Request body

- union
  - object
    - `type` 'document', required: Discriminator value: document
    - `document` string, required: The invoice document PDF to extract the payment gateway from. Must be in base64 format or a publicly accessible URL.
  - object
    - `type` 'html', required: Discriminator value: html
    - `html` string, required: The HTML from an email to extract the payment gateway from

## Response `200`

Response with status 200

- union
  - object
    - `jobStatus` 'pending', required: Discriminator value: pending
    - `jobId` string, required: The job ID of the payment gateway validation job
    - `createdAt` string, date-time, required: The timestamp when the job was created
    - `updatedAt` string, date-time, required: The timestamp when the job was last updated
  - object
    - `jobStatus` 'success', required: Discriminator value: success
    - `jobId` string, required: The job ID of the payment gateway validation job
    - `paymentGatewayUrl` string: The payment gateway URL that was found in the document
    - `card` PaymentGatewayTypesValidatePaymentGatewayCardResponse
      - `eligibility` 'ACCEPTED' | 'NOT_ACCEPTED' | 'UNKNOWN', required
      - `fee` union, required
        - object
          - `type` 'percentage', required: Discriminator value: percentage
          - `value` number, double, required: The fee percentage in bps. For example, if the fee is 2.5% and the payment amount is $100, set this to 250.
        - object
          - `type` 'flat', required: Discriminator value: flat
          - `value` number, double, required: The fee amount in major units of the invoice currency. For example, if the fee is a flat $2.50, set this to 2.5.
        - object
          - `type` 'none', required: Discriminator value: none
    - `invoiceAmount` number, double: The invoice amount detected from the invoice
    - `gatewayAmount` number, double: The amount displayed on the payment gateway (may include fees)
    - `vendorName` string: The vendor name
    - `requiredData` PaymentGatewayTypesValidatePaymentGatewayRequiredData
      - `needsAccountNumber` boolean: Whether the payment gateway requires an account number to proceed
      - `needsPostalCode` boolean: Whether the payment gateway requires a postal code to proceed
      - `needsEmail` boolean: Whether the payment gateway requires an email address to proceed
      - `needsAccountHolderFirstName` boolean: Whether the payment gateway requires the account holder's first name to proceed
      - `needsAccountHolderLastName` boolean: Whether the payment gateway requires the account holder's last name to proceed
      - `needsFullServiceAddress` boolean: Whether the payment gateway requires a full service address to proceed
      - `needsPhoneNumber` boolean: Whether the payment gateway requires a phone number to proceed
    - `createdAt` string, date-time, required: The timestamp when the job was created
    - `updatedAt` string, date-time, required: The timestamp when the job was last updated
  - object
    - `jobStatus` 'failed', required: Discriminator value: failed
    - `jobId` string, required: The job ID of the payment gateway validation job
    - `errorType` 'NO_VALID_PAYMENT_GATEWAY_FOUND' | 'PAYMENT_GATEWAY_UNSUPPORTED' | 'CARD_DETAILS_INVALID' | 'CARD_DECLINED' | 'INVOICE_AMOUNT_MISMATCH', required
    - `errorMessage` string: The error message that occurred during the payment gateway validation job
    - `createdAt` string, date-time, required: The timestamp when the job was created
    - `updatedAt` string, date-time, required: The timestamp when the job was last updated

## Other responses

- `400`: Error response with status 400
- `401`: Error response with status 401
- `403`: Error response with status 403
- `404`: Error response with status 404
- `409`: Error response with status 409
- `500`: Error response with status 500
- `501`: Error response with status 501

---

[API](https://skmtc.dev/mercoa/apis/mercoa-2.md) - [All operations](https://skmtc.dev/mercoa/apis/mercoa-2/llms.txt) - [OpenAPI document](https://skmtc.dev/mercoa/apis/mercoa-2/revisions/00a8e403ae18?raw)
