arazzo: 1.0.1 info: title: Efí Bill Payment by Bar Code summary: Decode a boleto bar code, pay it from the account, and reconcile the status. description: >- The Efí Pay Pagamentos flow for paying a boleto or concessionária bill from the account balance. The workflow authenticates, decodes the bar code (linha digitável) to recover the amount and due date, submits the payment request for that bar code, and reads the resulting payment back by its id to reconcile the settlement status. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: efiPagamentosApi url: ../openapi/efi-pagamentos-openapi.yml type: openapi workflows: - workflowId: bill-payment summary: Decode a bar code, pay the bill, and reconcile the payment status. description: >- Authenticates, decodes the supplied bar code, requests payment for it, and reads the payment back to confirm its settlement status. inputs: type: object required: - clientId - clientSecret - codBarras properties: clientId: type: string description: The OAuth2 client_id issued for the Efí Pay account. clientSecret: type: string description: The OAuth2 client_secret issued for the Efí Pay account. codBarras: type: string description: The boleto/concessionária bar code (linha digitável) to pay. paymentDate: type: string description: The desired debit date for the payment (dataPagamento), YYYY-MM-DD. steps: - stepId: authenticate description: >- Exchange the client_id and client_secret for an OAuth2 access token using the client_credentials grant required by the Pagamentos API. operationId: pagamentosAuthorize requestBody: contentType: application/json payload: grant_type: client_credentials successCriteria: - condition: $statusCode == 200 outputs: accessToken: $response.body#/access_token - stepId: decodeBarCode description: >- Decode the bar code to recover the bill amount and due date before committing to the payment. operationId: payDetailBarCode parameters: - name: Authorization in: header value: Bearer $steps.authenticate.outputs.accessToken - name: codBarras in: path value: $inputs.codBarras successCriteria: - condition: $statusCode == 200 outputs: value: $response.body#/value dueDate: $response.body#/dueDate - stepId: requestPayment description: >- Submit the payment request for the decoded bar code with the desired debit date. The server returns a payment id. operationId: payRequestBarCode parameters: - name: Authorization in: header value: Bearer $steps.authenticate.outputs.accessToken - name: codBarras in: path value: $inputs.codBarras requestBody: contentType: application/json payload: dataPagamento: $inputs.paymentDate successCriteria: - condition: $statusCode == 201 outputs: idPagamento: $response.body#/idPagamento status: $response.body#/status - stepId: reconcilePayment description: >- Read the payment back by its id to reconcile the final settlement status. operationId: payDetailPayment parameters: - name: Authorization in: header value: Bearer $steps.authenticate.outputs.accessToken - name: idPagamento in: path value: $steps.requestPayment.outputs.idPagamento successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/status value: $response.body#/valor outputs: idPagamento: $steps.requestPayment.outputs.idPagamento status: $steps.reconcilePayment.outputs.status value: $steps.reconcilePayment.outputs.value