# Get invoice
Get and validate invoice given access key in path. The access key is created via the [Register receivable](create-receivable) endpoint.
Pismo works with a third-party (B3) who registers the invoices.
This endpoint generates 4 possible events:
1. Request to third-party fails - invoice_validation_request_failure-1
2. Request to third-party succeeds - invoice_validation_request_success-1
3. Third-party validation fails- invoice_validation_failure-1
4. Third-party validation succeeds - invoice_validation_success-1
# OpenAPI definition
```json
{
"openapi": "3.1.0",
"info": {
"title": "Banking - Credit receivables",
"contact": {
"email": "support@pismo.com.br",
"name": "API Support",
"url": "https://developers.pismo.io/support/"
},
"description": "Endpoints to handle contract operations",
"license": {
"name": "Copyright Pismo",
"url": "https://developers.pismo.io/licenses/"
},
"termsOfService": "https://developers.pismo.io/terms/",
"version": "v1"
},
"servers": [
{
"url": "https://api-sandbox.pismolabs.io/credit-rights-receivable",
"description": "Production server"
}
],
"tags": [
{
"name": "Invoices",
"description": "Endpoints to create and manage invoices"
}
],
"security": [
{
"bearerAuth": []
}
],
"components": {
"parameters": {
"AccessKeyPath": {
"in": "path",
"name": "access_key",
"description": "Client-generated identifier. Must be 44 characters. Created via the [Register receivable](https://developers.pismo.io/pismo-docs/reference/create-receivable) endpoint.",
"required": true,
"schema": {
"type": "string",
"minLength": 44,
"maxLength": 44
}
}
},
"schemas": {
"AccessKey": {
"type": "string",
"description": "Client-generated identifier. This field is used for the [Get invoice](https://developers.pismo.io/pismo-docs/reference/findbyaccesskey) endpoint.",
"minLength": 1,
"maxLength": 44,
"example": "KAB6J8903CNMH01892749JKSNOAXMCA7199382ABCERL"
},
"CorrelationID": {
"type": "string",
"description": "Correlation ID (CID). This field is used to link related API requests and events. The CID can help the Pismo engineering team track everything related to a call. If one isn't passed, one is automatically generated. You can find the CID in a response header. \n",
"example": "88474990237-94940"
},
"Errors": {
"type": "array",
"items": {
"type": "string"
}
},
"GetInvoiceResponse": {
"type": "object",
"properties": {
"access_key": {
"$ref": "#/components/schemas/AccessKey"
},
"message": {
"$ref": "#/components/schemas/Message"
}
}
},
"GlobalErrorResponse": {
"type": "object",
"properties": {
"correlationId": {
"$ref": "#/components/schemas/CorrelationID"
},
"errors": {
"$ref": "#/components/schemas/Errors"
}
}
},
"Message": {
"type": "string",
"description": "Message",
"maxLength": 500,
"example": "Credit rights update request is being processed"
}
},
"responses": {
"400BadRequest": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
},
"401Unauthorized": {
"description": "Missing or invalid access token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
},
"500InternalServerError": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GlobalErrorResponse"
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"bearerFormat": "JWT",
"scheme": "bearer",
"type": "http"
}
}
},
"paths": {
"/v1/invoices/{access_key}": {
"get": {
"summary": "Get invoice",
"description": "Get and validate invoice given access key in path. The access key is created via the [Register receivable](create-receivable) endpoint.\n\nPismo works with a third-party (B3) who registers the invoices.\n\nThis endpoint generates 4 possible events:\n\n1. Request to third-party fails - invoice_validation_request_failure-1\n2. Request to third-party succeeds - invoice_validation_request_success-1\n3. Third-party validation fails- invoice_validation_failure-1\n4. Third-party validation succeeds - invoice_validation_success-1\n",
"operationId": "findByAccessKey",
"tags": [
"Invoices"
],
"parameters": [
{
"$ref": "#/components/parameters/AccessKeyPath"
}
],
"responses": {
"202": {
"description": "Success message is sent to the client while an invoice validation is processed asynchronously,\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetInvoiceResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/400BadRequest"
},
"401": {
"$ref": "#/components/responses/401Unauthorized"
},
"500": {
"$ref": "#/components/responses/500InternalServerError"
}
}
}
}
}
}
```