受領書APIコールの例
受領書GET(クエリ)
この例では、IDが296の受領書を1件検索しました。
URLにGETしました:
https://<instance url>/api/receiving_transactions/6
または
https://<instance url>/api/receiving_transactions?id=6
検索条件に一致する回答は次のとおりです。
<?xml version="1.0" encoding="UTF-8"?>
<receiving-transaction>
<barcode type="string">4433</barcode>
<created-at type="datetime">2010-12-06T10:21:07-08:00</created-at>
<id type="integer">296</id>
<price type="decimal">1000.00</price>
<quantity type="float">1.0</quantity>
<rfid-tag type="string">3344</rfid-tag>
<total type="decimal">1000.00</total>
<type type="string">InventoryReceipt</type>
<status type="string">created</status>
<updated-at type="datetime">2010-12-06T10:21:07-08:00</updated-at>
<exported type="boolean">false</exported>
<account>
<active type="boolean">true</active>
<code>SF-Marketing-Assets</code>
<id type="integer">14</id>
<name>San Francisco -Marketing, Assets</name>
<segment-1>SF</segment-1>
<segment-10 />
<segment-11 />
<segment-12 />
<segment-13 />
<segment-14 />
<segment-15 />
<segment-16 />
<segment-17 />
<segment-18 />
<segment-19 />
<segment-2>Marketing</segment-2>
<segment-20 />
<segment-3>Assets</segment-3>
<segment-4 />
<segment-5 />
<segment-6 />
<segment-7 />
<segment-8 />
<segment-9 />
<account-type>
<id type="integer">1</id>
<name>Ace Corporate</name>
</account-type>
</account>
<order-line>
<accounting-total type="decimal">1000.00</accounting-total>
<created-at type="datetime">2010-12-06T10:16:12-08:00</created-at>
<description>Gabe's Test Item</description>
<id type="integer">2949</id>
<invoiced type="float">0.0</invoiced>
<line-num type="integer">1</line-num>
<need-by-date type="datetime">2010-12-10T00:00:00-08:00</need-by-date>
<order-header-id type="integer">2079</order-header-id>
<price type="decimal">1000.00</price>
<quantity type="float">1.0</quantity>
<received type="float">1.0</received>
<source-part-num>9999</source-part-num>
<status>received</status>
<sub-line-num type="integer" />
<supp-aux-part-num />
<total type="decimal">1000.00</total>
<type>OrderQuantityLine</type>
<updated-at type="datetime">2010-12-06T10:21:08-08:00</updated-at>
<version type="integer" />
<account>
<active type="boolean">true</active>
<code>SF-Marketing-Assets</code>
<id type="integer">14</id>
<name>San Francisco -Marketing, Assets</name>
<segment-1>SF</segment-1>
<segment-10 />
<segment-11 />
<segment-12 />
<segment-13 />
<segment-14 />
<segment-15 />
<segment-16 />
<segment-17 />
<segment-18 />
<segment-19 />
<segment-2>Marketing</segment-2>
<segment-20 />
<segment-3>Assets</segment-3>
<segment-4 />
<segment-5 />
<segment-6 />
<segment-7 />
<segment-8 />
<segment-9 />
<account-type>
<id type="integer">1</id>
<name>Ace Corporate</name>
</account-type>
</account>
<accounting-total-currency>
<code>USD</code>
<id type="integer">1</id>
</accounting-total-currency>
<currency>
<code>USD</code>
<id type="integer">1</id>
</currency>
<commodity>
<active type="boolean">true</active>
<created-at type="datetime">2008-10-28T17:13:45Z</created-at>
<id type="integer">8</id>
<name>Software</name>
<updated-at type="datetime">2009-08-14T16:34:54Z</updated-at>
<created-by>
<email>upgrade@coupa.com</email>
<employee-number />
<firstname>Coupa</firstname>
<id type="integer">1</id>
<lastname>Support</lastname>
<login>coupasupport</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
</commodity>
<item>
<id type="integer">47</id>
<active type="boolean">true</active>
<created-at type="datetime">2010-11-29T13:16:11-08:00</created-at>
<description>Gabe's Test Description</description>
<item-number>12345</item-number>
<name>Gabe's Test Item</name>
<updated-at type="datetime">2010-12-02T15:16:09-08:00</updated-at>
<commodity>
<active type="boolean">true</active>
<created-at type="datetime">2008-10-28T17:13:45Z</created-at>
<id type="integer">8</id>
<name>Software</name>
<updated-at type="datetime">2009-08-14T16:34:54Z</updated-at>
<created-by>
<email>upgrade@coupa.com</email>
<employee-number />
<firstname>Coupa</firstname>
<id type="integer">1</id>
<lastname>Support</lastname>
<login>coupasupport</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
</commodity>
<user>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</user>
<uom>
<code>EA</code>
<id type="integer">1</id>
</uom>
<user>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</user>
<reorder-alerts>
<reorder-alert>
<created-at type="datetime">2010-11-29T21:16:11Z</created-at>
<created-by type="integer">Kyle Eisner</created-by>
<id type="integer">2</id>
<item-id type="integer">47</item-id>
<quantity type="float">50.0</quantity>
<updated-at type="datetime">2010-11-29T21:16:11Z</updated-at>
<updated-by type="integer">Kyle Eisner</updated-by>
<user-id type="integer">47</user-id>
<warehouse-id type="integer">3</warehouse-id>
</reorder-alert>
</reorder-alerts>
</item>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<supplier>
<id type="integer">18</id>
<name>Lenovo</name>
<number nil="true" />
<primary-contact>
<email>upgrade@coupa.com</email>
<id type="integer">19</id>
<name-additional nil="true" />
<name-family>Arnaud</name-family>
<name-fullname nil="true" />
<name-given>Jacqueline</name-given>
<name-prefix nil="true" />
<name-suffix nil="true" />
<notes nil="true" />
<phone-work>
<area-code>650</area-code>
<country-code>1</country-code>
<extension nil="true" />
<number>5856306</number>
</phone-work>
<phone-mobile>
<area-code>650</area-code>
<country-code>1</country-code>
<extension nil="true" />
<number>5856306</number>
</phone-mobile>
<phone-fax>
<area-code>650</area-code>
<country-code>1</country-code>
<extension nil="true" />
<number>5856306</number>
</phone-fax>
</primary-contact>
<primary-address>
<attention nil="true" />
<city>San Mateo</city>
<id type="integer">25</id>
<name>Lenovo</name>
<postal-code>94402</postal-code>
<state>CA</state>
<street1>451 D Street</street1>
<street2 />
<country>
<code>US</code>
<id type="integer">223</id>
<name>United States</name>
</country>
</primary-address>
</supplier>
<uom>
<code>EA</code>
<id type="integer">1</id>
</uom>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
<asset-tags />
<attachments>
<attachment>
<id>325</id>
<intent>Supplier</intent>
<type>AttachmentFile</type>
<url>http://</url>
<text />
<file>https://s3.amazonaws.com/paperclip.coupahost.com/gabedemo.coupahost.com/attachment_files/files/79/original/asset_tag_template.csv</file>
<created-at>2010-12-06T10:16:12-08:00</created-at>
<updated-at>2010-12-06T10:16:12-08:00</updated-at>
</attachment>
</attachments>
</order-line>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<inspection-code>
<code>Fail</code>
<created-at type="datetime">2008-10-27T21:33:24Z</created-at>
<description />
<id type="integer">2</id>
<updated-at type="datetime">2008-10-27T21:33:24Z</updated-at>
<created-by>
<email>upgrade@coupa.com</email>
<employee-number />
<firstname>Coupa</firstname>
<id type="integer">1</id>
<lastname>Support</lastname>
<login>coupasupport</login>
</created-by>
<updated-by>
<email>upgrade@coupa.com</email>
<employee-number />
<firstname>Coupa</firstname>
<id type="integer">1</id>
<lastname>Support</lastname>
<login>coupasupport</login>
</updated-by>
</inspection-code>
<item>
<id type="integer">47</id>
<active type="boolean">true</active>
<created-at type="datetime">2010-11-29T13:16:11-08:00</created-at>
<description>Gabe's Test Description</description>
<item-number>12345</item-number>
<name>Gabe's Test Item</name>
<updated-at type="datetime">2010-12-02T15:16:09-08:00</updated-at>
<commodity>
<active type="boolean">true</active>
<created-at type="datetime">2008-10-28T17:13:45Z</created-at>
<id type="integer">8</id>
<name>Software</name>
<updated-at type="datetime">2009-08-14T16:34:54Z</updated-at>
<created-by>
<email>upgrade@coupa.com</email>
<employee-number />
<firstname>Coupa</firstname>
<id type="integer">1</id>
<lastname>Support</lastname>
<login>coupasupport</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
</commodity>
<user>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</user>
<uom>
<code>EA</code>
<id type="integer">1</id>
</uom>
<user>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</user>
<reorder-alerts>
<reorder-alert>
<created-at type="datetime">2010-11-29T21:16:11Z</created-at>
<created-by type="integer">Kyle Eisner</created-by>
<id type="integer">2</id>
<item-id type="integer">47</item-id>
<quantity type="float">50.0</quantity>
<updated-at type="datetime">2010-11-29T21:16:11Z</updated-at>
<updated-by type="integer">Kyle Eisner</updated-by>
<user-id type="integer">47</user-id>
<warehouse-id type="integer">3</warehouse-id>
</reorder-alert>
</reorder-alerts>
</item>
<to-warehouse-location>
<aisle>First</aisle>
<bin>Top</bin>
<created-at type="datetime">2010-12-02T23:08:03Z</created-at>
<id type="integer">8</id>
<level>3</level>
<updated-at type="datetime">2010-12-02T23:29:28Z</updated-at>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
<warehouse>
<active-flag type="boolean">true</active-flag>
<created-at type="datetime">2010-12-02T23:08:03Z</created-at>
<description>SF Stockroom</description>
<id type="integer">7</id>
<name>SF Stockroom</name>
<updated-at type="datetime">2010-12-02T23:08:03Z</updated-at>
<address>
<attention />
<city>San Francisco</city>
<id type="integer">87</id>
<name>SF Stockroom</name>
<postal-code>112211</postal-code>
<state />
<street1>123 Stockton</street1>
<street2 />
<country>
<code>US</code>
<id type="integer">223</id>
<name>United States</name>
</country>
</address>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
<warehouse-type>
<created-at type="datetime">2010-12-02T23:06:08Z</created-at>
<description>Stockroom</description>
<id type="integer">3</id>
<name>Stockroom</name>
<updated-at type="datetime">2010-12-02T23:06:08Z</updated-at>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
</warehouse-type>
</warehouse>
</to-warehouse-location>
<uom>
<code>EA</code>
<id type="integer">1</id>
</uom>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
<asset-tags>
<asset-tag>
<created-at type="datetime">2010-12-06T18:21:07Z</created-at>
<id type="integer">32</id>
<inventory-balance-id type="integer">29</inventory-balance-id>
<order-line-id type="integer" nil="true" />
<received type="boolean">true</received>
<requisition-line-id type="integer" nil="true" />
<tag>12121212</tag>
<updated-at type="datetime">2010-12-06T18:21:08Z</updated-at>
<created-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</created-by>
<updated-by>
<email>upgrade+ke@coupa.com</email>
<employee-number />
<firstname>Kyle</firstname>
<id type="integer">16</id>
<lastname>Eisner</lastname>
<login>administrator</login>
</updated-by>
</asset-tag>
</asset-tags>
<attachments />
</receiving-transaction>
受領書作成
この例では、受領取引を作成しています。
URL:に投稿しましたhttps://<instance>.coupahost.com/api/receiving_transactions
。 これにより受領書が作成されました。
<?xml version="1.0" encoding="UTF-8"?>
<receiving-transaction>
<barcode>4433</barcode>
<price>1000.00</price>
<quantity>1.0</quantity>
<rfid-tag>3344</rfid-tag>
<type type="string">InventoryReceipt</type>
<account>
<code>SF-Marketing-Assets</code>
<id type="integer">14</id>
</account>
<order-line>
<id>2949</id>
<line-num>1</line-num>
<order-header-id>2079</order-header-id>
</order-line>
<inspection-code>
<code>Fail</code>
<description />
<id type="integer">2</id>
</inspection-code>
<item>
<id type="integer">47</id>
<item-number>12345</item-number>
</item>
<to-warehouse>
<id type="integer">7</id>
</to-warehouse>
<to-warehouse-location>
<id type="integer">8</id>
</to-warehouse-location>
<uom>
<code>EA</code>
<id type="integer">1</id>
</uom>
<attachments />
</receiving-transaction>
受領トランザクションオプションの取得
受領トランザクションAPIを使用して、必要な結果セットをクエリして取得する方法の例を以下に示します。
このクエリは、受領されたすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&order-line[status]=received
このクエリは、「Adobe Acrobat Professional」を含む項目の説明を含むすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&order-line[description][contains]=Adobe+Acrobat+Professional
このクエリは、SF-IT-Assetsアカウントのすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&account[code]=SF-IT-Assets
このクエリは、2010年1月1日12:00:00以降に作成されたすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&order-line[created-at][gt]=2010-01-01T12:00:00
このクエリは、勘定科目表Ace Corporateのすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&account[account-type][name]=Ace+Corporate
このクエリは、管理者のログイン名で作成されたすべての受領書を返します。
https://<instance url>/api/receiving_transactions?type=InventoryReceipt&order-line[created-by][login]=administrator
このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。