type=discover
[ouya-store-api.git] / api / devs.ouya.tv / api-v1-games-xxx-purchases.post.rst
1 ========================================================
2 ``POST https://devs.ouya.tv/api/v1/games/xxx/purchases``
3 ========================================================
4
5 Buy a game.
6
7 After buying the game shows up in 
8 `GET https://devs.ouya.tv/api/v1/premium_purchases`_.
9
10
11 Usage
12 =====
13 - When the user buys an app/game.
14
15
16 HTTP request
17 ============
18 Protocol
19   ``https``
20 Method
21   ``POST``
22 Host
23   ``devs.ouya.tv``
24 Path
25   ``/api/v1/games/xxx/purchases``
26
27   ``xxx``
28     app package name
29
30   Example: ``/api/v1/games/com.ChrisChung.CatlateralDamage/purchases``
31 Headers
32   Standard headers
33
34   ``Content-Type``
35     ``application/x-www-form-urlencoded``
36 GET parameters
37   ``auth_token``
38     Same as ``X-OUYA-AuthToken``
39   ``user_agent``
40     ``launcher`` (at least when bought through the OUYA UI)
41 POST parameters
42   ``blob``
43     Encrypted data
44   ``iv``
45     FIXME: Initialization vector for the cryptographic function
46   ``key``
47     FIXME: Key used to encrypt the data. FIXME: symmetric or assymetric?
48   ``auth_token``
49     Same as ``X-OUYA-AuthToken``
50
51
52 HTTP response
53 =============
54 Status code
55   ``200 OK``
56 Content-type
57   ``application/json; charset=utf-8``
58
59 Example
60 -------
61
62 .. include:: api-v1-games-xxx-purchases.post.response.json
63    :code: