Créer un achat
POST /firms/FIRM_ID/purchases.json
Création d’un nouvel achat. On obtient en retour le code JSON de l’enregistrement créé, avec l’ID qui lui a été attribué
Requête
curl -i -S -u IdentifiantApi:CleApi -H 'User-Agent: MonApp (patrick@camping.test)' \
-H 'Content-Type: application/json; charset=utf-8' \
-X POST -d '{"supplier_id": 1, "invoiced_on": "2013-06-28","title": "Restaurant","total_with_vat": "100","vat_amount": "16,39"}' \
"https://www.facturation.pro/firms/FIRM_ID/purchases.json"
Réponse
Status: 201 Created
Location: /firms/FIRM_ID/purchases/ID.json
{
"api_custom": null,
"api_id": null,
"category_id": null,
"id": 125858,
"invoiced_on": "2013-06-28",
"notes": null,
"paid_on": null,
"payment_mode": 0,
"payment_ref": null,
"prepaid": false,
"ref": null,
"supplier_id": 1,
"term_on": null,
"title": "Restaurant",
"total_with_vat": "100.0",
"vat_amount": "16.39"
}