Skip to content

Commit

Permalink
Add the page cookbook in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TaurusOlson committed Apr 24, 2019
1 parent ad7d825 commit 6a3f7d2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
.. cookbook:
========
Cookbook
========

------
Orders
------

We'll assume there is an order with one order line with the following parameters and values:

================ ============
Parameter Value
================ ============
OrderNumber ORDER_NUMBER
SellerProductId SKU
ProductCondition AverageState
================ ============

Accept the order
----------------

::

accepted_by_seller = {'CarrierName': 'Colissimo',
'OrderState': 'AcceptedBySeller',
'OrderNumber': 'ORDER_NUMBER',
'OrderLineList': [{
'AcceptationState': 'AcceptedBySeller',
'SellerProductId': 'SKU',
'ProductCondition': 'AverageState'}]}
validations = api.orders.prepare_validations([accepted_by_seller])
response = api.orders.validate_order_list(**validations)


Refuse the shipment of an order
-------------------------------

After the order is accepted, if for some reason, you can't ship it to your
customer, you can refuse the shipment.

::

shipment_refused_by_seller = {'OrderNumber': 'ORDER_NUMBER',
'OrderState': 'ShipmentRefusedBySeller',
'OrderLineList': [{
'AcceptationState': 'ShipmentRefusedBySeller',
'SellerProductId': 'SKU',
'ProductCondition': 'AverageState'}]}

validations = api.orders.prepare_validations([shipment_refused_by_seller])
response = api.orders.validate_order_list(**validations)
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Welcome to CdiscountAPI's documentation!

quickstart
advanced_usage
cookbook
api
CHANGELOG

Expand Down

0 comments on commit 6a3f7d2

Please sign in to comment.