Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions source/includes/_invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,61 @@ Parameter | Type | Required | Default | Notes
`metadata` | Object | False | Previous value |


## Finalize an Invoice

```python
import requests

response = requests.post(
'https://api.gigapay.se/v2/invoices/846271/close/',
headers={
'Authorization': 'Token cd7a4537a231356d404b553f465b6af2fa035821',
'Integration-ID': '79606358-97af-4196-b64c-5f719433d56b'
}
)
```

```shell
curl -X POST -H 'Authorization: Token cd7a4537a231356d404b553f465b6af2fa035821' -H 'Integration-ID: 79606358-97af-4196-b64c-5f719433d56b' https://api.gigapay.se/v2/invoices/846271/close/
```

```javascript
fetch("https://api.gigapay.se/v2/invoices/846271/close/", {
method: "POST",
headers: {
"Authorization": "Token cd7a4537a231356d404b553f465b6af2fa035821",
"Integration-Id": "79606358-97af-4196-b64c-5f719433d56b"
}
})
```

> The above command returns an empty response.


Invoices are initially created in an open state (pro-forma) and are not immediately finalized. This allows users to review and edit their invoices before submission.

Once the invoice is ready, it can be finalized using this endpoint. Finalization has two important effects:
1. The payouts become visible to the employees
2. The invoice is sent to the email address configured in the integration settings

### HTTP Request

`POST https://api.gigapay.se/v2/invoices/:id/close/`

### Headers

Parameter | Required | Description
--------- | ------- | -----------
`Authorization` | True | Your Authorization Token.
`Integration-ID` | True | Integration id.


### URL Parameters

Parameter | Required | Description
--------- | ------- | -----------
`id` | True | Unique identifier for the object.



## Delete an Invoice
Expand Down Expand Up @@ -328,3 +383,4 @@ Parameter | Required | Description
Parameter | Required | Description
--------- | ------- | -----------
`id` | True | Unique identifier for the object.