Skip to content

Comments

feat(miniprogram): add intracity delivery service APIs#875

Merged
silenceper merged 6 commits intosilenceper:v2from
Lumiaqian:feature/2026-01-20/lumia_intracity-delivery
Jan 22, 2026
Merged

feat(miniprogram): add intracity delivery service APIs#875
silenceper merged 6 commits intosilenceper:v2from
Lumiaqian:feature/2026-01-20/lumia_intracity-delivery

Conversation

@Lumiaqian
Copy link
Contributor

Summary

Add WeChat intracity (same-city) delivery service APIs for miniprogram.

Official Documentation: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/intracity_service.html

New APIs

Store Management

  • IntracityApply - 开通门店权限
  • IntracityCreateStore - 创建门店
  • IntracityQueryStore - 查询门店
  • IntracityUpdateStore - 更新门店

Payment & Balance

  • IntracityStoreCharge - 门店运费充值
  • IntracityStoreRefund - 门店运费退款
  • IntracityQueryFlow - 门店运费流水查询
  • IntracityBalanceQuery - 门店余额查询

Order Management

  • IntracityPreAddOrder - 预下配送单(查询运费)
  • IntracityAddOrder - 创建配送单
  • IntracityQueryOrder - 查询配送单
  • IntracityCancelOrder - 取消配送单
  • IntracityMockNotify - 模拟配送回调(仅用于测试)

Usage Example

miniprogram := wc.GetMiniProgram(cfg)
intracity := miniprogram.GetIntracity()

// Create store
res, err := intracity.IntracityCreateStore(ctx, &express.CreateStoreRequest{
    OutStoreID: "store001",
    StoreName:  "Test Store",
    AddressInfo: express.IntracityAddressInfo{
        Province: "广东省",
        City:     "深圳市",
        Area:     "南山区",
        House:    "深南大道10000号",
        Lat:      22.540366,
        Lng:      113.934559,
        Phone:    "13800001380",
    },
})

// Create delivery order
orderRes, err := intracity.IntracityAddOrder(ctx, &express.AddOrderRequest{
    WxStoreID:   res.WxStoreID,
    OutOrderID:  "order001",
    UserOpenID:  "user_openid",
    UserPhone:   "13900001390",
    UserName:    "张三",
    UserLat:     22.550000,
    UserLng:     113.940000,
    UserAddress: "深圳市南山区xxx路xxx号",
})

Checklist

  • Code follows existing patterns in this repository
  • go fmt and go vet pass
  • go build ./... succeeds

Lumiaqian and others added 6 commits October 16, 2024 15:59
feat(media): add getTempFile api
Add WeChat intracity (same-city) delivery service APIs including:
- Store management: Apply, Create, Query, Update store
- Payment: StoreCharge, StoreRefund, QueryFlow, BalanceQuery
- Order management: PreAddOrder, AddOrder, QueryOrder, CancelOrder

Ref: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/intracity_service.html
Copy link
Collaborator

@houseme houseme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive WeChat intracity (same-city) delivery service APIs to the miniprogram package. The implementation provides a complete set of endpoints for managing stores, payments, balances, and delivery orders for same-city delivery services.

Changes:

  • Added GetIntracity() method to MiniProgram struct for accessing intracity delivery APIs
  • Implemented 12 new API methods covering store management, payment/balance operations, and order lifecycle
  • Defined comprehensive type definitions and request/response structures following WeChat's official API specifications

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
miniprogram/miniprogram.go Added GetIntracity() accessor method returning Express instance for intracity delivery APIs
miniprogram/express/intracity.go Complete implementation of 12 intracity delivery API methods with supporting types, constants, and data structures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@silenceper silenceper merged commit f0f35e2 into silenceper:v2 Jan 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants