• 最終編集日時: 12 August 2019

請求書API呼び出しの例

請求書に対するさまざまなクエリオプション

請求書APIを使用してクエリし、必要な結果セットを取得する方法の詳細な例を次に示します。 

このクエリは、CDWをサプライヤーとして含むすべての請求書を返します。 

https ://.coupahost.com/api/invoices?supplier [NAME<instance>] = CDW
 
このクエリは、通貨がユーロのすべての請求書を返します。 

https ://.coupahost.com/api/invoices?currency [code]<instance> = EUR
 
このクエリは、2010年1月1日12:00:00以降に作成されたすべての請求書を返します。 

https ://.coupahost.com/api/invoices?invoice-date [gt<instance>] = 2010 -01 -01 T 12:00:00
 

単一の請求書を取得する

この例では、IDが1の単一の請求書レコードを照会しました。

URLへのアクセスを行いました。

https<instance> ://.coupahost.com/api/invoices/1
または

<instance>https://coupahost.com/api/invoices?id=1

<?xml version="1.0" encoding="UTF-8"?>

<invoice-header>

	 <comments />

	 2008 <created-at type="datetime">-10 -28 T 11:19:49 - 07:00</created-at>

	 <handling-amount type="decimal">0.0</handling-amount>

	 <id type="integer">1</id>

	 <internal-note />

	 2008 <invoice-date type="datetime">-10 -28 T 00:00:00 - 07:00</invoice-date>

	 <invoice-number type="integer">500</invoice-number>

	 <line-level-taxation type="boolean">偽</line-level-taxation>

	 <misc-amount type="decimal">0.0</misc-amount>

	 <shipping-amount type="decimal">0.0</shipping-amount>

	 <status>承認済み</status>

	 <supplier-note />

	 <tax-amount type="decimal">35.14</tax-amount>

	 <tax-rate type="float">8.25</tax-rate>

	 2008 <updated-at type="datetime">-10 -28 T 11:24:44 - 07:00</updated-at>

	 <paid type="boolean">偽</paid>

	 <payment-date type="datetime" />

	 <payment-notes />

	 <exported type="boolean">偽</exported>

	 <invoice-description type="string" />

	 <account-type>

			<id type="integer">1</id>

			<name>エースコーポレート</name>

	 </account-type>

	 <created-by>

			<email>upgrade+am@coupa.com</email>

			<employee-number />

			<firstname>Anna (AP部長)</firstname>

			<id type="integer">10</id>

			<lastname>マニング</lastname>

			<login>amanning</login>

	 </created-by>

	 <currency>

			<code>USD</code>

			<id type="integer">1</id>

	 </currency>

	 <supplier>

			<id type="integer">17</id>

			<name>インサイト</name>

			<number nil="true" />

			<primary-contact>

				 <email>upgrade@coupa.com</email>

				 <id type="integer">18</id>

				 <name-additional nil="true" />

				 <name-family>ヘンダーソン</name-family>

				 <name-fullname nil="true" />

				 <name-given>スティーブ</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>テンペ</city>

				 <id type="integer">24</id>

				 <name>インサイト</name>

				 <postal-code>85283</postal-code>

				 <state>AZ</state>

				 <street1>6820 South Harl Avenue</street1>

				 <street2 />

				 <country>

						<code>US</code>

						<id type="integer">223</id>

						<name>米国</name>

				 </country>

			</primary-address>

	 </supplier>

	 <tax-code>

			<code>カナダ</code>

			<id type="integer">1</id>

	 </tax-code>

	 <updated-by>

			<email>upgrade+cj@coupa.com</email>

			<employee-number />

			<firstname>CARL (中央受領担当)</firstname>

			<id type="integer">11</id>

			<lastname>ジョンソン</lastname>

			<login>cjohnson</login>

	 </updated-by>

	 <attachments />

	 <invoice-lines>

			<invoice-line>

				 <accounting-total type="decimal">425.99</accounting-total>

				 2008 <created-at type="datetime">-10 -28 T 11:19:49 - 07:00</created-at>

				 <description>Adobe Acrobat Professional - (v. 9) -コンプリートパッケージ</description>

				 <id type="integer">1</id>

				 <line-num type="integer">1</line-num>

				 <order-header-num type="integer">7</order-header-num>

				 <order-line-id type="integer">10</order-line-id>

				 <order-line-num type="integer">1</order-line-num>

				 <price type="decimal">425.99</price>

				 <quantity type="float">1.0</quantity>

				 <status>が一致し、</status>

				 <tax-rate type="float" />

				 <tax-location />

				 <tax-amount type="decimal">0.00</tax-amount>

				 <tax-description />

				 <tax-supply-date type="datetime" />

				 <total type="decimal">425.99</total>

				 <type>InvoiceQuantityLine</type>

				 2008 <updated-at type="datetime">-10 -28 T 11:24:44 - 07:00</updated-at>

				 <treasury-codes type="string" />

				 <account>

						<active type="boolean">true</active>

						SF - IT -<code> Assets</code>

						<id type="integer">18</id>

						<name>サンフランシスコ- IT、アセット</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>IT部門</segment-2>

						<segment-20 />

						<segment-3>資産</segment-3>

						<segment-4 />

						<segment-5 />

						<segment-6 />

						<segment-7 />

						<segment-8 />

						<segment-9 />

						<account-type>

							 <id type="integer">1</id>

							 <name>エース企業</name>

						</account-type>

				 </account>

				 <accounting-total-currency>

						<code>USD</code>

						<id type="integer">1</id>

				 </accounting-total-currency>

				 <created-by>

						<email>upgrade+am@coupa.com</email>

						<employee-number />

						<firstname>Anna (AP部長)</firstname>

						<id type="integer">10</id>

						<lastname>マニング</lastname>

						<login>amanning</login>

				 </created-by>

				 <currency>

						<code>USD</code>

						<id type="integer">1</id>

				 </currency>

				 <item>

						<id type="integer">23</id>

						2008 <created-at type="datetime">-10 -28 T 10:12:02 - 07:00</created-at>

						<description>Adobe Acrobat 9 Professionalソフトウェアを使用	すると、ビジネスプロフェッショナルはAdobe PDFドキュメントを確実に作成、結合、制御して、簡単で安全な配布、コラボレーション、およびデータ収集を行うことができます。</description>

						<item-number>3235</item-number>

						<name>Adobe Acrobat Professional - (v. 9) -コンプリートパッケージ</name>

						2009 <updated-at type="datetime">-05 -04 T 17:19:51 - 07:00</updated-at>

						<commodity>

							 <active type="boolean">true</active>

							 2008 <created-at type="datetime">-10 -28 T 17:13:45 Z</created-at>

							 <id type="integer">8</id>

							 <name>ソフトウェア</name>

							 2009 <updated-at type="datetime">-08 -14 T 16:34:54 Z</updated-at>

							 <created-by>

									<email>upgrade@coupa.com</email>

									<employee-number nil="true" />

									<firstname>Coupa</firstname>

									<id type="integer">1</id>

									<lastname>サポート</lastname>

									<login>coupasupport</login>

							 </created-by>

							 <updated-by>

									<email>upgrade+ke@coupa.com</email>

									<employee-number />

									<firstname>カイル</firstname>

									<id type="integer">16</id>

									<lastname>アイズナー</lastname>

									<login>administrator</login>

							 </updated-by>

						</commodity>

						<support-user>

							 <email>upgrade@coupa.com</email>

							 <employee-number nil="true" />

							 <firstname>Coupa</firstname>

							 <id type="integer">1</id>

							 <lastname>サポート</lastname>

							 <login>coupasupport</login>

						</support-user>

						<uom>

							 <code>EA</code>

							 <id type="integer">1</id>

						</uom>

						<support-user>

							 <email>upgrade@coupa.com</email>

							 <employee-number nil="true" />

							 <firstname>Coupa</firstname>

							 <id type="integer">1</id>

							 <lastname>サポート</lastname>

							 <login>coupasupport</login>

						</support-user>

						<reorder-alerts />

				 </item>

				 <uom>

						<code>EA</code>

						<id type="integer">1</id>

				 </uom>

				 <updated-by>

						<email>upgrade+cj@coupa.com</email>

						<employee-number />

						<firstname>CARL (中央受領担当)</firstname>

						<id type="integer">11</id>

						<lastname>ジョンソン</lastname>

						<login>cjohnson</login>

				 </updated-by>

			</invoice-line>

	 </invoice-lines>

