API Reference
Log In
API Reference

Modifier une commande

Permet de modifier une commande :

  • modifier les informations de bases (nombre de couverts, nom, serveur, ...)
  • ajouter des produits
  • modifier des produits (et ajouter/supprimer des extras)
  • ajouter des envois
  • ajouter des paiements
  • modifier des paiements

Modifier les informations de bases

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "waiterId": 1,
    "name": "Valentin",
    "date": "2015-01-01 12:30",
    "nbCustomers": 2
}

Ajouter un produit (ligne)

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "lines": [
        {
            "productId": 4,
            "comment": "Sans césame",
            "sending": 0,
            "extraLines": [],
          	"date": "2015-01-01 12:30",
          	"position": 2,
        }
      ]
}

Modifier une ligne et ajouter un extra

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "lines": [
        {
            "id": 12, // id de l'order line à modifier
            "comment": "Nouveau commentaire",
            "sending": 1,
          	"discountAmount": 1000,
            "extraLines": [
                {
                  	"extraId": 9,
                    "price": 0,
                    "tax": 10
                },
              	{
                		"extraId": 10,
                    "price": 0,
                    "tax": 10
                }
            ]
        }
    ]
}

Supprimer une ligne

Pour supprimer un ligne, mettre le status à "CANCELED".

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "lines": [
        {
            "id": 12, // id de l'order line à modifier
            "status": "CANCELED",
        }
    ]
}

Supprimer un extra

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "lines": [
        {
            "id": 12, // id de l'order line à modifier
            "extraLines": [
              {
                "id": 14, // id de l'order extra line à supprimer
                "removed": true
              }
            ]
        }
      ]
}

Ajouter un envoi

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "sendings": [
        {
            "sending": 1
        }
    ]
}

Ajouter un paiement

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "payments": [
        {
            "type": "CARD",
            "amount": 10,
          	"date": "2015-01-01 12:30",
          	"status": "ACCEPTED"
        }
      ]
}

Modifier (ou annuler) un paiement

Pour supprimer un paiement, mettre le status à "CANCELED".

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "payments": [
        {
            "id": 31, // id du paiement à modifier
            "type": "CASH",
            "amount": 10,
            "status": "CANCELED"
        }
    ]
}

Modifier un envoi

{
    "restaurant_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  	"provider_token": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "sendings": [
        {
            "id": 16,
            "number": 51
        }
    ]
}
Language
Click Try It! to start a request and see the response here!