-
Notifications
You must be signed in to change notification settings - Fork 0
/
apitier-validate-vat-api-1.0.0.yaml
154 lines (152 loc) · 4.51 KB
/
apitier-validate-vat-api-1.0.0.yaml
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
openapi: 3.0.1
info:
title: Validate VAT Number API
description: These are API Tier API's to expedite your development, enrich the user experience.
contact:
email: hello@apitier.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
servers:
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/apitier/test1/1.0.0
- url: https://vat.apitier.com/v1
tags:
- name: Validate VAT Number API
description: APIs to help you build day-to-day VAT validation.
paths:
/validate:
get:
tags:
- Validate VAT Number API
summary: Validate VAT
description: |
Validates Given VAT Number
parameters:
- name: vat_number
in: query
description: VAT Number for validation
required: true
schema:
type: string
examples:
single:
value: IE6388047V
summary: VAT number
- name: x-api-key
in: query
description: Unique API key generated to access API.
required: true
schema:
type: string
examples:
single:
value: api_key
summary: API Key value
responses:
200:
description: addresses results for given postcode
content:
application/json:
schema:
$ref: '#/components/schemas/ValidateVATItem'
examples:
Single: # Example 1
value:
status: 200
message: Success
result:
vatNumber: IE6388047V
isValid: true
company:
name: GOOGLE IRELAND LIMITED
address: GOOGLE IRLAND LTD , M COLLINS, GORDON HOUSE , BARROW STREET, DUBLIN 4 , IRLAND
country:
code: IE
name: Ireland
InvalidVAT: # Example 2
value:
status: 200
message: Success
result:
vatNumber: '556656688001111'
message: Validation Failed
reason: The provided CountryCode is invalid or the VAT number is empty
400:
description: Bad Request - Request failed due to invalid syntax
content: {}
401:
description: Unauthorized - Client must authenticate itself to get the requested
response
content: {}
402:
description: Payment Required - Request Failed as request credit not avaialble.
content: {}
403:
description: Forbidden - Provided API key is not known to the server.
content: {}
404:
description: Resource Not Found - The server can not find the requested
resource.
content: {}
429:
description: Too Many Requests - The user has sent too many requests in
a given amount of time ("rate limiting").
content: {}
500:
description: Internal Server Error - The server has error to handle request.
content: {}
components:
schemas:
ValidateVATItem:
type: object
properties:
status:
type: integer
format: int32
example: 200
message:
type: string
example: Success
result:
type: object
properties:
vatNumber:
type: string
example: IE6388047V
isValid:
type: boolean
example: true
country:
$ref: '#/components/schemas/country'
company:
$ref: '#/components/schemas/company'
country:
type: object
properties:
name:
type: string
example: Sweden
code:
type: string
example: SE
company:
type: object
properties:
name:
type: string
example: 'GOOGLE IRELAND LIMITED'
address:
type: string
example: 'GOOGLE IRLAND LTD , M COLLINS, GORDON HOUSE , BARROW STREET, DUBLIN 4 , IRLAND'
ErrorResponse:
type: object
properties:
status:
type: integer
format: int32
example: 400
message:
type: string
example: Error Message