# Upload AWB File

**Method:** `PUT`

**Path:** `/api/pay/v1/orders/{orderId}/awb/{awbId}/upload`

**Category:** International Payments

**Authentication:** Required

## Description

Uploads the actual AWB file (PDF/image) for a previously created AWB record.

**Prerequisites:**
- AWB must exist (created via Create AWB API) with status `AWB_CAPTURED`.
- File must be PDF, JPEG, or PNG format.
- File size must not exceed 5 MB.
- File can only be uploaded once. Re-upload is not allowed.


## Path Parameters

- `orderId` (`string`) **required** — Order ID returned from Create Order API.
- `awbId` (`string`) **required** — AWB ID returned from Create AWB API.

## Request Body

Content-Type: `multipart/form-data`

- `file` (`string`) **required** — AWB file to upload. - Max size: 5 MB (5,242,880 bytes) - Allowed types: application/pdf, image/jpeg, image/jpg, image/png 

### Example Request

```json
{
  "file": "your_file"
}
```

## Responses

- `200` — AWB file uploaded successfully.
- `400` — Bad Request — Validation error in the request.
Possible error codes:
- `DOC_MULTIPART_CONTENT_TYPE_REQUIRED` — Content-Type must be multipart/form-data
- `DOC_FILE_MISSING` — No file found in the multipart body
- `DOC_INVALID_FILE_TYPE` — File type not allowed (must be PDF/JPEG/PNG)
- `DOC_FILE_TOO_LARGE` — File exceeds 5 MB limit
- `DOC_ORDER_ID_MISSING` — orderId path parameter is missing
- `DOC_AWB_ID_MISSING` — awbId path parameter is missing

- `404` — Not Found — AWB not found.
- `409` — Conflict — AWB file already uploaded. File upload is a one-time operation.
- `500` — 

### Response Schema

- `awb_id` (`string`) — AWB identifier.
- `order_id` (`string`) — Order ID.
- `status` (`AWB_UPLOADED`) — Updated to AWB_UPLOADED on success.

### Example Response

```json
{
  "awb_id": "awb-260522-001",
  "order_id": "v1-260520225359-aa-LHy288",
  "status": "AWB_UPLOADED"
}
```

---

Reference: https://localhost:3000/api/international-payments/upload-awb-file
