# Process Payment File

Import a defined Payment File in .csv format to then have payments created and, optionally, attached to invoices.

Endpoint: POST /process-payment-file
Version: v1
Security: apiKeyAuth, bearerAuth

## Security:

  - `apiKeyAuth` (unknown)
    apiKey in header x-api-key

  - `bearerAuth` (unknown)
    http bearer JWT

## Header parameters:

  - `vbasoftware-database` (string, required)
    Target database

## Request fields (application/json):

  - `payment_File_Format_Key` (integer)
    Used in both Rate Copy and Rate Change operations.

  - `payment_File` (string)
    A .csv file with headers and the following columns:
- **Payment_Type**: Value from the PremPaymentType table (optional)
- **Payment_Batch**: Source system batch indicator (optional)
- **Payment_Batch_Seq**: Source system batch sequence (optional)
- **Payment_Account**: Name of the paying account (required)
- **Payment_ID**: Unique identifier for the payment (required)
- **Payment_Date**: Date of payment in YYYY-MM-DD format (required)
- **Payment_Amount**: Amount of the payment (required)
- **Payment_Name**: Name of the payer (required)
- **Group_ID**: Group identifier if applicable (optional)
- **Division_ID**: Division identifier if applicable (optional)
- **Subscriber_ID**: Subscriber identifier if applicable (optional)
- **Payor_ID**: Payor ID for created payments (required)
- **Account_Key**: Account key for created payments (required)
- **Invoice_Key**: Invoice key to apply the payment to (optional)
- **PremRate_Key**: Rate key to apply the payment to (optional)
- **PremPayment_Key**: Existing payment key to apply the payment to (optional)

  - `payor_ID` (string)
    The Payor ID to assign to the created payments.

  - `account_Key` (integer)
    The Account Key to be assign to the created payments.

  - `create_Invoice_Payments` (boolean)
    Set to true to create invoice payments from the file.

  - `apply_Payments` (boolean)
    Set to true to apply payments to matching invoices.

  - `close_Invoices` (boolean)
    Set to true to close invoices after payment is applied.

  - `only_Close_Satisfied_Invoices` (boolean)
    If true, only fully satisfied invoices will be closed.

  - `user_ID` (string)
    ID of the user performing the Payment File import.

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `data` (object)

  - `data.payment_Created_Count` (integer)

  - `data.invoice_Payment_Posted_Count` (integer)

  - `data.invoice_Closed_Count` (integer)

  - `data.invoice_Left_Open_Count` (integer)

  - `error` (object)

  - `error.detail` (string)
    A human-readable explanation specific to this occurrence of the problem.

  - `error.instance` (string)
    A URI reference that identifies the specific occurrence of the problem.It may
or may not yield further information if dereferenced.

  - `error.status` (integer)
    The HTTP status code([RFC7231], Section 6) generated by the origin server for
this occurrence of the problem.

  - `error.title` (string)
    A short, human-readable summary of the problem type.It SHOULD NOT change from
occurrence to occurrence of the problem, except for purposes of localization(e.g.,
using proactive content negotiation; see[RFC7231], Section 3.4).

  - `error.type` (string)
    A URI reference [RFC3986] that identifies the problem type. This specification
encourages that, when dereferenced, it provide human-readable documentation for
the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member
is not present, its value is assumed to be "about:blank".

  - `debug` (object)

  - `debug.activityID` (string, required)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 403:

  - `403` (unknown)
    Forbidden. The x-api-key header is missing or not valid. The API gateway sends this response, not VBAPI, so the body is not the VBAPI envelope; see Errors and troubleshooting.

## Response 429:

  - `429` (unknown)
    Too many requests. The limit is 25 requests per second sustained, with bursts up to 50, per API key. Wait and retry with exponential backoff and jitter.

