-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yaml
167 lines (166 loc) · 4.7 KB
/
openapi.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
155
156
157
158
159
160
161
162
163
164
165
166
167
openapi: 3.0.0
servers:
- url: 'https://api-seguridad.sunat.gob.pe/v1'
- url: 'https://api.sunat.gob.pe/v1'
info:
description: "CONSULTA INTEGRADA DE COMPROBANTE DE PAGO."
version: "1.0.0"
title: "SUNAT API"
contact:
email: "[email protected]"
tags:
- name: "auth"
description: "Credenciales"
- name: "consulta"
description: "Consulta integrada"
paths:
'/clientesextranet/{client_id}/oauth2/token/':
post:
tags:
- "auth"
summary: "Generar un nuevo token"
description: ""
operationId: "getToken"
requestBody:
content:
"application/x-www-form-urlencoded":
schema:
type: object
required:
- grant_type
- scope
- client_id
- client_secret
properties:
grant_type:
type: "string"
default: "client_credentials"
scope:
type: "string"
default: "https://api.sunat.gob.pe/v1/contribuyente/contribuyentes"
client_id:
description: "client_id generado en menú sol"
type: "string"
client_secret:
description: "client_secret generado en menú sol"
type: "string"
parameters:
- name: "client_id"
in: "path"
description: "El client_id generado en menú sol"
required: true
schema:
type: "string"
responses:
"200":
description: "operacion exitosa"
content:
"application/json":
schema:
$ref: "#/components/schemas/ApiToken"
'/contribuyente/contribuyentes/{ruc}/validarcomprobante':
post:
tags:
- "consulta"
summary: "Consulta de comprobante"
description: ""
operationId: "consultarCpe"
parameters:
- name: "ruc"
in: "path"
description: "RUC de quién realiza la consulta"
required: true
schema:
type: "string"
requestBody:
content:
"application/json":
schema:
$ref: "#/components/schemas/CpeFilter"
responses:
"200":
description: "operacion exitosa"
content:
"application/json":
schema:
$ref: "#/components/schemas/CpeResponse"
security:
- sunat_auth: []
externalDocs:
description: "MANUAL DE CONSULTA INTEGRADA DE COMPROBANTE DE PAGO POR SERVICIO WEB"
url: "https://orientacion.sunat.gob.pe/images/imagenes/contenido/comprobantes/Manual-de-Consulta-Integrada-de-Comprobante-de-Pago-por-ServicioWEB.pdf"
components:
schemas:
CpeFilter:
type: "object"
required:
- numRuc
- codComp
- numeroSerie
- numero
- fechaEmision
properties:
numRuc:
type: "string"
description: "Número de RUC emisor comprobante"
codComp:
type: "string"
description: "Código de tipo de comprobante"
numeroSerie:
type: "string"
description: "Número de serie del comprobante"
numero:
type: "string"
description: "Número del comprobante"
fechaEmision:
type: "string"
description: "Fecha de emisión del comprobante"
monto:
type: "string"
description: "Monto total del comprobante"
CpeStatus:
type: "object"
properties:
estadoCp:
type: "string"
description: "Estado del comprobante"
estadoRuc:
type: "string"
description: "Estado del contribuyente"
condDomiRuc:
type: "string"
description: "Condición Domiciliaria del Contribuyente"
observaciones:
type: "array"
items:
type: "string"
description: "Observaciones"
CpeResponse:
type: "object"
properties:
success:
type: "boolean"
description: "Estado consulta"
message:
type: "string"
description: "Mensaje del estado de la operación"
data:
$ref: "#/components/schemas/CpeStatus"
errorCode:
type: "string"
description: "Código de Error"
ApiToken:
type: "object"
properties:
access_token:
type: "string"
token_type:
type: "string"
expires_in:
type: "integer"
format: "int32"
description: "El tiempo de expiración en segundos. Concluído el tiempo podrá generar un nuevo token"
securitySchemes:
sunat_auth:
type: http
scheme: bearer