Updated on 2024-06-12 GMT+08:00

Updating an Instance

Description

KooGallery calls this interface to update the expiration date of an instance after a customer purchases a product after trial use, renews the product, or cancels the renewal.

  • When this interface is called, update the expiration date and return a notification to KooGallery.
  • Ensure that this interface is normal. If the interface fails to be called, customer services may be released.
  • If you receive an email indicating that the interface fails to be called in your email address of customer service or that one bound to your KooGallery account, handle the interface exception in a timely manner.
  • KooGallery monitors interface exceptions. If a product has frequent instance exceptions, KooGallery will remove the product from the catalog.

The following figure shows the process of updating an instance.

Request Message

The following table describes the request parameters.

Request method: POST

Body parameters

Parameter

Mandatory

Type

Maximum Length

Description

activity

Yes

String

20

Request ID, which is used to distinguish the scenario.

For renewals, the value is refreshInstance.

scene

Yes

String

64

Scenario where the instance change is triggered.

TRIAL_TO_FORMAL: trial use to commercial use.

RENEWAL: renewal.

UNSUBSCRIBE_RENEWAL_PERIOD: renewal cancellation.

orderId

Yes

String

64

KooGallery order ID.

The commercial order ID is transferred when the customer purchases the product after trial use.

The renewal order ID is transferred during renewal.

The ID of the renewal order to be cancelled is transferred during renewal cancellation.

orderLineId

Yes

String

64

KooGallery order line ID.

instanceId

Yes

String

64

Instance ID.

productId

No

String

64

Product ID. If a customer renews a product and changes the billing cycle or a customer purchases a product after trial use, a new productId is provided.

expireTime

Yes

String

20

Expiration time.

Format: yyyyMMddHHmmss

testFlag

No

String

2

Whether a request is submitted for debugging.

  • 1: debugging request.
  • 0: non-debugging request.

The default value is 0.

Example request:

curl -X POST 'https://www.isvwebsite.com/saasproduce?signature=3F6E6652B7BE26B27ABFC3D11214D04BFD8D2CF8AC21603D85620174FE8DE062&timestamp=1680509496350&nonce=8BF8496A350E37BDB0E8956D39D433ED417C3FC9459DCFFE7F03BFBF69B12085' -H 'Accept:application/json' -H 'Content-Type:application/json;charset=utf8' -d'{"activity":"refreshInstance","expireTime":"20221124023618256","instanceId":"10e758d0-31ad-4c4b-8f1b-81d03469a10e","orderId":"CS2211181819B4LVS","orderLineId":"CS2211181819B4LVS-000001","productId":"OFFI461867333479178240","scene":"RENEWAL","testFlag":"0"}' 

The following table describes the response parameters.

Parameter

Mandatory

Type

Maximum Length

Description

resultCode

Yes

String

6

Result code.

For details, see Result Codes.

resultMsg

No

String

255

Result message.

Example response:

{ 
    "resultCode":"000000", 
    "resultMsg":"success." 
}