# Approval Invoice (Pay Out Only)

### Description:

This endpoint is tailored to approve or cancel an invoice. It offers a streamlined process to validate transactions and ensure that all financial operations align with the intended actions.<br>

**Mode:**

`PUT`

#### Node:

```bash
/third-party-service/invoice/{id}

Note** Replace {id} with the appropriate invoice identifier.
```

<mark style="color:orange;">`PUT`</mark> `/third-party-service/invoice/{id}`

Approval or Cancel Invoice

#### Headers

| Name                                         | Type   | Description                            |
| -------------------------------------------- | ------ | -------------------------------------- |
| API-Key<mark style="color:red;">\*</mark>    | String | Your API key for authentication.       |
| API-Secret<mark style="color:red;">\*</mark> | String | Your API secret for enhanced security. |

#### Request Body

| Name                                       | Type       | Description                                            |
| ------------------------------------------ | ---------- | ------------------------------------------------------ |
| "status"<mark style="color:red;">\*</mark> | "approved" | This can also be "cancel" based on the desired action. |

{% tabs %}
{% tab title="202: Accepted " %}

```json
// 
{
    "statusCode": 202,
    "data": true,
    "message": "update Invoice"
}
```

{% endtab %}
{% endtabs %}

#### Considerations:

Ensure that the appropriate `status` value ("approved" or "cancel") is set based on the intended operation. The `invoicehash` is a security measure, a hash or a secret token associated with the invoice. Ensure it's provided correctly to authenticate and validate the operation.

If transaction is a "Pay-out" invoice is approved by customer and sent via webhook.&#x20;

If transaction is a "Pay-in" invoice is approved by **alfred.**&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alfred.gitbook.io/alfred-integration-docs/penny-api-general-integration/penny-api-operations/approval-invoice-pay-out-only.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
