You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
timelimit-server/docs/api/purchase.md

1.4 KiB

/purchase

This endpoint is used for handling purchases from the client. It currently only supports purchases using Google Play in app purchases.

see

POST /purchase/can-do-purchase

Use this before a purchase to check if a purchase is possible.

request

see this JSON schema

response

On a invalid request body: HTTP status code 400 Bad request

On a invalid auth token: HTTP status code 401 Unauthorized

On success: a JSON object with the property canDoPurchase (string) and googlePlayPublicKey (string, base64)

possible values of canDoPurchase:

  • yes
  • no due to old purchase
  • no because not supported by the server

The googlePlayPublicKey is the key by which purchases using google play should be signed.

POST /purchase/finish-purchase-by-google-play

Use this to report a purchase to the server/ unlock all features after a purchase using Google Play.

request

see this JSON schema

response

On a invalid request body: HTTP status code 400 Bad request

On a invalid auth token: HTTP status code 401 Unauthorized

On a invalid purchase: HTTP status code 409 Conflict

On success: {"ok": true}

error handling

  • if the purchase was already added (for the same or an other family), then this request is ignored and success is returned