# Service Provider Allocation Resource Pack

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

assignPackage

# Functional description

  • After purchasing the goods, the service provider can allocate the resource package to the designated Mini Program through this interface.

# Note

  • Allocation of resource packs for asynchronous tasks, interface call successful, the allocation of resource packs is ultimately successful, please use the server-side message pushAllocation Result EventShall prevail.
  • Recommended storagerequestId, if you want to cancel the allocation, you need to match therequestIdBe consistent.

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/wxa/charge/service-provider/package/assign?access_token=ACCESS_TOKEN 

# Request parameters

attribute type Required Introductions
access_Token string yes Interface invokes the certificate, which is URL Parameters, non Body Parameters. access_Token is available throughgetAccessTokenInterface is obtained.
orderId string yes The vendor order ID to assign, such as DD2970445798112968704
skuId string yes Product SKU expected to be assigned to the Mini Program ID
receiverAppId string yes AppIDs to be allocated
requestId string yes Unique request ID, the same allocation request must be unique, the same order number and requestId multiple requests equal to one. RequestId should be a 10-64 bit character string

# Return parameters

attribute type Introductions
errcode number Error code
errmsg 初始值 Error message

# Call Example

Example Dxplaination: HTTPS calls

# Sample Request Data

POST https://api.weixin.qq.com/wxa/charge/service-provider/package/assign?access_token=ACCESS_TOKEN
{
  "orderId": "DD2970445798112968704",
  "skuId": "20000178",
  "requestId": "1687254272930",
  "receiverAppId": "wxbf98693b6554a24a"
}

# Return Data Example


{
  "errcode": 0
}

# Error code

Error code Error code Solutions
10120002 Parameter error
10120405 Method not available Use the correct method to request against the document
10120800 Order ID is not valid
10121009 Repeated call, assigned successfully
10121010 Distribution has been cancelled
10121011 Allocated Try again later.
10121012 The resource pack has expired and cannot be allocated
10121013 Invalid resource pack
10121020 Unable to assign purchase order to specified SKU ID Check that the skuId in the parameter is in the list of sku allocable for the purchased resource package
10121021 SKU does not exist Check parameters skuId
10121022 Unable to assign purchase order to specified Mini Program
10121023 System error Please try again
初始值 Insufficient resource pack for order to allocate Replacement Order or SKU