-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapiary.apib
278 lines (166 loc) · 9.73 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
FORMAT: 1A
HOST: https://blacknectar-api.blacksource.tech:9102/
# BlackNectar API
<img src="https://raw.githubusercontent.com/BlackWholeLabs/BlackNectar-iOS/develop/Design/Logo/Icon-Original.png" width="350"> </img>
The BlackNectar API is a simple API that allows you to view and search
for Stores in the United States that support EBT (Electronic Benefits Transfer) cards.
<!--Shopping API -->
<!--========================================================-->
# Group Stores
## Search Stores [/stores{?limit,searchTerm,latitude,longitude,radius,zipCode}]
Search for available EBT Stores.
+ Parameters
+ limit (number, optional) - The maximum number of results to return.
+ Default: 200
+ searchTerm (string, optional) - Searches for stores with this in their names.
+ latitude (number, optional) - Used in conjunction with `longitude` to specify a location-based search.
+ longitude (number, optional) - Used in conjunction with `latitude` to specify a location-based search.
Searches for stores near the specified geo-coordinate.
+ radius (number, optional) - Defines the radius (in meters) for the geo-query.
Radius can only be used with `latitude` and `longitude`.
+ zipCode (string, optional) - Searches for store in this Zip Code. This parameter can be used in place of latitude & longitude.
The Radius parameter has no effect on this query.
### Search [GET]
Search for Stores using the specified query parameters.
+ Response 200 (application/json)
+ Attributes (array[Store])
+ Response 400 (text/plain)
## Data Structures
### Store (object)
+ store_id: `5ceaf0fe-cd7b-4ff8-904e-3a6c1be9fbf6` (string, required) - The unique identifier for the Store
+ store_name: `Angelica's Market` (string, required) - The name of the Store.
+ is_farmers_market: false (boolean, required) - Tells whether the store is a Farmer's Market or not.
+ address (Address, required)
+ location (Location, required)
+ main_image_url: `http://www.portagewibid.org/wp-content/uploads/2014/11/Farmersmarket.jpg` (string, optional) - If present, contains a URL to a picture of the Store.
### Address (object)
+ address_line_1: 243 E 53rd St (string, required) - The first part of the address.
+ address_line_2: Suite #200 (string, optional) - The second part of the address present on some stores.
+ city: Los Angeles (string, required)
+ state: CA (string, required)
+ county: Los Angeles (string, required)
+ zip_code: `90210` (number, required) - The 5-Digit Zip Code.
+ local_zip_code: 0401 (number, optional) - The Local 4-Digit Zip Code.
### Location (object)
+ latitude: `33.994267` (number, required)
+ longitude: `-118.27029` (number, required)
<!--EBT API -->
<!--========================================================-->
# Group EBT
Get an EBT Card's Balance and Transaction History.
## API Overview [/ebt]
### Get Supported States [GET]
Get a list of all states supported by the EBT API.
+ Response 200 (application/json)
+ Attributes (array)
+ (object) - A State supported by the system
+ id: `CA` - The short two-digit code for the state. This is what is used as a path parameter in all API calls
+ name: `California` - The long human-displayable name of the state.
---------------------------------
## US State Information [/ebt/{state}]
Information about a particular State. See [#get-supported-states] for details.
+ Parameters
+ state: `NY` (string, required) - The two-digit abbreviation of the state. Can be upper-case or lower-cased.
### Get State Features and Requirements [GET]
Get a States' features, sign-in requirements, and sign-up requirements.
+ Response 200 (application/json)
+ Attributes (StateFeatures)
Get the features available to a particular state
+ Response 404 (application/json)
Thrown when acessing a state that does not exist
---------------------------------
## Check State Account [/ebt/{state}/check]
### Check State Account Exists [POST]
Check if a user has an account with the state website.
The request must include values for each of the required sign-in fields.
+ Request (application/json)
+ Attributes (array[FieldValue], required)
+ Response 200 (application/json)
+ Attributes (object)
+ exists: `true` (boolean, required) - True if the account exists, false otherwise
+ message (string, optional) - A detailed message in case the operation failed
---------------------------------
## Sign In [/ebt/{state}/sign-in]
### Sign In [POST]
Sign into a State Website.
The request must include values for each of the required sign-in fields.
To view a States sign-in requirements, make sure to `GET` `/ebt/{state}/`
+ Request (application/json)
+ Attributes (array[FieldValue], required)
Values for each of the State's required sign-in fields.
+ Response 200 (application/json)
+ Attributes (OperationResult, required)
---------------------------------
## Create State Account [/ebt/{state}/create]
### Create Account [POST]
Create an account with the State Website.
Note that each website has different account requirements.
+ Request (application/json)
+ Attributes (array[FieldValue], required)
Values for each of the State's required fields
+ Response 200 (application/json)
+ Attributes (OperationResult, required)
---------------------------------
## Balance [/ebt/{state}/balance]
### View Balance [POST]
View an EBT Card's Balance. Credentials must be passed into the method body.
+ Request (application/json)
+ Attributes (array[FieldValue], required)
Values necessary to login to the State account
+ Response 200 (application/json)
+ Attributes (Balance)
---------------------------------
## Transactions [/ebt/{state}/transactions]
### View Transaction History [POST]
View an EBT Card's Transaction History. Credentials must be passed into the method body.
+ Request (application/json)
+ Attributes (array[FieldValue], required)
Values necessary to login to the State account
+ Response 200 (application/json)
+ Attributes (array[Transaction])
---------------------------------
## Data Structures
### StateFeatures(object) - An Overview of supported features and requirements for a State
+ sign_in_requirements (array[Field], required) - Fields required in order to sign in
+ sign_up_requirements (array[Field], required) - Fields required in order to create an account
+ features (array[WebsiteFeature], required) - Features supported by the state
### WebsiteFeature (enum[string])
+ ACCOUNT_CREATION - The state supports the ability to creat an account programmatically.
+ BALANCE - The State supports the "/balance/" api and allows users to get their EBT Balance.
+ TRANSACTION - The State supports the "/transactions/" api and allows users to view their Transaction history.
### Field (object)
+ name: `user-id` (string, required) - The unique name of the field. Each field will have a different name.
+ type: `USERNAME` (string, required) - Information about what type of data this field is intended to capture.
+ description: `A unique user ID` (string, optional) - A short human-readable description of the field.
+ is_required: `true` (boolean, required) - Whether this field is required or optional.
+ requirements (StringRequirements, required) - Details any requirements on the value that this field accepts.
### StringRequirements (object)
+ min_length: `4` (number, required) - The value must have at least this many characters
+ max_length: `35` (number, required) - The value cannot have more than this many characters
+ character_requirements (CharacterRequirements, required) - Describes requirements on the characters
### CharacterRequirements (object)
+ requires_lower_case: `true` (boolean, required) - Whether the string requires at least 1 lower case letter
+ requires_upper_case: `false` (boolean, required) - Whether the string requires at least 1 upper case letter
+ requires_number: `true` (boolean, required) - Whether the string requries at least 1 number
+ requires_special_character: `false` (boolean, required) - Whether the string requires at least 1 special character. This is common with Password fields.
### FieldValue (object)
+ name: `user-id` (string, required) - The name of the field. This should be copied from the corresponding "Field" object.
+ value: `cordhernandez` (string, required) - The value of the field. The value should always be a String.
+ type: `USERNAME` (string, required) - Information about what type of data this field is intended to capture. This should be copied from the corresponding "Field" object.
### Balance (object)
+ cash_balance: `93.04` (number, required) - The amount of cash money left on the EBT Card
+ food_balance: `31.30` (number, required) - The amount of food money left on the EBT Card
### Transaction (object)
+ timestamp (object, required) - The timestamp of the transaction
+ seconds: 1474869861 (number, required) - Number of seconds since epoch
+ nanos: `0` (number, optional) - The nanoseconds component
+ amount: `490.20` (number, required) - The amount of the Transaction
+ address: `1000 Santa Monica Blvd Santa Monica, CA` - The address where the Transaction was recorded
+ retailer: `VONS` - The name of the retail company
+ transaction_type: `CHARGE` (enum[string], required)
+ CHARGE
+ DEPOSIT
+ type: `FOOD` (string, required) - Additional information about the type of the transaction.
### OperationResult (object)
+ success: `true` (boolean, required) - Whether the operation succeeded or not
+ message: `The operation was a success` (string, optional) - A detailed message in case the operation failed