{
	"info": {
		"_postman_id": "2615bcc7-7e34-4c9c-a814-87f9b64ccef3",
		"name": "Gestión NIFs",
		"description": "La documentación completa de la API se encuentra [aquí](https://www.verifacti.com/nifs-docs).\n\nLa autenticación funciona con una Bearer token. En la pestaña de Authorization, simplemente pega tu API key.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "41939959"
	},
	"item": [
		{
			"name": "Listar NIFs",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/nifs?entorno=test&activos=true",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs"
					],
					"query": [
						{
							"key": "entorno",
							"value": "test"
						},
						{
							"key": "activos",
							"value": "true"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Añadir NIFs",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "[\n  {\n    \"nif\": \"B86361212\",\n    \"entorno\": \"test\",\n    \"nombre\": \"Mi empresa SL\",\n    \"direccion\": \"Calle Mayor 15\",\n    \"cp\": \"28040\",\n    \"webhooks\": [\"191efec4-d897-48f8-873f-baa038acbfd5\", \"865aa7c0-9151-470f-9cd6-0c54d046cd44\"],\n    \"poblacion\": \"Madrid\",\n    \"provincia\": \"Madrid\"\n  },\n  {\n    \"nif\": \"B01345212\",\n    \"entorno\": \"test\",\n    \"nombre\": \"Mi otra empresa SL\",\n    \"direccion\": \"Gran Vía 22\",\n    \"cp\": \"28040\",\n    \"webhooks\": [\"191efec4-d897-48f8-873f-baa038acbfd5\"],\n    \"poblacion\": \"Madrid\",\n    \"provincia\": \"Madrid\"\n  }\n]",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/nifs",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs"
					]
				}
			},
			"response": []
		},
		{
			"name": "Información de NIF",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/nifs/test/B75777847",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"test",
						"B75777847"
					]
				}
			},
			"response": []
		},
		{
			"name": "Modificar NIF",
			"request": {
				"method": "PUT",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"webhooks\": []\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/nifs/test/B75777847",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"test",
						"B75777847"
					]
				}
			},
			"response": []
		},
		{
			"name": "Desactivar NIF",
			"request": {
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/nifs/test/B86561412",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"test",
						"B86561412"
					]
				}
			},
			"response": []
		},
		{
			"name": "Activar NIF",
			"request": {
				"method": "PUT",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/nifs/activate/test/B86561412",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"activate",
						"test",
						"B86561412"
					]
				}
			},
			"response": []
		},
		{
			"name": "API key de un NIF",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/nifs/keys/test/B35114852",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"keys",
						"test",
						"B35114852"
					]
				}
			},
			"response": []
		},
		{
			"name": "Validar NIF en la AEAT",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"nif\": \"B86561412\",\n  \"nombre\": \"Mi empresa SL\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/nifs/validar",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"validar"
					]
				}
			},
			"response": []
		},
		{
			"name": "Validar IVA VIES",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"codigo_pais\": \"DE\",\n    \"iva\": \"DE812871812\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/nifs/validar/vies",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"nifs",
						"validar",
						"vies"
					]
				}
			},
			"response": []
		},
		{
			"name": "Listar webhooks",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/webhooks?entorno=test&activos=true",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks"
					],
					"query": [
						{
							"key": "entorno",
							"value": "test"
						},
						{
							"key": "activos",
							"value": "true"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Añadir webhook",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"url\": \"https://api.test.com/webhook\",\n    \"entorno\": \"test\",\n    \"nifs\": [\"B75777847\"]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/webhooks",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks"
					]
				}
			},
			"response": []
		},
		{
			"name": "Información de webhook",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/webhooks/1f46937d-84ac-4c5b-95f3-c0133a45b324",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks",
						"1f46937d-84ac-4c5b-95f3-c0133a45b324"
					]
				}
			},
			"response": []
		},
		{
			"name": "Modificar webhook",
			"request": {
				"method": "PUT",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"nifs\": [\"B75777847\", \"B86657641\"]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/webhooks/f112194e-c085-4ad1-8a52-059f1bc9f983",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks",
						"f112194e-c085-4ad1-8a52-059f1bc9f983"
					]
				}
			},
			"response": []
		},
		{
			"name": "Eliminar webhook",
			"request": {
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/webhooks/1f46937d-84ac-4c5b-95f3-c0133a45b324",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks",
						"1f46937d-84ac-4c5b-95f3-c0133a45b324"
					]
				}
			},
			"response": []
		},
		{
			"name": "Asociar webhook a NIF",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"url\": \"https://www.gegelewree2e.com\",\n    \"entorno\": \"test\",\n    \"nifs\": [\"B75777847\"]\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/webhooks/865aa7c0-9151-470f-9cd6-0c54d046cd44/nifs/B75777847",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks",
						"865aa7c0-9151-470f-9cd6-0c54d046cd44",
						"nifs",
						"B75777847"
					]
				}
			},
			"response": []
		},
		{
			"name": "Desasociar webhook a NIF",
			"request": {
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "{{apiUrl}}/webhooks/865aa7c0-9151-470f-9cd6-0c54d046cd44/nifs/B86361212",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"webhooks",
						"865aa7c0-9151-470f-9cd6-0c54d046cd44",
						"nifs",
						"B86361212"
					]
				}
			},
			"response": []
		},
		{
			"name": "Generar PDF de representación",
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"tipo_entidad\": \"juridica\",\n    \"nombre_entidad\": \"Bla bla\",\n    \"municipio_entidad\": \"edwed\",\n    \"calle_entidad\": \"fffff\",\n    \"numero_entidad\": \"12\",\n    \"nombre_representante\": \"erf\",\n    \"nif_representante\": \"16085922K\",\n    \"municipio_representante\": \"wewdwed\",\n    \"calle_representante\": \"ggggrtbg\",\n    \"numero_representante\": \"wwwww\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{apiUrl}}/representacion/generar/A29112869",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"representacion",
						"generar",
						"A29112869"
					]
				}
			},
			"response": []
		},
		{
			"name": "Enviar PDF firmado",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "file",
							"type": "file",
							"src": "/Users/diegoregalado/Downloads/modelo_representacion.pdf"
						}
					]
				},
				"url": {
					"raw": "{{apiUrl}}/representacion/enviar/A29112869",
					"host": [
						"{{apiUrl}}"
					],
					"path": [
						"representacion",
						"enviar",
						"A29112869"
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{nifsApiKey}}",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		}
	]
}