-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapiary.apib
More file actions
259 lines (205 loc) · 8.46 KB
/
apiary.apib
File metadata and controls
259 lines (205 loc) · 8.46 KB
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
FORMAT: 1A
HOST: https://cs-api.bgchtest.info/api1
# NACHo
A simple API offered by ConnectedHomes Customer Systems for NACHo
##Allowed HTTPs requests
- `GET` Retrieves a resource or list of resources
- `POST` Creates a resource
##Typical Server Responses
- `200 OK` The request was successful.
- `403 Forbidden` The Request was leagal , but Missing parameters
- `404 Not Found` Resource was not Found.
- `415 Unsupported Media Type` The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
# Group NACHo Customer Systems API For Staging DB
## /nacho/order/{id}
Get the order Details based on the order id
+ Parameters
+ id (required, string, `21`) ... Alphanumeric `id` of the Order
### GET
The following table lists some possible outcomes that may occur as a result of this call:
| Http Status Code | Description | Scenario | Resolution |
|:----------------:|:------------------------------------:|:--------:|:----------:|
| 200 | Order returned | | |
| 403 | The Request was legal | Processing error | Refer to error message in response |
| 404 | Order not found
| 415 | Unsupported Media Type| Processing error | Refer to error message in response |
+ Request
+ Headers
Authorization:AWS4-HMAC-SHA256 (AWS Signature)
X-api-Key : ********
X-Amz-Date :20160719T101907Z
Host :cs-api.bgchtest.info
+ Response 200 (application/json)
+ Body
{
"first_name": "TestFirstName",
"last_name": "TestLastName1",
"address1": "22",
"address2": "london bridge",
"city": "london",
"state": "berk",
"postal_code": "23423",
"country": "UK",
"email": "abc@gmail.com",
"phone": "123123",
"is_commercial": true,
"is_pobox": false,
"order_number": "21",
"order_date": "12-10-2016",
"sku": "T23424",
"quantity": 12,
"commerce_name": "testcommercename1",
"external_id": "ext123",
"warehouse_id": "W123",
"service_level_code": 12344,
"sw_order_number": "ORD123",
"company": "testcompany1",
"tracking": null,
"carrier": null,
"url": null,
"summary": null,
"summary_date": null,
"created_date": null,
"processed_date": null,
"deliverd_date": null,
"submitted_date": null,
"completed_date": null,
"expected_date": null,
"locale": null,
"language_preference": null,
"status": null,
"mobile": null,
"title": null
}
+ Response 403 (application/json)
Returned if there was an exception while processing the request.
+ Body
{ "message": "Forbidden"}
+ Response 404 (application/json)
Returned if there are no order for the externalid
+ Body
{
"status": 404,
"errors": {
"description": "contract not found"
}
}
+ Response 415 (application/json)
Returned if there was an exception while processing the request.
+ Body
{
"message": "Unsupported Media Type"
}
## /nacho/order/
Post the Orders into Staging DB
### POST
The following table lists some possible outcomes that may occur as a result of this call:
| Http Status Code | Description | Scenario | Resolution |
|:----------------:|:------------------------------------:|:--------:|:----------:|
| 200 | Order Created | | |
| 400 | Bad Request | Processing error | Refer to error message in response |
| 403 | The Request was legal | Processing error | Refer to error message in response |
| 415 | Unsupported Media Type| Processing error | Refer to error message in response |
+ Request (application/json)
+ Headers
Authorization:AWS4-HMAC-SHA256 (AWS Signature)
X-api-Key : ********
X-Amz-Date :20160719T101907Z
Host :cs-api.bgchtest.info
+ Body
{
"orders":[
{
"first_name":"testfirstname",
"last_name":"testlastname",
"address1":"22",
"address2":"chatham court",
"city":"slough",
"state":"berk",
"postal_code":"sl11qj",
"country":"uk",
"email":"test@gmail.com",
"phone":"124345",
"is_commercial":true,
"is_pobox":false,
"order_number":"235323",
"order_date":"12-10-1986",
"sku":"testsku",
"quantity":13,
"commerce_name":"testcommerce",
"external_id":"externl1",
"warehouse_id":"testwarehouse",
"service_level_code":"testcode",
"company":"testcompany"
}
]
}
+ Response 200 (application/json)
+ Body
{
"orders": [
{
"first_name": "TestfirstName1",
"last_name": "TestLastName1",
"address1": "22",
"address2": "london bridge",
"city": "london",
"state": "berk",
"country": "UK",
"postal_code": "23423",
"email": "abc@gmail.com",
"phone": "123123",
"is_commercial": true,
"is_pobox": false,
"sw_order_number": "ORD123",
"order_date": "12-10-2016",
"sku": "T23424",
"quantity": 12,
"commerce_name": "testcommercename1",
"external_id": "ext123",
"warehouse_id": "W123",
"service_level_code": 12344,
"company": "testcompany1"
},
{
"first_name": "TestfirstName2",
"last_name": "TestLastName2",
"address1": "23",
"address2": "bridge",
"city": "london",
"state": "berkshire",
"country": "UK",
"postal_code": "324234",
"email": "abc1@gmail.com",
"phone": "43434",
"is_commercial": false,
"is_pobox": true,
"sw_order_number": "ORD321",
"order_date": "10-10-2016",
"sku": "T234",
"quantity": 10,
"commerce_name": "testcommercename2",
"external_id": "ext321",
"warehouse_id": "W321",
"service_level_code": 23435,
"company": "testcompany2"
}
]
}
+ Response 400 (application/json)
Returned if there was an expection while processing the request body
+ Body
{
"message": "Exception",
"errorMessage": "invalid input syntax for integer: \"E12344\""
}
+ Response 403 (application/json)
Returned if there was an exception while processing the request.
+ Body
{ "message": "Forbidden"}
+ Response 415 (application/json)
Returned if there was an exception while processing the request.
+ Body
{
"message": "Unsupported Media Type"
}