Onerway
POST

Upload file

Use this endpoint to upload a file for Embedded Finance scenarios. Submit the request as multipart/form-data.

Request

apiKey
API key assigned for Embedded Finance API access.
Example:
Content-Type
Request content type for the file upload.
Example:
Constraints
Rule
Submit this request as multipart/form-data because the request includes a binary file stream.
fileName
File name submitted with the upload request.
Example:
Constraints
Range
64characters
Rule
Use the original file name or a merchant-generated file name that preserves the file extension.
file
Binary file stream to upload.
Example:
Constraints
Range
15MBMaximum file size.
Rule
Send the actual binary file stream in this form-data part. Do not submit a file path string as the field value.

Request example

curl -X POST 'https://sandbox-baas.onerway.com/embedded-finance/api/v2/upload/file' \
  -H 'apiKey: replace_with_api_key' \
  -H 'Content-Type: multipart/form-data' \
  --data-raw '{
  "fileName": "back.png",
  "file": "@\"/path/to/back.png\""
}'

Response

respCode
Response code returned by Onerway. 20000 means the file upload succeeded.
Example:
respMsg
Human-readable response message.
Example:
Uploaded file metadata returned after the file is uploaded successfully.

Response example

{
  "respCode": "20000",
  "respMsg": "Success",
  "data": {
    "merchantNo": "800***",
    "fileId": 987654321
  }
}
No error responses are documented for this endpoint.