Skip to main content

Idempotency

1. Idempotency

For explanation of idempotency in PGOS, please check this docs .

1.1 Idempotency for economy

Idempotency token must be unique for each request of an API call type. That means it is allowed to use same idempotency_token across different API call type. For example, suppose IdempotencyToken1 has been used in the request of GrantItemsToPlayer, then if IdempotencyToken1 is passed in ConsumeInstance, the instance will be consumed successfully because ConsumeInstance is considered as a different API call type from GrantItemsToPlayer . Here're several call types of Economy Backend API:

  1. Consume instance(client SDK): Request with same idempotency token will get same result in ConsumeInstance.
  2. Grant Item or currency : Request with same idempotency token will get same result in GrantItemsToPlayer, GrantCurrencyToPlayer.
  3. Subtract VC :Request with same idempotency token will get same result in SubtractPlayerCurrency.
  4. Increase instance custom data:the Idempotency scope of increasing instance customdata is different from above. The idempotency token just works under the same instance. Request with a different player or different instance will be regard as a different request even using the idempotency token.