Achats

Liste

GET /firms/{FIRM_ID}/purchases.xml

liste des achats, par groupe de 30 résultats

Paramètres optionnels : page

Réponse

<?xml version="1.0" encoding="UTF-8"?>
<purchases type="array">
  <pagination>
    <current_page>1</current_page>
    <total_pages>1</total_pages>
  </pagination>
  <purchase>
    <api_custom nil="true"></api_custom>
    <api_id nil="true"></api_id>
    <id>1</id>
    <paid_on>2009-01-01</paid_on>
    <payment_mode>2</payment_mode>
    <ref>123456</ref>
    <supplier>
      <id>1</id>
      <name>dedibox</name>
    </supplier>
    <title>Hébergement</title>
    <total>200.0</total>
  </purchase>
  <purchase>
    <api_custom nil="true"></api_custom>
    <api_id nil="true"></api_id>
    <id>2</id>
    <paid_on>2009-02-01</paid_on>
    <payment_mode>2</payment_mode>
    <ref>112233</ref>
    <supplier>
      <id>2</id>
      <name>INPI</name>
    </supplier>
    <title>Dépot de marque</title>
    <total>60.0</total>
  </purchase>
</purchases>

Détail

GET /firms/{FIRM_ID}/purchases/{ID}.xml

Affiche le détail de l’achat n° ID

Réponse

<?xml version="1.0" encoding="UTF-8"?>
<purchase>
  <api_custom nil="true"></api_custom>
  <api_id nil="true"></api_id>
  <id>24</id>
  <paid_on>2009-01-03</paid_on>
  <payment_mode>3</payment_mode>
  <ref>12345</ref>
  <supplier>
    <id>1</id>
    <name>dedibox</name>
  </supplier>
  <title>H&#233;bergement - 2009-01</title>
  <total>100</total>
</purchase>

Créer un achat

POST /firms/{FIRM_ID}/purchases.xml

Création d’un nouvel achat. On obtient en retour le code XML de l’enregistrement créé, avec l’ID qui lui a été attribué

Requête

Les deux champs api_custom (chaine) et api_id(entier) sont deux champs libres que vous pouvez utiliser à votre convenance pour stocker les informations que vous souhaitez.

<?xml version="1.0" encoding="UTF-8"?>
<purchase>
  <api_custom>CREATED_BY_API</api_custom>
  <api_id>12345</api_id>
  <paid_on>2009-02-03</paid_on>
  <payment_mode>3</payment_mode>
  <ref>223344</ref>
  <supplier>
    <id>149</id>
    <name>dedibox</name>
  </supplier>
  <title>H&#233;bergement - 2009-02</title>
  <total>100</total>
</purchase>

Réponse

Status: 201 Created
Location: /firms/{FIRM_ID}/purchases/#{new-purchase-id}.xml

<purchase>
  ...
</purchase>

Modifier un achat

PUT /firms/{FIRM_ID}/purchases/#{ID}.xml

Mise à jour d’un achat existant.

Requête

Les deux champs api_custom (chaine) et api_id(entier) sont deux champs libres que vous pouvez utiliser à votre convenance pour stocker les informations que vous souhaitez.

<?xml version="1.0" encoding="UTF-8"?>
<purchase>
  <id>24</id>
  <paid_on>2009-01-15</paid_on>
  <payment_mode>3</payment_mode>
  <ref>12345</ref>
  <supplier>
    <id>1</id>
    <name>dedibox</name>
  </supplier>
  <title>H&#233;bergement - 2009-01</title>
  <total>200</total>
  <api_custom>CREATED_BY_API</api_custom>
  <api_id>54321</api_id>
</purchase>

Réponse

Status: 200 OK

Supprimer un achat

DELETE /firms/{FIRM_ID}/purchases/#{ID}.xml

Supprime l’achat identifié par son ID.

Réponse

Status: 200 OK

Liste des champs

Champs Libellé Type
api_custom API - Texte libre string
api_id API - Référence numérique libre integer
id Identifiant integer
paid_on Date du paiement date
payment_mode Mode de paiement integer
ref Réf. facture string
title Nature/Libellé text
total Montant TTC decimal
vat TVA decimal