# uploadInvoiceShippingFile

> Use this API to upload invoice or logistics AWB (Air Waybill) files. This API is applicable only when the payment method is ​UPI​, ​Net Banking​, or Indian cards.

`POST /v1/payments/uploadInvoiceShippingFile`

Use this API to upload invoice or logistics AWB (Air Waybill) files. This API is applicable only when the payment method is [UPI](https://docs.antom.com/ac/antomop/upi.md), [Net Banking](https://docs.antom.com/ac/antomop/net_banking.md), or [Indian cards](https://docs.antom.com/ac/antomop/indian.md).

# Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see： 

-   [Request header](https://docs.antom.com/ac/ams/api_fund.md#ML5ur)
-   [Response header](https://docs.antom.com/ac/ams/api_fund.md#WWH90)

> **Note**: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:
>
> -   If the data type of a field is Integer and its value is `20`, set it as "`20`".
> -   If the data type of a field is Boolean and its value is `true`, set it as "`true`".

## Request parameters

#### paymentRequestId (String, REQUIRED)

The unique ID assigned by a merchant to identify a payment request.

More information:

- Maximum length: 64 characters

#### fileId (String, REQUIRED)

The unique ID to identify the invoice or logistics waybill file.

More information:

- Maximum length: 20 characters

#### uploadFile (String, REQUIRED)

Upload materials in the format of Base64 encoded strings. Supported file formats include:

-   PDF (.pdf)
-   Document (.doc or .docx)
-   Image (.jpg or .jpeg)

More information:

- Maximum length: 1000000 characters

#### fileType (String, REQUIRED)

The type of uploaded file material. The valid values include:

-   `Invoice`: Indicates that the uploaded file material is an invoice.
-   `AWB`: Indicates that the uploaded file material is a logistics waybill.

More information:

- Maximum length: 10 characters

#### fileName (String, REQUIRED)

The name of the uploaded file.

More information:

- Maximum length: 64 characters

## Response parameters

#### result (Object, REQUIRED)

The result of the API call.

##### resultCode (String, REQUIRED)

The result code. The possible result codes are listed in the **Result/Error codes** table on this page.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

The result status. Valid values are:

-   `S`: indicates that the API call succeeds.
-   `F`: indicates that the API call fails.
-   `U`: indicates that the API call might be successful, in process, or failed. For more details, see Result process logic.

More information:

- Maximum length: 1 character

##### resultMessage (String)

The result message that explains the result code.

More information:

- Maximum length: 256 characters

## Result/Error codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success. | The interface is called successfully. |
| PROCESS_FAIL | F | A general business failure occurred. | Do not retry. Human intervention is usually needed. It is recommended that you contact Antom Technical Support to troubleshoot the issue. |
| PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. | Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid. |
| UNKNOWN_EXCEPTION | U | API failed due to unknown reason. | Call the interface again to resolve the issue. If not resolved, contact Antom Technical Support. |

## Request

```json
{
  "paymentRequestId": "202401012501310115730104123",
  "fileId": "20240101347",
  "fileType": "Invoice",
  "uploadFile": "Base64 Encoded File",
  "fileName": "test.pdf"
}
```

## Response

```json
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  }
}
```