Validation

List of common error responses for PIF transactions

Let's take a look at some of the error responses you may encounter if information is passed incorrectly.

Common Validation Errors

Entity Association Errors

  • This response occurs when the transactionid already exist.
{
    "statusCode": 400,
    "message": "Found the following duplicate transaction ids 44-3435-35-fd-44"
}
  • This response occurs when the system can't find the network id (nid). This also applies for institution id (fid).
{
    "statusCode": 400,
    "message": "Can't find network KPSANDBOX"
}
  • This response occurs when the supplied buyerId is incorrect. This error will also occur if the buyerId is correct but not affiliated with the correct nid or fid.
{
    "statusCode": 400,
    "message": "Can't find buyer nid=KPSANDBOX fid=KPSANDBOX bid=PurpleTest",
    "info": {
        "index": 0
    }
}

Bad Request with Swagger Validation Error

  • No networkId supplied in otherwise proper PIF format.
{
    "statusCode": 400,
    "message": "Invalid Network Id - undefined - Should be alpha-numeric and cannot exceed 255 characters",
    "info": {
        "index": 0,
        "record": {
            "buyerId": "AF_TestBuyer01",
            "fileDate": "2019-11-21",
            "transactionId": "8dfgC-7Adfg-4dgf6-Aggd92-Bds",
            "accountType": "VCN",
            "amount": 14.14,
            "poNumber": "0024",
            "poDate": "2019-11-21",
            "reference1": "reference 1",
            "reference2": "reference 2",
            "reference3": "reference 8fds",
            "reference4": "reference 970ruoweijlk",
            "reference5": "reference 97oiuljkew",
            "institutionId": "KPSANDBOX",
            "payee": {
                "id": "AF SB Payee Test SID001",
                "name": "AF SB VCard Test 001",
                "address": {
                    "street1": "1112 Main Street",
                    "street2": "Unit Z",
                    "city": "Alpharetta",
                    "state": "GA",
                    "postalCode": "30004"
                },
                "email": "[email protected]"
            },
            "invoices": []
        },
        "key": "networkId"
    }
}
  • 400 Bad Request for using accountId instead of bankAccountId in the payload where you specify the account from which the payment is to be made.
{
    "message": "Validation errors",
    "errors": [
        {
            "code": "INVALID_REQUEST_PARAMETER",
            "errors": [
                {
                    "code": "PATTERN",
                    "params": [
                        "(^$|^[a-zA-Z0-9]{1,50}$)",
                        "8a3f3819b71e4e0db939d8950369f25dedad5a95c26b6015b1d93ec048bf902f"
                    ],
                    "message": "String does not match pattern (^$|^[a-zA-Z0-9]{1,50}$): 8a3f3819b71e4e0db939d8950369f25dedad5a95c26b6015b1d93ec048bf902f",
                    "path": [
                        "4",
                        "accountId"
                    ]
                }
            ],
            "in": "body",
            "message": "Invalid parameter (pifTransactions): Value failed Schema validation",
            "name": "pifTransactions",
            "path": [
                "paths",
                "/pifTransactions/json",
                "post",
                "parameters",
                "0"
            ]
        }
    ]
}
  • 400 Bad Request sending in just an object instead of an array of objects.
{
    "message": "Validation errors",
    "errors": [
        {
            "code": "INVALID_REQUEST_PARAMETER",
            "errors": [
                {
                    "code": "INVALID_TYPE",
                    "params": [
                        "array",
                        "object"
                    ],
                    "message": "Expected type array but found type object",
                    "path": [],
                    "description": "Array of pifTransactions,"
                }
            ],
            "in": "body",
            "message": "Invalid parameter (pifTransactions): Value failed Schema validation",
            "name": "pifTransactions",
            "path": [
                "paths",
                "/pifTransactions/json",
                "post",
                "parameters",
                "0"
            ]
        }
    ]
}

*400 Bad Request using incorrect date format. Proper format is "YYYY-MM-DD".

{
    "message": "Validation errors",
    "errors": [
        {
            "code": "INVALID_REQUEST_PARAMETER",
            "errors": [
                {
                    "code": "INVALID_FORMAT",
                    "params": [
                        "date",
                        "2019-11-27fff"
                    ],
                    "message": "Object didn't pass validation for format date: 2019-11-27fff",
                    "path": [
                        "0",
                        "fileDate"
                    ]
                }
            ],
            "in": "body",
            "message": "Invalid parameter (pifTransactions): Value failed Schema validation",
            "name": "pifTransactions",
            "path": [
                "paths",
                "/pifTransactions/json",
                "post",
                "parameters",
                "0"
            ]
        }
    ]
}