</invoice-header>

インボイスプットの例

この例では、請求書レコードの1つの属性を更新しています。

このフィールドは請求書のカスタムフィールドでなければなりません。

https ://.coupahost.com/api/invoices/」というURLを入力しまし<instance>た<invoice id> 

URL:  https<instance> ://.coupahost.com/api/invoices/33

<?xml version="1.0" encoding="UTF-8"?>

<invoice-header>

	 <invoice_description>請求書テストの説明</invoice_description>

</invoice-header>

次の例は、請求書行を追加するためのプットコールを示しています。

<?xml version="1.0" encoding="UTF-8"?>

<invoice-header>

	 <invoice-number>320</invoice-number>

	 <status>ドラフト</status>

	 <invoice-lines type="array">

			<invoice-line>

				 <accounting-total type="decimal">499.00</accounting-total>

				 wi - Fi<description>対応のiPadは、自宅にワイヤレス高速インターネットルーターがある場合に最適です</description>

				 <price type="decimal">499.00</price>

				 <price-per-uom type="decimal">0.00</price-per-uom>

				 <quantity type="decimal">1.0</quantity>

				 <status>新しい</status>

				 <tax-amount type="decimal">0.00</tax-amount>

				 <total type="decimal">499.00</total>

				 <type>InvoiceQuantityLine</type>

				 <account>

						<name>本社- IT部門、資産部門</name>

						HQ - IT -<code> Assets</code>

						<active type="boolean">true</active>

						<segment-1>本社</segment-1>

						<segment-2>IT</segment-2>

						<segment-3>資産</segment-3>

						<account-type>

							 企業の<name>エース</name>

						</account-type>

				 </account>

				 <account-allocations type="array" />

				 <accounting-total-currency>

						<id type="integer">1</id>

						<code>USD</code>

				 </accounting-total-currency>

				 <currency>

						<id type="integer">1</id>

						<code>USD</code>

				 </currency>

				 <tax-lines type="array" />

			</invoice-line>

	 </invoice-lines>

</invoice-header>

関連アイテム


Coupa Core API

CoupaのRESTful APIは、お客様のデータをCoupaプラットフォームで読み取り、編集し、統合するための堅牢なアクセスを提供します。

APIの開始

Coupa APIの使用に関する一般情報、およびCSVの使用を検討するタイミング。

OAuth 2.0およびOIDCへの移行

Coupaは従来のAPIキーを廃止し、OAuth 2.0 / OIDCの使用を必要としています。R34以降、新しいAPIキーは発行されず、R35ではAPIキーはサポートされなくなります。

リソース

参照データ、トランザクションデータ、共有リソースなど、オブジェクトのタイプ別にAPIエンドポイントを整理しました。