> For the complete documentation index, see [llms.txt](https://docs.abby.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abby.fr/reference-de-lapi/livre-des-recettes.md).

# Livre des recettes

Enregistrez une recette encaissée hors facture Abby dans le livre des recettes.

Le livre des recettes recense les sommes encaissées par votre société. L'API permet d'y ajouter une recette saisie à la main, c'est-à-dire un encaissement qui ne provient pas d'une facture émise dans Abby, et de la supprimer.

{% hint style="warning" %}
L'API publique n'expose aucune route de lecture ni de liste pour le livre des recettes. La réponse à la création renvoie l'identifiant de l'écriture dans le champ `_id` : **conservez-le**, car c'est le seul moyen de supprimer l'écriture ensuite.
{% endhint %}

Ces routes n'ont pas de préfixe de version : elles s'appellent `/incomeBook`.

## Préparer une recette

Champs obligatoires :

* `client` : le client, sous forme de texte (la spec ne précise pas davantage) ;
* `priceWithoutTax` : le montant hors taxes ;
* `priceTotalTax` : le montant toutes taxes comprises ;
* `productType` : la nature de la recette, un nombre de 1 à 5 selon l'énumération `LegacyProductType` : `1` vente de marchandises, `2` prestation de services, `3` prestation commerciale ou artisanale, `4` vente de produits fabriqués, `5` débours.

Champs facultatifs :

* `paidAt` : date de l'encaissement, au format date-heure ISO 8601 ;
* `paymentMethodUsed` : un objet `{ "value": <nombre>, "other": "<texte>" }`. `value` suit l'énumération des modes de paiement de 1 à 9 : `1` virement, `2` prélèvement, `3` carte bancaire, `4` chèque, `5` chèque emploi service universel, `6` espèces, `7` PayPal, `8` autre, `9` Stripe. Le champ `other` précise le mode lorsque `value` vaut `8`. La valeur par défaut déclarée est `{ "value": 1 }` ;
* `vatAmount` et `vatId` : le montant de TVA et l'identifiant du taux (voir la table des `vatId` dans [Livre des achats](https://docs.abby.fr/reference-de-lapi/livre-des-achats.md)) ;
* `reference` : votre référence ;
* `isSap` : `true` pour une recette de services à la personne ;
* `isTaxIncluded` : `true` si le prix saisi inclut la TVA ;
* `file` : un objet `{ "id": "...", "url": "...", "relativeUrl": "..." }` qui désigne un justificatif déjà déposé.

`priceWithoutTax` et `priceTotalTax` sont en centimes. Voir [Conventions](https://docs.abby.fr/concepts/conventions.md).

## Ajouter une recette

La réponse est l'écriture créée. Selon l'offre de la société, une recette qui porte de la TVA peut être refusée avec une erreur 402.

```bash
curl -X POST https://api.abby.fr/incomeBook \
  -H "Authorization: Bearer $ABBY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "client": "Martine Dupont",
    "priceWithoutTax": 10000,
    "priceTotalTax": 12000,
    "productType": 2,
    "paidAt": "2026-11-18T00:00:00.000Z",
    "paymentMethodUsed": { "value": 1 },
    "vatId": 1,
    "vatAmount": 2000,
    "reference": "ENC-2026-0007"
  }'
```

## POST /incomeBook

>

```json
{"openapi":"3.0.0","info":{"title":"Abby Public API","version":"1.130.0+66756885474b"},"servers":[{"url":"https://api.abby.fr","description":"Production server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key authentication. Pass your API key as a Bearer token."}},"schemas":{"CreateIncomeBookItemDto":{"type":"object","properties":{"paidAt":{"format":"date-time","type":"string","default":"2022-03-01"},"paymentMethodUsed":{"type":"object","default":{"value":1}},"vatAmount":{"type":"number"},"vatId":{"type":"number"},"client":{"type":"string"},"priceWithoutTax":{"type":"number"},"priceTotalTax":{"type":"number"},"reference":{"type":"string"},"productType":{"allOf":[{"$ref":"#/components/schemas/LegacyProductType"}]},"isSap":{"type":"boolean"},"isTaxIncluded":{"type":"boolean"},"file":{"type":"object"}},"required":["client","priceWithoutTax","priceTotalTax","productType"]},"LegacyProductType":{"type":"number","enum":[1,2,3,4,5]},"ReadIncomeBookItemDto":{"type":"object","properties":{"_id":{"type":"string"},"billing":{"type":"object"},"transactionId":{"type":"string"},"transactionIds":{"type":"array","items":{"type":"string"}},"billingObject":{"type":"object"},"paymentMethodUsed":{"$ref":"#/components/schemas/ReadPaymentMethodUsed"},"priceTotalTax":{"type":"number"},"priceWithoutTax":{"type":"number"},"productType":{"allOf":[{"$ref":"#/components/schemas/LegacyProductType"}]},"reference":{"type":"string"},"vatAmount":{"type":"number"},"vatId":{"type":"number"},"vatMention":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/VatMention"}]},"isTaxIncluded":{"type":"boolean"}},"required":["_id","paymentMethodUsed","priceTotalTax","priceWithoutTax","productType","reference","vatAmount"]},"ReadPaymentMethodUsed":{"type":"object","properties":{"value":{"allOf":[{"$ref":"#/components/schemas/PaymentMethodLegacy"}]},"other":{"type":"string"}},"required":["value"]},"PaymentMethodLegacy":{"type":"number","enum":[1,2,3,4,5,6,7,8,9]},"VatMention":{"type":"string","enum":["not_subject","second_hand_good","art_object","collection_antique","travel_agency","vat_not_applicable","vat_not_applicable_2","vat_exemption","vat_exemption_eu_sale","vat_exemption_eu_service","vat_construction","vat_psychologist","vat_psychologist_2","vat_reverse_charge","vat_reverse_charge_2","vat_reverse_charge_3","vat_reverse_charge_4","vat_reduced_rate","vat_reduced_rate_2","vat_article_261c_cgi","vat_exemption_294_cgi"]}}},"paths":{"/incomeBook":{"post":{"operationId":"IncomeBookController_postIncomeBookItem","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIncomeBookItemDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadIncomeBookItemDto"}}}}},"tags":["IncomeBook"]}}}}
```

## Supprimer une recette

L'identifiant attendu est celui de la création (`_id`), un identifiant de 24 caractères hexadécimaux. Un identifiant qui n'a pas ce format donne une erreur 404.

```bash
curl -X DELETE https://api.abby.fr/incomeBook/$INCOME_BOOK_ID \
  -H "Authorization: Bearer $ABBY_API_KEY"
```

## DELETE /incomeBook/{id}

>

```json
{"openapi":"3.0.0","info":{"title":"Abby Public API","version":"1.130.0+66756885474b"},"servers":[{"url":"https://api.abby.fr","description":"Production server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key authentication. Pass your API key as a Bearer token."}}},"paths":{"/incomeBook/{id}":{"delete":{"operationId":"IncomeBookController_deletePurchaseIncomeBookItem","parameters":[{"name":"id","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":""}},"tags":["IncomeBook"]}}}}
```

## Voir aussi

* [Livre des achats](https://docs.abby.fr/reference-de-lapi/livre-des-achats.md)
* [Conventions](https://docs.abby.fr/concepts/conventions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.abby.fr/reference-de-lapi/livre-des-recettes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
