# Utility

## Check utility

> Check a utility barcode or line code

```json
{"openapi":"3.0.0","info":{"title":"Trio API","version":"0.1.0"},"servers":[{"url":"https://api.sandbox.trio.com.br","variables":{}},{"url":"https://api.qa.trio.com.br","variables":{}},{"url":"https://api.trio.com.br","variables":{}}],"security":[{},{"basic":["Base64encode(<client_id>:<client_secret>)"]}],"components":{"securitySchemes":{},"schemas":{"401":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"401","type":"object"},"500":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"500","type":"object"},"Check_utility_request_params":{"description":"Check utility request params","properties":{"code":{"description":"Utility barcode or digitable_line","type":"string"}},"required":["code"],"title":"Check_utility_request_params","type":"object"},"Create_Check_Utility_Response":{"description":"Response schema for a single utility generation","properties":{"data":{"properties":{"amount":{"properties":{"amount":{"description":"Amount in the specified currency in cents","type":"number"},"currency":{"description":"Currency code","type":"string"}},"type":"object"},"barcode":{"description":"Boleto barcode","type":"string"},"company_id":{"$ref":"#/components/schemas/UUID"},"digitable_line":{"description":"Boleto digitable line","type":"string"},"id":{"$ref":"#/components/schemas/UUID"},"inserted_at":{"description":"Inserted at","type":"string"},"name":{"description":"Name of the boleto beneficiary","type":"string"},"org_id":{"$ref":"#/components/schemas/UUID"},"payer_name":{"description":"Payer name","type":"string"},"payer_tax_number":{"description":"Payer tax number","type":"string"},"tax_number":{"description":"Tax number of the boleto beneficiary","type":"string"},"timestamp":{"description":"Timestamp of the check","type":"string"},"type":{"description":"Boleto type","type":"string"},"updated_at":{"description":"Updated at","type":"string"}},"type":"object"}},"title":"Create_Check_Utility_Response","type":"object"},"UUID":{"description":"Unique identifier","format":"uuid","title":"UUID","type":"string"},"JsonErrorResponse":{"properties":{"errors":{"items":{"properties":{"detail":{"type":"string"},"source":{"properties":{"pointer":{"type":"string"}},"required":["pointer"],"type":"object"},"title":{"type":"string"}},"required":["title","source","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"JsonErrorResponse","type":"object"}}},"paths":{"/banking/cashout/utility/check":{"post":{"callbacks":{},"description":"Check a utility barcode or line code","operationId":"TrioFoundationWeb.Banking.Cashout.Utility.UtilityController.check","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Check_utility_request_params"}}},"description":"Check utility payload","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Create_Check_Utility_Response"}}},"description":"Created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/401"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/500"}}},"description":"Internal server error"}},"summary":"Check utility","tags":["utility"]}}}}
```

## Pay utility

> Generate a pay utility

```json
{"openapi":"3.0.0","info":{"title":"Trio API","version":"0.1.0"},"servers":[{"url":"https://api.sandbox.trio.com.br","variables":{}},{"url":"https://api.qa.trio.com.br","variables":{}},{"url":"https://api.trio.com.br","variables":{}}],"security":[{},{"basic":["Base64encode(<client_id>:<client_secret>)"]}],"components":{"securitySchemes":{},"schemas":{"401":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"401","type":"object"},"500":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"500","type":"object"},"Generate_Utility_V1":{"description":"Body params to generate a utility V1 payment","properties":{"amount":{"description":"Amount of the utility in cents","type":"integer"},"check_id":{"$ref":"#/components/schemas/UUID"},"description":{"description":"Description for the utility","type":"string"},"external_id":{"description":"External ID for reference","type":"string"},"virtual_account_id":{"$ref":"#/components/schemas/UUID"}},"required":["amount","check_id","virtual_account_id"],"title":"Generate_Utility_V1","type":"object"},"UUID":{"description":"Unique identifier","format":"uuid","title":"UUID","type":"string"},"Generate_V1_Boleto_Response":{"description":"Response schema for a single boleto V1 generation","properties":{"data":{"properties":{"payment_document_id":{"$ref":"#/components/schemas/UUID"}},"type":"object"}},"title":"Generate_V1_Boleto_Response","type":"object"},"JsonErrorResponse":{"properties":{"errors":{"items":{"properties":{"detail":{"type":"string"},"source":{"properties":{"pointer":{"type":"string"}},"required":["pointer"],"type":"object"},"title":{"type":"string"}},"required":["title","source","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"JsonErrorResponse","type":"object"}}},"paths":{"/banking/cashout/utility/pay":{"post":{"callbacks":{},"description":"Generate a pay utility","operationId":"TrioFoundationWeb.Banking.Cashout.Utility.UtilityController.generate_v1","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generate_Utility_V1"}}},"description":"Utility payload","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generate_V1_Boleto_Response"}}},"description":"Created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/401"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/500"}}},"description":"Internal server error"}},"summary":"Pay utility","tags":["utility"]}}}}
```

## Pay utility v2

> Generate a pay utility v2

```json
{"openapi":"3.0.0","info":{"title":"Trio API","version":"0.1.0"},"servers":[{"url":"https://api.sandbox.trio.com.br","variables":{}},{"url":"https://api.qa.trio.com.br","variables":{}},{"url":"https://api.trio.com.br","variables":{}}],"security":[{},{"basic":["Base64encode(<client_id>:<client_secret>)"]}],"components":{"securitySchemes":{},"schemas":{"401":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"401","type":"object"},"500":{"properties":{"error":{"properties":{"error_code":{"description":"Error code","type":"string"},"error_message":{"description":"Error message","type":"string"}},"type":"object"}},"title":"500","type":"object"},"Generate_V2_Utility_create_params":{"description":"Body params to generate a utility V2","properties":{"amount":{"description":"Amount of the utility in cents","type":"integer"},"code":{"description":"Barcode or digitable_line of the utility","type":"string"},"description":{"description":"Description of the utility","type":"string"},"external_id":{"description":"External ID of the utility for reference","type":"string"},"virtual_account_id":{"$ref":"#/components/schemas/UUID"}},"required":["amount","virtual_account_id","code"],"title":"Generate_V2_Utility_create_params","type":"object"},"UUID":{"description":"Unique identifier","format":"uuid","title":"UUID","type":"string"},"Generate_V2_Utility_Response":{"description":"Response schema for a single utility V2 generation","properties":{"data":{"properties":{"payment_document_id":{"$ref":"#/components/schemas/UUID"}},"type":"object"}},"title":"Generate_V2_Utility_Response","type":"object"},"JsonErrorResponse":{"properties":{"errors":{"items":{"properties":{"detail":{"type":"string"},"source":{"properties":{"pointer":{"type":"string"}},"required":["pointer"],"type":"object"},"title":{"type":"string"}},"required":["title","source","detail"],"type":"object"},"type":"array"}},"required":["errors"],"title":"JsonErrorResponse","type":"object"}}},"paths":{"/banking/cashout/utility/pay/v2":{"post":{"callbacks":{},"description":"Generate a pay utility v2","operationId":"TrioFoundationWeb.Banking.Cashout.Utility.UtilityController.generate_v2","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generate_V2_Utility_create_params"}}},"description":"Utility V2 payload","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generate_V2_Utility_Response"}}},"description":"Created"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/401"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonErrorResponse"}}},"description":"Unprocessable Entity"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/500"}}},"description":"Internal server error"}},"summary":"Pay utility v2","tags":["utility"]}}}}
```
