> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Finance Purchase Order

> This endpoint finances an existing purchase order.

### Body

<ParamField body="purchase_order_id" type="string">
  The ID provided in the data tab may be used to identify the purchase order
</ParamField>

### Response

<ResponseField name="id" type="string">
  The ID provided in the data tab may be used to identify the purchase order
</ResponseField>

<ResponseField name="object" type="string">
  The object type
</ResponseField>

<ResponseField name="success" type="number">
  Indicates whether the call was successful. 1 if successful, 0 if not.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/purchase_order/:id/finance' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
  		"id": "po_1NXWPnCo6bFb1KQto6C8OWvE"
  }'
  ```

  ```graphQL GraphQL theme={null}
  mutation financePurchaseOrder ($id: String!) {
      cance_purchaseorder(where: {id: {_eq: $id}}) {
            affected_rows
          }
        }
  ```

  ```js Node.js theme={null}
  const purchaseorders = await stateset.purchaseorders.finance({
    'po_1NXWPnCo6bFb1KQto6C8OWvE'
  });
  ```

  ```py Python theme={null}
  purchaseorders = stateset.purchaseorders.finance({
    'po_1NXWPnCo6bFb1KQto6C8OWvE'
  })
  ```

  ```go Go theme={null}
  purchaseorders, err := stateset.purchaseorders.finance.(
    "po_1NXWPnCo6bFb1KQto6C8OWvE"
  )
  ```

  ```java Java theme={null}
  Return purchaseorders = stateset.purchaseorders.finance(
    "po_1NXWPnCo6bFb1KQto6C8OWvE"
  );
  ```

  ```js Javascript theme={null}
  const purchaseorders = await stateset.purchaseorders.finance({
    'po_1NXWPnCo6bFb1KQto6C8OWvE'
  });
  ```

  ```ruby Ruby theme={null}
  purchaseorders = Stateset::PurchaseOrder.finance({
    'po_1NXWPnCo6bFb1KQto6C8OWvE'
  })
  ```

  ```php PHP theme={null}
  $purchaseorders = $stateset->purchaseorders->finance(
    'po_1NXWPnCo6bFb1KQto6C8OWvE'
  );
  ```

  ```http HTTP theme={null}
  POST /v1/purchaseorder/:id/finance HTTP/1.1
  Host: api.stateset.com 
  Content-Type: application/json
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "po_1NXWPnCo6bFb1KQto6C8OWvE",
    "object": "purchaseorder",
    "financed": true
  }

  ```
</ResponseExample>
