### Meituan API Request Example (POST) Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule This example demonstrates a typical POST request to a Meituan API, including all required system parameters and a JSON string for business parameters. ```http POST /api/endpoint HTTP/1.1 Host: developer.meituan.com Content-Type: application/x-www-form-urlencoded appAuthToken=V2-5fc970ded1f0f933594ee68bf8da6eaa06a44a340e5b23832f944a716379f006aeddd4598541271ece7f91d185b64080 charset=UTF-8 timestamp=1618975600 version=2 developerId=1031123 businessId=18 sign=96e2cedadeb7401acf48e46672673f6512cc460e biz={"id":1,"name":"hello"} ``` -------------------------------- ### UISDK Store Mapping Request Example Source: https://developer.meituan.com/docs/biz/biz_waimaing_df60ceb0-f17d-403e-8a13-884b2ee14555 Example URL for invoking the UISDK to perform store mapping. It includes required query parameters such as developer ID, business ID, store ID, timestamp, and a signature. ```url https://open-erp.meituan.com/storemap?developerId=100019&businessId=1&ePoiId=8859&ePoiName=湘北人家×tamp=1520563340000&sign=637a76c869933b8e6c391956fbb5c0528f48e350386cd523 ``` -------------------------------- ### UISDK Store Mapping Callback Data Example Source: https://developer.meituan.com/docs/biz/biz_waimaing_df60ceb0-f17d-403e-8a13-884b2ee14555 Example of the data structure returned by the Meituan platform after a successful store mapping. This includes authentication token, business ID, store ID, timestamp, and Meituan's store ID and name. ```json {"appAuthToken":"tokenvalue","businessId":"1","ePoiId":"10000","timestamp":"1489563617692","poiId":"1234","poiName":"湘北人家"} ``` -------------------------------- ### UISDK Store Mapping Callback Success Response Source: https://developer.meituan.com/docs/biz/biz_waimaing_df60ceb0-f17d-403e-8a13-884b2ee14555 Example JSON response indicating a successful store mapping. The Meituan platform sends this data via POST to the developer's specified callback URL. ```json {"data":"success"} ``` -------------------------------- ### Download Meituan Developer SDKs (Java, Python, Go) Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule Developers can download SDKs for Java, Python, and Go to streamline API integration. These SDKs are available from the official Meituan Developer Center. ```text https://developer.meituan.com/admin#/sdk/download ``` -------------------------------- ### UISDK 门店映射接入 Source: https://developer.meituan.com/docs/biz/biz_waimaing_df60ceb0-f17d-403e-8a13-884b2ee14555 通过UISDK接入进行门店映射,需要配置回调地址,携带必传参数请求UISDK链接,并在映射成功后处理返回的认证Token。 ```APIDOC ## UISDK 门店映射接入 ### Description 通过UISDK接入进行门店映射,需要配置回调地址,携带必传参数请求UISDK链接,并在映射成功后处理返回的认证Token。 ### Method GET ### Endpoint https://open-erp.meituan.com/storemap ### Parameters #### Query Parameters - **developerId** (int) - Required - 开发者ID - **businessId** (int) - Required - 业务类型 (1:团购, 2:外卖, 3:闪惠, 16:外卖(非接单)) - **ePoiId** (string) - Required - ERP厂商针对该门店自行定义的id - **sign** (string) - Required - 签名 - **ePoiName** (string) - Optional - ERP商家门店名 - **timestamp** (long) - Required - 当前请求的时间戳【单位是毫秒】 ### Request Example ``` https://open-erp.meituan.com/storemap?developerId=100019&businessId=1&ePoiId=8859&ePoiName=湘北人家×tamp=1520563340000&sign=637a76c869933b8e6c391956fbb5c0528f48e350386cd523 ``` ### Response #### Callback Notification (POST) - **appAuthToken** (string) - 门店绑定的授权token,用于后续门店业务操作。 - **businessId** (string) - 业务类型 (1:团购, 2:外卖, 3:闪惠, 16:外卖(非接单))。 - **ePoiId** (string) - 门店绑定时,传入的ERP厂商分配给门店的唯一标识。 - **timestamp** (string) - 门店绑定的时间戳。 - **poiId** (string) - 美团门店id。 - **poiName** (string) - 美团门店名称。 #### Response Example (Callback) ```json { "data": "success" } ``` **Callback Content-Type**: application/x-www-form-urlencoded **Note**: The callback URL will be retried up to 10 times if the response `{"data":"success"}` is not received, with increasing intervals between retries. ``` -------------------------------- ### SDK Downloads Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule Developer SDKs are available for multiple programming languages to accelerate API integration. The Meituan Technical Cooperation Center provides SDKs for Java, Python, and Go languages with the latest versions available for download. ```APIDOC ## SDK Download ### Description Meituan Technical Cooperation Center provides developer SDKs to help developers quickly develop and integrate with APIs. Multiple programming languages are supported. ### Supported Languages - Java - Python - Go ### Download Location https://developer.meituan.com/admin#/sdk/download ### Benefits - Rapid API development - Simplified integration process - Pre-built request/response handling - Automatic signature generation - Error handling utilities ### Getting Latest Version Visit the SDK download page regularly to obtain the latest versions of SDKs for your programming language. ``` -------------------------------- ### Web Page Unbinding Integration Source: https://developer.meituan.com/docs/biz/biz_waimaing_d3a3e69b-7ef8-470c-bc7c-b6b6c66441c5 Integration method using Meituan's pre-built web page for store unbinding. Developers can directly redirect merchants to the unbinding page with properly signed parameters. ```APIDOC ## Web Page Store Unbinding ### Description Meituan provides a pre-built web page for store unbinding. Service providers can redirect merchants to this page with required parameters. The web page handles the entire unbinding workflow including merchant login verification and confirmation. ### Method GET/Redirect ### Endpoint https://open-erp.meituan.com/releasebinding ### Query Parameters - **sign** (string) - Required - Request signature - **businessId** (string) - Required - Business type: 1=Group Purchase, 2=Food Delivery, 3=Flash Sale, 5=Payment, 7=Reservation, 8=Omnichannel Member, 16=Food Delivery Non-Order Taking - **appAuthToken** (string) - Required - Store claim token - **timestamp** (string) - Required - Unix timestamp in milliseconds ### Unbinding Workflow 1. Merchant clicks unbinding button in service provider system 2. Redirect to: https://open-erp.meituan.com/releasebinding?sign={sign}&businessId={businessId}&appAuthToken={appAuthToken}×tamp={timestamp} 3. Page displays: "Please login first to confirm before removing association" 4. Merchant logs in with store-bound account 5. System displays bound stores for that account 6. Merchant clicks "Next Step" 7. Confirmation prompt: "Confirm you no longer want to use service provider system for Meituan business?" 8. Merchant clicks "Confirm" to complete unbinding 9. Meituan callback sends unbinding notification to developer's configured callback URL ### Error Scenarios - **Account mismatch**: "This account does not match the store, please login with correct account" - Account does not match the store being unbound - Account has only one bound store which is already unbound ### Notes - Ensure sign and appAuthToken are correctly filled - businessId must match the business type to be unbound - After successful unbinding, Meituan will POST callback to developer's configured endpoint - Developer must handle callback and return {"data":"success"} ``` -------------------------------- ### Store Self-Unbinding Request Parameters Source: https://developer.meituan.com/docs/biz/biz_waimaing_d3a3e69b-7ef8-470c-bc7c-b6b6c66441c5 System-level parameters required when initiating store unbinding operations through UI SDK or web page. These parameters must be included in all unbinding requests and properly signed. ```APIDOC ## Store Unbinding Request Parameters ### Description System-level parameters required for store self-unbinding operations. These parameters must be included when accessing the unbinding UI SDK or web page interface. ### Request Parameters - **appAuthToken** (string) - Required - Token returned from store claiming, one token per store - **businessId** (int) - Required - Business type identifier: 1=Group Purchase, 2=Food Delivery, 3=Flash Sale, 5=Payment, 7=Reservation, 8=Omnichannel Member, 16=Food Delivery Non-Order Taking - **sign** (string) - Required - Request signature for authentication - **timestamp** (string) - Required - Unix timestamp in milliseconds for request validation ### Parameter Details | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | appAuthToken | string | Yes | Token returned when claiming store (system parameter) | | businessId | int | Yes | Business type (system parameter) | | sign | string | Yes | Request signature | | timestamp | string | Yes | Timestamp in milliseconds | ### Notes - appAuthToken is store-specific (one token per store) - Sign and timestamp must follow Meituan's signature rules - For simultaneous unbinding of multiple business types under same token, token updates on rebinding - For partial unbinding, token remains consistent with previous value ``` -------------------------------- ### UI SDK Store Unbinding Integration Source: https://developer.meituan.com/docs/biz/biz_waimaing_d3a3e69b-7ef8-470c-bc7c-b6b6c66441c5 Integration method using Meituan's UI SDK for implementing store unbinding directly within the merchant's interface. Merchants can initiate unbinding from the settings menu. ```APIDOC ## UI SDK Store Unbinding ### Description Developers can integrate Meituan's UI SDK to provide store unbinding functionality directly within their application interface. The SDK provides a settings menu option for merchants to unbind stores. ### Integration Method Embedding UI SDK in merchant service provider system ### Unbinding Workflow 1. Merchant accesses the application with UI SDK integrated 2. Clicks "Settings" button (top-left corner) 3. "Remove Association" option appears in dropdown menu 4. Clicks "Remove Association" 5. Dialog appears: "Please login first to confirm before removing association" 6. Merchant logs in using store-bound account 7. System retrieves and displays all bound stores for that account 8. Merchant clicks "Next Step" 9. Confirmation dialog: "Confirm you no longer want to use service provider system for Meituan business?" 10. Merchant clicks "Confirm" to complete unbinding 11. Meituan callback posts unbinding notification to developer's configured endpoint ### Error Handling - **Account mismatch error**: "This account does not match the store, please login with correct account" - Triggered when: - Entered account credentials do not match the store being unbound - Account has only one bound store and that store has already been unbound ### Post-Unbinding - Meituan sends callback request to developer's configured "Store Mapping Unbinding Callback Address" - Callback includes unbinding details (developerId, ePoiId, businessId, timestamp) - Developer must respond with {"data":"success"} - If success response not received, Meituan retries up to 10 times ### Supported Business Types - Group Purchase (businessId: 1) - Food Delivery (businessId: 2) - Flash Sale (businessId: 3) - Payment (businessId: 5) - Reservation (businessId: 7) - Omnichannel Member (businessId: 8) - Food Delivery Non-Order Taking (businessId: 16) ``` -------------------------------- ### POST /api/request - Generic API Request Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule Generic API request endpoint demonstrating the standard HTTP POST request format for all Meituan Technical Cooperation Center APIs. All requests must be POST method with application/x-www-form-urlencoded content type and all parameters placed in the request body, not query parameters. ```APIDOC ## POST /api/request ### Description Generic Meituan Technical Cooperation Center API endpoint. All API requests follow this standardized format with required system parameters for authentication and business parameters specific to each endpoint. ### Method POST ### Endpoint /api/[specific-endpoint] ### Content-Type application/x-www-form-urlencoded ### Parameters #### System Parameters (Required for all requests) - **developerId** (int) - Required - Developer ID obtained from developer center. Example: 100567 - **charset** (string) - Required - Character encoding, must be utf-8. Example: utf-8 - **timestamp** (int) - Required - Current request timestamp in seconds. Example: 1618975600 - **version** (int) - Required - API version, must be 2. Example: 2 - **businessId** (int) - Required - Business type ID. See Business ID List. Example: 2 (Takeout) - **sign** (string) - Required - Digital signature generated from all request parameters to ensure no tampering. Example: ce5141614230cd561dfed062857544f226b1cd54 - **biz** (jsonString) - Required - Business request parameters in JSON string format. Pass empty JSON object "{}" if endpoint requires no business parameters. Example: {"id":1,"name":"hello"} - **appAuthToken** (string) - Optional - Authorization token obtained through store mapping or third-party authorization. Example: V2-0ecde8631431a5ed6b3e7368afbabdabf5c3ff6e5bed446df0b7c99e7a6df054818c322721429afad0078d6d ### Request Example ``` POST /api/[endpoint] Content-Type: application/x-www-form-urlencoded developerId=1031123&charset=UTF-8×tamp=1618975600&version=2&businessId=18&sign=96e2cedadeb7401acf48e46672673f6512cc460e&biz={"id":1,"name":"hello"}&appAuthToken=V2-5fc970ded1f0f933594ee68bf8da6eaa06a44a340e5b23832f944a716379f006aeddd4598541271ece7f91d185b64080 ``` ### Response #### Success Response (200) ```json { "code": "OP_SUCCESS", "data": {}, "traceId": 5362971231773781183 } ``` - **code** (string) - Response code. OP_SUCCESS indicates successful request - **data** (object) - Business data returned by the endpoint - **traceId** (long) - Unique trace ID for this request, use for troubleshooting #### Error Response (4xx/5xx) ```json { "code": "OP_SYSTEM_PARAM_ERROR", "msg": "Missing system parameters", "traceId": 5362971231773781183 } ``` - **code** (string) - Error code - **msg** (string) - Error description message - **traceId** (long) - Unique trace ID for this request, use for troubleshooting ### Important Notes 1. **POST Request Parameters**: All request parameters must be placed in the request body. Do NOT put parameters in Query string. 2. **Content-Type**: Must be application/x-www-form-urlencoded 3. **Response Format**: All responses are in JSON format with Content-Type: application/json 4. **Character Encoding**: Use UTF-8 encoding 5. **Version**: API version must be 2, cannot be omitted 6. **Signature**: The sign parameter must be generated according to signature rules to ensure request integrity ### Business ID Reference | Business ID | Business | |---|---| | 1 | Restaurant Takeout Group Purchase | | 2 | Takeout | | 3 | Flash Discount | | 5 | Platform Basic Business | | 7 | Restaurant Reservation | | 15 | Restaurant Brand Member Card | | 16 | Takeout Non-Order Taking | | 18 | Restaurant System - Smart Version | | 19 | Delivery - Contract Version | | 22 | In-Store Advertising | | 24 | AI Service - Image Processing | | 27 | Quick Delivery | | 28 | AI Service - Intelligent Chat Bot | | 29 | Voice Atomic Capability | | 31 | Delivery - Retail Version | | 33 | Customer Self-Service Verification | | 36 | Intelligent Auto-Call Robot | | 37 | Hotel Management Suite | | 39 | Autonomous Vehicle Delivery | | 42 | Natural Language Processing | | 46 | Group Purchase Delivery | | 49 | Restaurant Queuing | | 50 | Meituan Live Streaming | | 51 | Restaurant Online Ordering | | 54 | Meituan QR Code Content Tool | | 55 | Dianping Free Trial | | 57 | Hotel Management System | | 58 | Service Retail | | 59 | Service Retail (Customer) | | 61 | Off-Site Distribution | | 66 | Ticket Direct Connection | | 71 | Store Basic Information Direct Connection | | 78 | International Hotel | | 79 | Restaurant Direct Connection Solution | ### Error Codes Common error codes: - **OP_SUCCESS** - Request successful - **OP_SYSTEM_PARAM_ERROR** - Missing or invalid system parameters - See public error code definition document for complete list ### Common Issues **Issue**: Request reports missing system parameters **Solution**: Verify all system parameters are correct and placed in request body, not Query parameters ``` -------------------------------- ### Store Self-Unbinding Callback API Source: https://developer.meituan.com/docs/biz/biz_waimaing_d3a3e69b-7ef8-470c-bc7c-b6b6c66441c5 Callback endpoint that receives unbinding information from Meituan's technical cooperation center after a merchant performs self-unbinding. The developer must set up the callback URL in the developer center and handle the form-encoded POST request. ```APIDOC ## POST [Developer Configured Callback URL] ### Description Meituan's technical cooperation center sends store unbinding information to the developer's callback endpoint after a merchant completes self-unbinding. This callback must be configured in the developer center under "Store Mapping Unbinding Callback Address". ### Method POST ### Endpoint [Developer configured callback URL] ### Request Headers - **Content-Type**: application/x-www-form-urlencoded ### Request Parameters (Form-Encoded) - **developerId** (string) - Required - Developer ID assigned by Meituan (visible in developer center) - **ePoiId** (string) - Required - Unique identifier assigned by service provider to the store during binding - **epoiId** (string) - Required - Same as ePoiId (exists due to historical reasons; case-sensitive systems must handle both) - **businessId** (string) - Required - Business type: 1=Group Purchase, 2=Food Delivery, 3=Flash Sale, 5=Payment, 7=Reservation, 8=Omnichannel Member - **timestamp** (string) - Required - Unix timestamp in milliseconds when store was unbound ### Request Example ``` developerId=100100&ePoiId=abc_123&epoiId=abc_123&businessId=2×tamp=1500963079169 ``` ### Response #### Success Response (200) - **data** (string) - Must return the exact JSON string: {"data":"success"} ### Response Example ```json {"data":"success"} ``` ### Important Notes - Content-Type must be application/x-www-form-urlencoded (not JSON) - Developer must return {"data":"success"} JSON string for successful processing - If success response not received, Meituan will retry up to 10 times with increasing intervals - Developer must handle and de-duplicate retry messages independently - Two parameters with same meaning exist: ePoiId and epoiId (case-sensitive on Linux/Unix systems) - One token per store; unbinding both group purchase and food delivery updates token on rebinding; unbinding only one business maintains same token ### Error Handling - If callback URL not configured or returns non-success, Meituan will retry the callback - Developers must implement idempotent processing for duplicate callbacks ``` -------------------------------- ### Meituan API Success Response Format Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule This is the standard JSON response format for a successful API call. It includes a 'code' field indicating success, a 'data' field for business-specific results, and a 'traceId' for tracking. ```json { "code": "OP_SUCCESS", "data": {}, "traceId": 5362971231773781183 } ``` -------------------------------- ### Meituan API Failure Response Format Source: https://developer.meituan.com/docs/biz/comm-dev-isv-api-rule This JSON structure represents a failed API call. It includes an error 'code', an optional 'msg' for a human-readable error description, and a 'traceId' for debugging. ```json { "code": "OP_SYSTEM_PARAM_ERROR", "msg": "缺少系统参数", "traceId": 5362971231773781183 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.