more information about purchasing
[ouya-store-api.git] / api / devs.ouya.tv / api-v1-games-xxx-purchases.post.rst
index 55c1614a7234206686a513118e897bb039a47165..6babf3a1818709bad6e48c58276146646718e7d4 100644 (file)
@@ -40,14 +40,37 @@ GET parameters
     ``launcher`` (at least when bought through the OUYA UI)
 POST parameters
   ``blob``
-    Encrypted data
+    Base64-encoded encrypted data
   ``iv``
-    FIXME: Initialization vector for the cryptographic function
+    Base64-encoded initialization vector for the cryptographic function
   ``key``
-    FIXME: Key used to encrypt the data. FIXME: symmetric or assymetric?
+    Base64-encoded key used to encrypt the ``blob``.
+    Encrypted with FIXME: gamer key or developer key.
   ``auth_token``
     Same as ``X-OUYA-AuthToken``
 
+The decrypted ``blob`` again contains ``blob``, ``key`` and ``iv``.
+
+The decrypted inner ``blob`` contains a JSON object:
+
+``identifier``
+  Product key
+``testing``
+  Unknown. Always "true".
+``uuid``
+  Random number that is used by the game for this purchase request.
+  Must be returned in the response to this request.
+
+Raw request (without encryption):
+
+.. include:: api-v1-games-xxx-purchases.post.request-nocrypt.json
+   :code:
+
+Decrypted:
+
+.. include:: api-v1-games-xxx-purchases.post.request-decrypted.json
+   :code:
+
 
 HTTP response
 =============
@@ -56,6 +79,17 @@ Status code
 Content-type
   ``application/json; charset=utf-8``
 
+Again the base-64 encoded keys: ``iv``, ``key`` and ``blob``.
+
+``blob`` is a JSON object that needs to contain the ``uuid`` property.
+Most games do not want any other properties.
+
+"God of Blades" requires:
+
+- ``identifier``
+- ``name``
+- ``priceInCents``
+
 Example
 -------