Self developed access of e-commerce merchants

The self developed access of microblog e-commerce merchant accounts is mainly for businesses with independent development capability. Different from the application of e-commerce service providers, the self developed access of businesses is developed by businesses themselves and cannot be provided to other businesses.


E-commerce service provider access, different from e-commerce merchants' self-developed access, is a third-party service provider providing services to e-commerce merchants. Please move to E-commerce service provider access


Update log

Update time Update content
2023-01-13
  • New merchant performance interface (only for virtual merchants)
  • New merchant event notification push access (only for virtual merchants)
  • The interface Get Sub Order List and Search Sub Order add the return field state_code
  • The interface Get Sub Order Details adds the return fields Expect_finish_time, Finish_type, and is_timeout
  • When the interface Submit Shipment needs logistics shipment, if the required address information is missing, it will try to get the default after-sales address of the merchant once
2023-05-31
  • The interface [Get sub order details] adds the return field [contact_phone] (the mobile phone number of the virtual and medical beauty order contact)


Access preparation

For the access of self-developed businesses, the accessed microblog accounts need to be consistent: microblog accounts bound to microblog stores (filled in when entering), microblog accounts applying for e-commerce business identity, and microblog accounts registered as microblog open platform developers. These three accounts need to be the same microblog account.



The first step is for businesses to enter the business end of microblog e-commerce. When entering, please fill in the microblog account that needs to be bound to the microblog store (it is recommended to use official microblog account).


The second step is to contact the corresponding industry operation of the microblog e-commerce platform after the merchants have settled in, and provide the microblog account and relevant information in [Step 1] to bind the e-commerce business. At this time, the access party will obtain the e-commerce business identity appid and the e-commerce signature key sign key, which are used to verify the signature when calling the e-commerce capability interface. See E-commerce capability interface verification signature


Note: If the business has not yet established a connection with the industry operation, you can consult the official customer service of the microblog e-commerce through the microblog client Weibo e-commerce customer service waiter The customer service personnel will help you establish a connection with the industry operation.


The third step is that businesses use the microblog account in the previous two steps to log in to the microblog open platform, register as a developer, and complete identity authentication. When the developer's identity authentication is completed, they can create e-commerce business type applications on the open platform (micro connection - e-commerce business), and wait for approval. At this time, the access party will obtain the appkey and appsecret of the microblog open platform, For obtaining authorization, see E-commerce merchant access - basic capabilities - obtaining merchant account authorization


Please read the step requirements carefully, The uid is the unique identifier of the call data. It is necessary to ensure the uid consistency in the above three steps. When adjusting the service connection, it is necessary to pass the dual verification of [Step] - E-commerce] and [Step III - Open Platform], both of which are indispensable.

Validation field required Obtaining method Whether it is dynamic verification
E-commerce platform E-commerce merchant ID appid and e-commerce signature key Contact e-commerce operators Weibo e-commerce customer service waiter , the operator applies and issues the merchant identity and key to the merchant No, details: E-commerce capability interface verification signature
Open platform The appkey and appsecret of Weibo open platform Log in to the open platform, click on the app key and appsecret Yes, the merchant needs to obtain authorization according to the requirements of the third step, and click authorization. The validity period of the authorization should be periodically refreshed by the merchant (the validity period of access_token is 2h, it is recommended to set 1.5h refresh, and reserve redundancy time). At the same time, it is necessary to establish a compensation mechanism for extreme cases, such as the error report caused by refreshing when it is about to connect. Details: E-commerce merchant access - basic capabilities - obtaining merchant account authorization


Basic capability

At present, it mainly provides the ability to obtain their own merchant account authorization access_token when merchant accounts access microblog e-commerce services independently.


Authorize login to obtain access_token

For e-commerce merchant applications, the access_token authorized by their own merchant account is their only interface calling voucher. E-commerce merchants need to use this access_token when calling each interface in their self-developed access to Weibo e-commerce services. Developers need to properly save the access_token on the server, and should not save it to the front end of the application.


The access_token granted by e-commerce merchants is different from the access_token granted by web apps and mobile apps. The validity period of the access_token granted by e-commerce merchants is 2 hours, which needs to be refreshed regularly. Repeated acquisition will lead to the invalidation of the access_token acquired last time.


For e-commerce merchant accounts, when self-developed microblog e-commerce services are accessed, the following interfaces can be directly called through the appkey and appsecret self-developed by e-commerce merchants to obtain their own authorized access_token.


If e-commerce merchants need to obtain authorization from other microblog users, they need to follow the two-step authorization process of web applications, namely through oauth2/authorize The oauth2/access_token interface first requests the authorization of other Weibo users, gets the authorization code after the other party agrees and clicks Authorization, and then exchanges the authorization code for the authorization access_token through the server.


E-commerce merchants self-developed access authorization interface

Obtain the authorization token of your own e-commerce merchant account


Interface URL
 https://api.weibo.com/oauth2/shop/authorize


HTTP request mode

GET


Request Parameters
Parameter name Required type Description
client_id true string [E-commerce merchants' self-developed access to APPKEY] applied by e-commerce merchants on the microblog open platform.
timestamp true string Current timestamp in milliseconds.
nonce true string Random string.
sign true string Signature: md5 (client_id&developer_uid&timestamp&nonce&secret).

Note: client_id refers to the [e-commerce merchants' self-developed access to APPKEY] applied by e-commerce merchants on the microblog open platform, Developer_uid is the developer, that is, the microblog UID of the e-commerce merchant account.


Return Result JSON Example
 { "client_id": "772915", "uid": 1404376560, "access_token": "2.00lnqNgH0YhE_q6594efd4abyzYM7E", "issued_at": 1655101652, "expires_in": 2637148 }


Return Field Description
Return value field type Field Description Description
client_id string [E-commerce merchants' self-developed access to APPKEY] applied by e-commerce merchants on the microblog open platform.
uid string The Weibo UID of authorized users is actually the UID of e-commerce merchant accounts.
access_token string The authorized [e-commerce merchant authorization access_token] is used to call the e-commerce merchant open interface.
issued_at string The generated timestamp of access_token.
expires_in string The life cycle of access_token, in seconds.


After e-commerce merchants have obtained their own merchant account authorization, developers should maintain the validity of access_token on the server side and save the access_token. The call to the microblog open interface should also be completed on the server side. Do not transfer access_token to the front end, nor initiate the call to the microblog open interface on the front end. Do not refresh access_token between services on the server side, To avoid conflicts, which may overwrite access_token and affect the calling interface.


Platform capability

The platform capabilities provided to e-commerce merchants currently include order capability interface, commodity capability interface, and event notification push.






Document update time: May 31, 2023