Swifood API Docs
选择语言
选择语言
  • English
  • 简体中文
选择语言
选择语言
  • English
  • 简体中文
  1. Common Files
  • Open API Code prompt code list
  • Interface parameter signature process
  • Orders
    • Create Order (General)
      POST
    • Refund Order (General)
      POST
    • Reprint Order Receipt
      POST
    • Calculate Tax
      POST
    • Query Restaurant Orders
      POST
    • Query Order Invoice
      POST
  • Restaurants
    • List Restaurants
      POST
  • Order Callback
    • Restaurant Order Push Callback
      POST
  • Dish Categories
    • Page through dish categories
      POST
    • List dish categories
      POST
    • Create or update a dish category
      POST
    • Delete a dish category
      POST
    • Update a dish category status
      POST
    • Update dish category sort orders
      POST
    • Save category option settings
      POST
  • Options
    • Page through options
      POST
    • List options
      POST
    • Get option details
      POST
    • Create or update an option
      POST
    • Delete an option
      POST
    • List dishes associated with an option
      POST
  • Dishes
    • Page through dishes
    • List dishes
    • Get dish details
    • Create or update a dish
    • Delete a dish
    • Update a dish status
    • Update a dish SKU
    • Delete a dish SKU
    • Batch update dish prices
    • Get dish option settings
    • Save dish option settings
  • Menu Templates
    • Page through menu templates
    • Get menu template details
    • Create or update a menu template
    • Delete a menu template
    • Dispatch a menu template
    • Query menu template dispatch results
  • Common Files
    • Upload a dish image
      POST
  • 数据模型
    • order
      • ProductInput
      • CreateOrderParam
      • CreateOrderData
      • CreateOrderResponse
      • RefundParam
      • PrintParam
      • TaxCalculateParam
      • TaxItem
      • TaxResponse
      • OrderListParam
      • InvoiceParam
      • OrderListResponse
      • InvoiceJson
      • OrderOption
      • OrderData
      • OrderPushParam
      • OrderSku
      • OptionItem
    • restaurant
      • Restaurant
      • RestaurantListResponse
    • Common
      • SignedRequest
      • ApiResponse
      • PageParam
      • ValidStatus
    • Dish Categories
      • CategoryPageApiResponse
      • CategoryListApiResponse
      • CategoryPageData
      • CategoryApiResp
      • CategoryPageParam
      • CategoryListParam
      • CategorySaveParam
      • CategoryOptionSaveParam
    • Options
      • OptionPageApiResponse
      • OptionListApiResponse
      • OptionDetailApiResponse
      • OptionProductListApiResponse
      • OptionPageData
      • OptionApiResp
      • OptionItemApiResp
      • OptionProductApiResp
      • OptionSaveParam
      • OptionItemCreateParam
      • OptionItemUpdateParam
      • OptionItemDeleteParam
      • OptionProductListParam
      • OptionItemLinkParam
    • Dishes
      • ProductPageApiResponse
      • ProductListApiResponse
      • ProductDetailApiResponse
      • ProductOptionApiResponse
      • ProductPageData
      • ProductApiResp
      • ProductDetailApiResp
      • ProductSpecApiResp
      • ProductSpecItemApiResp
      • ProductSkuApiResp
      • ProductDetailOptionApiResp
      • ProductOptionLinkApiResp
      • ProductQueryParam
      • ProductSaveParam
      • ProductSpecParam
      • ProductStatusParam
      • ProductSkuParam
      • PriceBatchUpdateParam
      • ProductOptionSaveParam
    • Menu Templates
      • TemplatePageApiResponse
      • TemplateDetailApiResponse
      • TemplateDispatchApiResponse
      • TemplateDispatchQueryApiResponse
      • TemplatePageData
      • TemplateApiResp
      • TemplateDetailApiResp
      • TemplateProductApiResp
      • TemplatePermissionApiResp
      • TemplateBranchApiResp
      • TemplateDispatchApiResp
      • TemplateDispatchQueryApiResp
      • TemplatePageParam
      • TemplateSaveParam
      • TemplatePermissionParam
      • TemplateDispatchParam
    • Common Files
      • SignedAppRequest
      • SignedStoreRequest
      • ApiError
      • BooleanResponse
      • UploadFileApiResponse
      • UploadFileApiResp
      • UploadFileParam
  1. Common Files

Upload a dish image

POST
/open-api/v1/common/file/upload
Uploads a category image, product menu image, or product detail image.
The request must use multipart/form-data and contain two parts:
request: Required. Its Content-Type must be application/json, and its content must be the complete signed Open API request.
file: Required. The image file to upload. JPG/JPEG, PNG, and WEBP are supported. The maximum file size is 5 MB.
param only needs to contain businessType. Supported values are CATEGORY_IMAGE (category image), PRODUCT_MENU_IMAGE (product menu image), and PRODUCT_DETAIL_IMAGE (product detail image).
Do not send the file name, file size, Content-Type, or SHA-256 checksum; the server obtains or calculates them from the uploaded file.
Generate sign in the same way as for other Open APIs: sign the exact UTF-8 text of param with the developer private key using SHA256withRSA, then Base64-encode the signature bytes.

请求参数

Body 参数multipart/form-data必填

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location '/open-api/v1/common/file/upload' \
--form 'request="{\"appId\":\"your-app-id\",\"storeKey\":\"your-store-key\",\"param\":\"{\\\"businessType\\\":\\\"PRODUCT_MENU_IMAGE\\\"}\",\"sign\":\"generated-signature\"}";type=application/json' \
--form 'file=@"C:\\Users\\17650\\Desktop\\027aa0a4-8203-44b1-85fd-a83bee581e1f.png"'

返回响应

🟢200
application/json
Request processed. Use code and message to determine the business result.
Bodyapplication/json

示例
{
    "code": 0,
    "message": "string",
    "messageIn": "string",
    "data": {
        "fileKey": "string",
        "url": "string",
        "size": 0,
        "contentType": "string",
        "sha256": "string"
    }
}
修改于 2026-11-03 07:12:29
上一页
Query menu template dispatch results
下一页
ProductInput
Built with