Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 5edc958

Browse files
author
nobody
committed
JSON Schema Update
1 parent 770de6a commit 5edc958

File tree

4 files changed

+202
-0
lines changed

4 files changed

+202
-0
lines changed

_data/v3.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ groups:
135135
title: P2P Advertiser Update
136136
- name: p2p_chat_create
137137
title: P2P Chat Create
138+
- name: p2p_country_list
139+
title: P2P Country List
138140
- name: p2p_order_cancel
139141
title: P2P Order Cancel
140142
- name: p2p_order_confirm
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"p2p_country_list": 1,
3+
"country": "id"
4+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "P2P Country List (response)",
4+
"description": "List all or specific country and its payment methods.",
5+
"type": "object",
6+
"required": [
7+
"echo_req",
8+
"msg_type"
9+
],
10+
"properties": {
11+
"p2p_country_list": {
12+
"description": "Country identified by country code",
13+
"type": "object",
14+
"additionalProperties": true,
15+
"patternProperties": {
16+
"^([a-z]{2})?$": {
17+
"description": "Country code identifier.",
18+
"type": "object",
19+
"additionalProperties": false,
20+
"required": [
21+
"country_name",
22+
"cross_border_ads_enabled",
23+
"fixed_rate_adverts",
24+
"float_rate_adverts",
25+
"float_rate_offset_limit",
26+
"local_currency",
27+
"payment_methods"
28+
],
29+
"properties": {
30+
"country_name": {
31+
"description": "Display name of country.",
32+
"type": "string"
33+
},
34+
"cross_border_ads_enabled": {
35+
"description": "When 1, users in this country may place orders on ads in other countries.",
36+
"type": "integer",
37+
"enum": [
38+
0,
39+
1
40+
]
41+
},
42+
"fixed_rate_adverts": {
43+
"description": "Availability of fixed rate adverts.",
44+
"type": "string",
45+
"enum": [
46+
"disabled",
47+
"enabled",
48+
"list_only"
49+
]
50+
},
51+
"float_rate_adverts": {
52+
"description": "Availability of floating rate adverts.",
53+
"type": "string",
54+
"enum": [
55+
"disabled",
56+
"enabled",
57+
"list_only"
58+
]
59+
},
60+
"float_rate_offset_limit": {
61+
"description": "Maximum rate offset for floating rate adverts.",
62+
"type": "number"
63+
},
64+
"local_currency": {
65+
"description": "Local currency of the country.",
66+
"type": "string",
67+
"pattern": "^[a-zA-Z0-9]{2,20}$",
68+
"examples": [
69+
"USD"
70+
]
71+
},
72+
"payment_methods": {
73+
"description": "Payment method identifier.",
74+
"type": "object",
75+
"additionalProperties": false,
76+
"patternProperties": {
77+
"^[a-z0-9_]{1,30}$": {
78+
"description": "Payment method identifier.",
79+
"type": "object",
80+
"additionalProperties": false,
81+
"properties": {
82+
"display_name": {
83+
"description": "Display name of payment method.",
84+
"type": "string"
85+
},
86+
"fields": {
87+
"description": "Payment method field definitions.",
88+
"type": "object",
89+
"additionalProperties": false,
90+
"minProperties": 1,
91+
"patternProperties": {
92+
"^[a-z0-9_]{1,30}$": {
93+
"description": "Field identifier.",
94+
"type": "object",
95+
"additionalProperties": false,
96+
"required": [
97+
"display_name",
98+
"required",
99+
"type"
100+
],
101+
"properties": {
102+
"display_name": {
103+
"description": "Display name of payment method field.",
104+
"type": "string"
105+
},
106+
"required": {
107+
"description": "Is field required or optional.",
108+
"type": "integer"
109+
},
110+
"type": {
111+
"description": "Field type.",
112+
"type": "string",
113+
"enum": [
114+
"text",
115+
"memo"
116+
]
117+
}
118+
}
119+
}
120+
}
121+
},
122+
"type": {
123+
"description": "Payment method type.",
124+
"type": "string",
125+
"enum": [
126+
"bank",
127+
"ewallet",
128+
"other"
129+
]
130+
}
131+
}
132+
}
133+
}
134+
}
135+
}
136+
}
137+
}
138+
},
139+
"echo_req": {
140+
"description": "Echo of the request made.",
141+
"type": "object"
142+
},
143+
"msg_type": {
144+
"description": "Action name of the request made.",
145+
"type": "string",
146+
"enum": [
147+
"p2p_country_list"
148+
]
149+
},
150+
"req_id": {
151+
"description": "Optional field sent in request to map to response, present only when request contains `req_id`.",
152+
"type": "integer"
153+
}
154+
}
155+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "P2P Country List (request)",
4+
"description": "List all or specific country and its payment methods.",
5+
"type": "object",
6+
"auth_required": 1,
7+
"auth_scopes": [
8+
"payments"
9+
],
10+
"additionalProperties": false,
11+
"required": [
12+
"p2p_country_list"
13+
],
14+
"properties": {
15+
"p2p_country_list": {
16+
"description": "Must be 1",
17+
"type": "integer",
18+
"enum": [
19+
1
20+
]
21+
},
22+
"country": {
23+
"description": "[Optional] 2-letter country code. If not provided all countries are returned.",
24+
"type": "string",
25+
"pattern": "^([a-z]{2})?$"
26+
},
27+
"loginid": {
28+
"description": "[Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.",
29+
"type": "string",
30+
"pattern": "^[A-Za-z]+[0-9]+$"
31+
},
32+
"passthrough": {
33+
"description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field.",
34+
"type": "object"
35+
},
36+
"req_id": {
37+
"description": "[Optional] Used to map request to response.",
38+
"type": "integer"
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)