Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TaurusOlson committed Apr 25, 2019
1 parent 147ef92 commit f0d00a7
Show file tree
Hide file tree
Showing 19 changed files with 245 additions and 18 deletions.
Binary file modified docs/_build/doctrees/advanced_usage.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/cookbook.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/quickstart.doctree
Binary file not shown.
29 changes: 29 additions & 0 deletions docs/_build/html/_sources/advanced_usage.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,32 @@ For example:
``None`` for all the other fields.

.. _HeaderMessage: https://dev.cdiscount.com/marketplace/?page_id=212


Available states for the seller
-------------------------------

(cf https://dev.cdiscount.com/marketplace/?page_id=134 for the complete list.)

-------------------
States for an order
-------------------

* AcceptedBySeller
* Shipped
* RefusedBySeller
* ShipmentRefusedBySeller
* AvailableOnStore


------------------
Acceptation states
------------------

* AcceptedBySeller
* ShippedBySeller
* RefusedBySeller
* ShipmentRefusedBySeller
* CancelledBeforeNotificationByCustomer
* CancelledBeforePaymentByCustomer
* CancellationRequestPending
30 changes: 26 additions & 4 deletions docs/_build/html/_sources/cookbook.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ Accept the order
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.

::
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',
Expand All @@ -51,3 +49,27 @@ customer, you can refuse the shipment.

validations = api.orders.prepare_validations([shipment_refused_by_seller])
response = api.orders.validate_order_list(**validations)


Refund the customer
-------------------

::
response = api.orders.create_refund_voucher(
OrderNumber='ORDER_NUMBER',
SellerRefundList={'Mode': 'Claim', 'Motive': 'ClientClaim',
'RefundOrderLine': {'Ean': None, 'SellerProductId': 'SKU'
'RefundShippingCharges': False}}
)

A commercial gesture is also possible by adding the keyword ``CommercialGestureList``::

response = api.orders.create_refund_voucher(
OrderNumber='ORDER_NUMBER',
CommercialGestureList=[{'Amount': 10, 'MotiveId': 'late_delivery'}],
SellerRefundList={'Mode': 'Claim', 'Motive': 'ClientClaim',
'RefundOrderLine': {'Ean': None, 'SellerProductId': 'SKU',
'RefundShippingCharges': False}}
)

19 changes: 18 additions & 1 deletion docs/_build/html/_sources/quickstart.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,24 @@ Retrieve information about your seller account
Validate an order
-----------------

In order to validate an order, you have to provide the information
In order to validate an order, you have to provide the information:

- about each item in the order (order line) and the corresponding AcceptationState,
- about the order and the OrderState.


Validate the shipment
---------------------

::

shipped = {'CarrierName': 'Colissimo', 'OrderNumber': '1904241640CLE8Z',
'OrderState': 'Shipped', 'TrackingNumber': 'TN1',
'TrackingUrl':'http://www.colissimo.fr/portail_colissimo/suivre.do?language=fr_FR',
'OrderLineList': [
{'AcceptationState': 'ShippedBySeller',
'SellerProductId': 'PRES1',
'ProductCondition': 'AverageState'}]}

validations = api.orders.prepare_validations([shipped])
response = api.validate_order_list(**validations)
31 changes: 31 additions & 0 deletions docs/_build/html/advanced_usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,32 @@ <h2>Use a configuration file<a class="headerlink" href="#use-a-configuration-fil
<p><code class="docutils literal notranslate"><span class="pre">None</span></code> for all the other fields.</p>
</div>
</div>
<div class="section" id="available-states-for-the-seller">
<h2>Available states for the seller<a class="headerlink" href="#available-states-for-the-seller" title="Permalink to this headline"></a></h2>
<p>(cf <a class="reference external" href="https://dev.cdiscount.com/marketplace/?page_id=134">https://dev.cdiscount.com/marketplace/?page_id=134</a> for the complete list.)</p>
<div class="section" id="states-for-an-order">
<h3>States for an order<a class="headerlink" href="#states-for-an-order" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>AcceptedBySeller</p></li>
<li><p>Shipped</p></li>
<li><p>RefusedBySeller</p></li>
<li><p>ShipmentRefusedBySeller</p></li>
<li><p>AvailableOnStore</p></li>
</ul>
</div>
<div class="section" id="acceptation-states">
<h3>Acceptation states<a class="headerlink" href="#acceptation-states" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>AcceptedBySeller</p></li>
<li><p>ShippedBySeller</p></li>
<li><p>RefusedBySeller</p></li>
<li><p>ShipmentRefusedBySeller</p></li>
<li><p>CancelledBeforeNotificationByCustomer</p></li>
<li><p>CancelledBeforePaymentByCustomer</p></li>
<li><p>CancellationRequestPending</p></li>
</ul>
</div>
</div>
</div>


Expand All @@ -109,6 +135,11 @@ <h3><a href="index.html">Table of Contents</a></h3>
<li><a class="reference internal" href="#">Advanced usage</a><ul>
<li><a class="reference internal" href="#get-the-latest-request-and-response">Get the latest request and response</a></li>
<li><a class="reference internal" href="#use-a-configuration-file">Use a configuration file</a></li>
<li><a class="reference internal" href="#available-states-for-the-seller">Available states for the seller</a><ul>
<li><a class="reference internal" href="#states-for-an-order">States for an order</a></li>
<li><a class="reference internal" href="#acceptation-states">Acceptation states</a></li>
</ul>
</li>
</ul>
</li>
</ul>
Expand Down
16 changes: 16 additions & 0 deletions docs/_build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@ <h2>Offers<a class="headerlink" href="#offers" title="Permalink to this headline
(cf <a class="reference external" href="http://schemas.microsoft.com/2003/10/Serialization/Arrays">http://schemas.microsoft.com/2003/10/Serialization/Arrays</a>)</p>
</dd></dl>

<dl class="method">
<dt id="cdiscountapi.cdiscountapi.Offers.generate_offers_xml">
<code class="descname">generate_offers_xml</code><span class="sig-paren">(</span><em>offers_data</em><span class="sig-paren">)</span><a class="headerlink" href="#cdiscountapi.cdiscountapi.Offers.generate_offers_xml" title="Permalink to this definition"></a></dt>
<dd><p>offers_data = [
{</p>
<blockquote>
<div><p>‘Offer’: Offer(),
‘ShippingInformationList’: ShippingInformationList(</p>
<blockquote>
<div><p>[ShippingInformation()]</p>
</div></blockquote>
<p>)</p>
</div></blockquote>
<p>generate_offers_xml()</p>
</dd></dl>

<dl class="method">
<dt id="cdiscountapi.cdiscountapi.Offers.get_offer_list">
<code class="descname">get_offer_list</code><span class="sig-paren">(</span><em>**filters</em><span class="sig-paren">)</span><a class="headerlink" href="#cdiscountapi.cdiscountapi.Offers.get_offer_list" title="Permalink to this definition"></a></dt>
Expand Down
26 changes: 24 additions & 2 deletions docs/_build/html/cookbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ <h3>Accept the order<a class="headerlink" href="#accept-the-order" title="Permal
</div>
<div class="section" id="refuse-the-shipment-of-an-order">
<h3>Refuse the shipment of an order<a class="headerlink" href="#refuse-the-shipment-of-an-order" title="Permalink to this headline"></a></h3>
<p>After the order is accepted, if for some reason, you can’t ship it to your
customer, you can refuse the shipment.</p>
<p>After the order is accepted if, for some reason, you can’t ship it to your
customer, you can refuse the shipment:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">shipment_refused_by_seller</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;OrderNumber&#39;</span><span class="p">:</span> <span class="s1">&#39;ORDER_NUMBER&#39;</span><span class="p">,</span>
<span class="s1">&#39;OrderState&#39;</span><span class="p">:</span> <span class="s1">&#39;ShipmentRefusedBySeller&#39;</span><span class="p">,</span>
<span class="s1">&#39;OrderLineList&#39;</span><span class="p">:</span> <span class="p">[{</span>
Expand All @@ -106,6 +106,27 @@ <h3>Refuse the shipment of an order<a class="headerlink" href="#refuse-the-shipm
</pre></div>
</div>
</div>
<div class="section" id="refund-the-customer">
<h3>Refund the customer<a class="headerlink" href="#refund-the-customer" title="Permalink to this headline"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">orders</span><span class="o">.</span><span class="n">create_refund_voucher</span><span class="p">(</span>
<span class="n">OrderNumber</span><span class="o">=</span><span class="s1">&#39;ORDER_NUMBER&#39;</span><span class="p">,</span>
<span class="n">SellerRefundList</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;Mode&#39;</span><span class="p">:</span> <span class="s1">&#39;Claim&#39;</span><span class="p">,</span> <span class="s1">&#39;Motive&#39;</span><span class="p">:</span> <span class="s1">&#39;ClientClaim&#39;</span><span class="p">,</span>
<span class="s1">&#39;RefundOrderLine&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s1">&#39;Ean&#39;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="s1">&#39;SellerProductId&#39;</span><span class="p">:</span> <span class="s1">&#39;SKU&#39;</span>
<span class="s1">&#39;RefundShippingCharges&#39;</span><span class="p">:</span> <span class="kc">False</span><span class="p">}}</span>
<span class="p">)</span>
</pre></div>
</div>
<p>A commercial gesture is also possible by adding the keyword <code class="docutils literal notranslate"><span class="pre">CommercialGestureList</span></code>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">response</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">orders</span><span class="o">.</span><span class="n">create_refund_voucher</span><span class="p">(</span>
<span class="n">OrderNumber</span><span class="o">=</span><span class="s1">&#39;ORDER_NUMBER&#39;</span><span class="p">,</span>
<span class="n">CommercialGestureList</span><span class="o">=</span><span class="p">[{</span><span class="s1">&#39;Amount&#39;</span><span class="p">:</span> <span class="mi">10</span><span class="p">,</span> <span class="s1">&#39;MotiveId&#39;</span><span class="p">:</span> <span class="s1">&#39;late_delivery&#39;</span><span class="p">}],</span>
<span class="n">SellerRefundList</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;Mode&#39;</span><span class="p">:</span> <span class="s1">&#39;Claim&#39;</span><span class="p">,</span> <span class="s1">&#39;Motive&#39;</span><span class="p">:</span> <span class="s1">&#39;ClientClaim&#39;</span><span class="p">,</span>
<span class="s1">&#39;RefundOrderLine&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s1">&#39;Ean&#39;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="s1">&#39;SellerProductId&#39;</span><span class="p">:</span> <span class="s1">&#39;SKU&#39;</span><span class="p">,</span>
<span class="s1">&#39;RefundShippingCharges&#39;</span><span class="p">:</span> <span class="kc">False</span><span class="p">}}</span>
<span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>

Expand All @@ -121,6 +142,7 @@ <h3><a href="index.html">Table of Contents</a></h3>
<li><a class="reference internal" href="#orders">Orders</a><ul>
<li><a class="reference internal" href="#accept-the-order">Accept the order</a></li>
<li><a class="reference internal" href="#refuse-the-shipment-of-an-order">Refuse the shipment of an order</a></li>
<li><a class="reference internal" href="#refund-the-customer">Refund the customer</a></li>
</ul>
</li>
</ul>
Expand Down
6 changes: 4 additions & 2 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ <h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api.html#cdiscountapi.cdiscountapi.WebMail.generate_discussion_mail_guid">generate_discussion_mail_guid() (cdiscountapi.cdiscountapi.WebMail method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Offers.generate_offers_xml">generate_offers_xml() (cdiscountapi.cdiscountapi.Offers method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Products.get_all_allowed_category_tree">get_all_allowed_category_tree() (cdiscountapi.cdiscountapi.Products method)</a>
</li>
Expand All @@ -148,11 +150,11 @@ <h2 id="G">G</h2>
<li><a href="api.html#cdiscountapi.cdiscountapi.Orders.get_global_configuration">get_global_configuration() (cdiscountapi.cdiscountapi.Orders method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Products.get_model_list">get_model_list() (cdiscountapi.cdiscountapi.Products method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Offers.get_offer_list">get_offer_list() (cdiscountapi.cdiscountapi.Offers method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api.html#cdiscountapi.cdiscountapi.Offers.get_offer_list">get_offer_list() (cdiscountapi.cdiscountapi.Offers method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Offers.get_offer_list_paginated">get_offer_list_paginated() (cdiscountapi.cdiscountapi.Offers method)</a>
</li>
<li><a href="api.html#cdiscountapi.cdiscountapi.Offers.get_offer_package_submission_result">get_offer_package_submission_result() (cdiscountapi.cdiscountapi.Offers method)</a>
Expand Down
2 changes: 2 additions & 0 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ <h1>Welcome to CdiscountAPI’s documentation!<a class="headerlink" href="#welco
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#create-a-connection-to-the-server">Create a connection to the server</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#retrieve-information-about-your-seller-account">Retrieve information about your seller account</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#validate-an-order">Validate an order</a></li>
<li class="toctree-l2"><a class="reference internal" href="quickstart.html#validate-the-shipment">Validate the shipment</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage.html">Advanced usage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="advanced_usage.html#get-the-latest-request-and-response">Get the latest request and response</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_usage.html#use-a-configuration-file">Use a configuration file</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced_usage.html#available-states-for-the-seller">Available states for the seller</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="cookbook.html">Cookbook</a><ul>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
24 changes: 21 additions & 3 deletions docs/_build/html/quickstart.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,26 @@ <h2>Retrieve information about your seller account<a class="headerlink" href="#r
</div>
<div class="section" id="validate-an-order">
<h2>Validate an order<a class="headerlink" href="#validate-an-order" title="Permalink to this headline"></a></h2>
<p>In order to validate an order, you have to provide the information
- about each item in the order (order line) and the corresponding AcceptationState,
- about the order and the OrderState.</p>
<p>In order to validate an order, you have to provide the information:</p>
<ul class="simple">
<li><p>about each item in the order (order line) and the corresponding AcceptationState,</p></li>
<li><p>about the order and the OrderState.</p></li>
</ul>
</div>
<div class="section" id="validate-the-shipment">
<h2>Validate the shipment<a class="headerlink" href="#validate-the-shipment" title="Permalink to this headline"></a></h2>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">shipped</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;CarrierName&#39;</span><span class="p">:</span> <span class="s1">&#39;Colissimo&#39;</span><span class="p">,</span> <span class="s1">&#39;OrderNumber&#39;</span><span class="p">:</span> <span class="s1">&#39;1904241640CLE8Z&#39;</span><span class="p">,</span>
<span class="s1">&#39;OrderState&#39;</span><span class="p">:</span> <span class="s1">&#39;Shipped&#39;</span><span class="p">,</span> <span class="s1">&#39;TrackingNumber&#39;</span><span class="p">:</span> <span class="s1">&#39;TN1&#39;</span><span class="p">,</span>
<span class="s1">&#39;TrackingUrl&#39;</span><span class="p">:</span><span class="s1">&#39;http://www.colissimo.fr/portail_colissimo/suivre.do?language=fr_FR&#39;</span><span class="p">,</span>
<span class="s1">&#39;OrderLineList&#39;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span><span class="s1">&#39;AcceptationState&#39;</span><span class="p">:</span> <span class="s1">&#39;ShippedBySeller&#39;</span><span class="p">,</span>
<span class="s1">&#39;SellerProductId&#39;</span><span class="p">:</span> <span class="s1">&#39;PRES1&#39;</span><span class="p">,</span>
<span class="s1">&#39;ProductCondition&#39;</span><span class="p">:</span> <span class="s1">&#39;AverageState&#39;</span><span class="p">}]}</span>

<span class="n">validations</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">orders</span><span class="o">.</span><span class="n">prepare_validations</span><span class="p">([</span><span class="n">shipped</span><span class="p">])</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">api</span><span class="o">.</span><span class="n">validate_order_list</span><span class="p">(</span><span class="o">**</span><span class="n">validations</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>

Expand All @@ -86,6 +103,7 @@ <h3><a href="index.html">Table of Contents</a></h3>
<li><a class="reference internal" href="#create-a-connection-to-the-server">Create a connection to the server</a></li>
<li><a class="reference internal" href="#retrieve-information-about-your-seller-account">Retrieve information about your seller account</a></li>
<li><a class="reference internal" href="#validate-an-order">Validate an order</a></li>
<li><a class="reference internal" href="#validate-the-shipment">Validate the shipment</a></li>
</ul>
</li>
</ul>
Expand Down
Loading

0 comments on commit f0d00a7

Please sign in to comment.