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

# Validate Invoice Payment

GET http://localhost:9000/api/v1/billing/invoice/validate

Validates an invoice before online payment starts or before final confirmation.

Required query params: `invoiceNo`, `amount`, `currencyPaid` currency ObjectId, `type` (`start` or `confirm`), `processor` (`paystack`, `Paypal`, or `authorize.net`), `partPaymentFromWalletBalanceBefore`, `partPaymentFromWalletBalanceCurrent`.

Response fields: `verStatus` boolean, `verType`, `cloneId` when `type=start`, `invoice` document. If invalid invoice state, response may contain `verStatus:false`, `error`, and `invoice`.

Possible errors:
- 400: Missing One or More Required Parameters - invoice validation query is incomplete.
- 400: You must set a billing address before you proceed - billing address missing.
- 404: Invoice not found - invoice number does not belong to the customer.
- 400: Wrong Currency - `currencyPaid` does not match invoice currency.
- 400: Payment method is disabled - requested processor is not active for the currency.
- 400: Wrong Amount - amount does not match invoice payable amount.
- 200: Bad Invoice response - `verStatus:false` when invoice is already paid or in bad payment state.
- 400: Missing One or More Required Parameters - required body/query fields were not supplied.
- 401: Unauthorized - token is missing, expired, invalid, or the account/token pair was not found.
- 403: Access denied - gateway traffic guard/rate policy blocked the request.
- 429: Too many requests - gateway rate limit exceeded.
- 500: Unexpected Error - unhandled gateway or downstream service failure.

Reference: https://docs.mycargoextra.com/cargo-extra-gateway-api-copy/billing/invoice/validate/validate-invoice-payment

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/billing/invoice/validate:
    get:
      operationId: validate-invoice-payment
      summary: Validate Invoice Payment
      description: >-
        Validates an invoice before online payment starts or before final
        confirmation.


        Required query params: `invoiceNo`, `amount`, `currencyPaid` currency
        ObjectId, `type` (`start` or `confirm`), `processor` (`paystack`,
        `Paypal`, or `authorize.net`), `partPaymentFromWalletBalanceBefore`,
        `partPaymentFromWalletBalanceCurrent`.


        Response fields: `verStatus` boolean, `verType`, `cloneId` when
        `type=start`, `invoice` document. If invalid invoice state, response may
        contain `verStatus:false`, `error`, and `invoice`.


        Possible errors:

        - 400: Missing One or More Required Parameters - invoice validation
        query is incomplete.

        - 400: You must set a billing address before you proceed - billing
        address missing.

        - 404: Invoice not found - invoice number does not belong to the
        customer.

        - 400: Wrong Currency - `currencyPaid` does not match invoice currency.

        - 400: Payment method is disabled - requested processor is not active
        for the currency.

        - 400: Wrong Amount - amount does not match invoice payable amount.

        - 200: Bad Invoice response - `verStatus:false` when invoice is already
        paid or in bad payment state.

        - 400: Missing One or More Required Parameters - required body/query
        fields were not supplied.

        - 401: Unauthorized - token is missing, expired, invalid, or the
        account/token pair was not found.

        - 403: Access denied - gateway traffic guard/rate policy blocked the
        request.

        - 429: Too many requests - gateway rate limit exceeded.

        - 500: Unexpected Error - unhandled gateway or downstream service
        failure.
      tags:
        - >-
          subpackage_billing.subpackage_billing/invoice.subpackage_billing/invoice/validate
      parameters:
        - name: invoiceNo
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: integer
        - name: amount
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: integer
        - name: currencyPaid
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: string
        - name: processor
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: string
        - name: partPaymentFromWalletBalanceBefore
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: integer
        - name: partPaymentFromWalletBalanceCurrent
          in: query
          description: Query parameter supported by the gateway/downstream service.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/billing_invoice_validate_Validate Invoice
                  Payment_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestForbiddenError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestNotFoundError
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestTooManyRequestsError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1BillingInvoiceValidateRequestInternalServerError
servers:
  - url: http://localhost:9000
    description: http://localhost:9000
components:
  schemas:
    billing_invoice_validate_Validate Invoice Payment_Response_200:
      type: object
      properties:
        key_0:
          type: integer
        key_1:
          type: string
        key_2:
          type: number
          format: double
        key_3:
          type: string
        key_4:
          type: boolean
      required:
        - key_0
        - key_1
        - key_2
        - key_3
        - key_4
      title: billing_invoice_validate_Validate Invoice Payment_Response_200
    GetApiV1BillingInvoiceValidateRequestBadRequestError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestBadRequestError
    GetApiV1BillingInvoiceValidateRequestUnauthorizedError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestUnauthorizedError
    GetApiV1BillingInvoiceValidateRequestForbiddenError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestForbiddenError
    GetApiV1BillingInvoiceValidateRequestNotFoundError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestNotFoundError
    GetApiV1BillingInvoiceValidateRequestTooManyRequestsError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestTooManyRequestsError
    GetApiV1BillingInvoiceValidateRequestInternalServerError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: GetApiV1BillingInvoiceValidateRequestInternalServerError

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "key_0": 1,
  "key_1": "confirm",
  "key_2": 15000,
  "key_3": "5f8d0d55b54764421b7156c3",
  "key_4": true
}
```

**SDK Code**

```python billing_invoice_validate_Validate Invoice Payment_example
import requests

url = "http://localhost:9000/api/v1/billing/invoice/validate"

querystring = {"invoiceNo":"100123","amount":"15000","currencyPaid":"642f1a3e9b1e8a0012345678","type":"start","processor":"paystack","partPaymentFromWalletBalanceBefore":"5000","partPaymentFromWalletBalanceCurrent":"0"}

payload = {}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript billing_invoice_validate_Validate Invoice Payment_example
const url = 'http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0';
const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go billing_invoice_validate_Validate Invoice Payment_example
package main

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

func main() {

	url := "http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby billing_invoice_validate_Validate Invoice Payment_example
require 'uri'
require 'net/http'

url = URI("http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0")

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

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

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

```java billing_invoice_validate_Validate Invoice Payment_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php billing_invoice_validate_Validate Invoice Payment_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp billing_invoice_validate_Validate Invoice Payment_example
using RestSharp;

var client = new RestClient("http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0");
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift billing_invoice_validate_Validate Invoice Payment_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:9000/api/v1/billing/invoice/validate?invoiceNo=100123&amount=15000&currencyPaid=642f1a3e9b1e8a0012345678&type=start&processor=paystack&partPaymentFromWalletBalanceBefore=5000&partPaymentFromWalletBalanceCurrent=0")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```