> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Approve bill

GET https://api-sandbox.payabli.com/api/Bill/approval/{idBill}/{approved}

Approve or disapprove a bill by ID.

Reference: https://docs.payabli.com/developers/api-reference/bill/approve-or-disapprove-a-bill

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi-oas
  version: 1.0.0
paths:
  /Bill/approval/{idBill}/{approved}:
    get:
      operationId: SetApprovedBill
      summary: Approve or disapprove a bill
      description: Approve or disapprove a bill by ID.
      tags:
        - Bill
      parameters:
        - name: approved
          in: path
          description: >-
            String representing the approved status. Accepted values: 'true' or
            'false'.
          required: true
          schema:
            type: string
        - name: idBill
          in: path
          description: >-
            Payabli ID for the bill. Get this ID by querying `/api/Query/bills/`
            for the entrypoint or the organization.
          required: true
          schema:
            type: integer
        - name: email
          in: query
          description: Email or username of user modifying approval status.
          required: false
          schema:
            type: string
        - name: requestToken
          in: header
          description: >
            Long-lived API token sent in the `requestToken` header. See [API
            token authentication](/developers/api-tokens).
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetApprovedBillResponse'
        '400':
          description: Bad request / invalid data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
        '503':
          description: Database connection error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
servers:
  - url: https://api-sandbox.payabli.com/api
    description: Sandbox
  - url: https://api.payabli.com/api
    description: Production
components:
  schemas:
    IsSuccess:
      type: boolean
      description: |
        Boolean indicating whether the operation was successful. A `true` value
        indicates success. A `false` value indicates failure.
      title: IsSuccess
    ResponseText:
      type: string
      description: |
        Response text for operation: 'Success' or 'Declined'.
      title: ResponseText
    SetApprovedBillResponse:
      type: object
      properties:
        isSuccess:
          $ref: '#/components/schemas/IsSuccess'
        responseText:
          $ref: '#/components/schemas/ResponseText'
        responseData:
          type: integer
          description: |
            If `isSuccess` = true, this contains the bill identifier. If
            `isSuccess` = false, this contains the reason for the error.
      required:
        - responseText
      description: Response from the Approve or disapprove a bill endpoint.
      title: SetApprovedBillResponse
    PayabliErrorBodyResponseData:
      type: object
      properties:
        explanation:
          type: string
          description: Human-readable explanation of what happened.
        todoAction:
          type: string
          description: Suggested resolution.
      description: Object with detailed error context.
      title: PayabliErrorBodyResponseData
    PayabliErrorBody:
      type: object
      properties:
        isSuccess:
          type: boolean
          description: Always `false` for error responses.
        responseCode:
          type: integer
          description: |
            Code for the response. Learn more in
            [API Response Codes](/developers/api-reference/api-responses).
        responseText:
          type: string
          description: Error text describing what went wrong.
        responseData:
          $ref: '#/components/schemas/PayabliErrorBodyResponseData'
          description: Object with detailed error context.
      required:
        - isSuccess
        - responseText
      description: |
        Shape returned by every Payabli API error response. The `responseData`
        object carries human-readable error context.
      title: PayabliErrorBody
  securitySchemes:
    APIKeyAuth:
      type: apiKey
      in: header
      name: requestToken
      description: >
        Long-lived API token sent in the `requestToken` header. See [API token
        authentication](/developers/api-tokens).
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        OAuth2 Bearer access token from the client-credentials flow. See [OAuth
        authentication](/developers/oauth-authentication).

```

## Examples



**Response**

```json
{
  "responseText": "Success",
  "isSuccess": true,
  "responseData": 6101
}
```

**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.bill.setApprovedBill("true", 285, {});
}
main();

```

```python
from payabli import payabli

client = payabli(
    api_key="YOUR_API_KEY_HERE",
)

client.bill.set_approved_bill(
    approved="true",
    id_bill=285,
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliPayabliApiOasClient;
import io.github.payabli.api.resources.bill.requests.SetApprovedBillRequest;

public class Example {
    public static void main(String[] args) {
        PayabliPayabliApiOasClient client = PayabliPayabliApiOasClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.bill().setApprovedBill(
            285,
            "true",
            SetApprovedBillRequest
                .builder()
                .build()
        );
    }
}
```

```ruby
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

client.bill.set_approved_bill(
  approved: "true",
  id_bill: 285
)

```

```csharp
using PayabliPayabliApiOas;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayabliPayabliApiOasClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Bill.SetApprovedBillAsync(
            285,
            "true",
            new SetApprovedBillRequest()
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithApiKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    request := &payabli.SetApprovedBillRequest{}
    client.Bill.SetApprovedBill(
        context.TODO(),
        285,
        "true",
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\Bill\Requests\SetApprovedBillRequest;

$client = new PayabliClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->bill->setApprovedBill(
    'true',
    285,
    new SetApprovedBillRequest([]),
);

```

```swift
import Foundation

let headers = ["requestToken": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Bill/approval/285/true")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```