• 最終編集日時: 12 August 2019

発注書改訂APIのコール例

概要

発注書の修正APIでは、PO変更履歴への読み取りアクセスが可能です。このAPIには、POがサプライヤーに再送信される結果(品目の新しい品目や変更された数量など)になるか、変更が内部で行われる(勘定科目コードの変更など)かにかかわらず、POの変更ごとにレコードが含まれます。

APIの構造は発注書APIと似ていますが、主に次の3つの違いがあります。

1.レコードに「revision-record」要素が含まれる。これには、このレコードで取得された特定の「内部修正」またはPOの変更に関する情報が含まれます。
2.少数の例外を除き、フィールドが変更されたフィールドのみが表示されます。変更に関係なく表示されるフィールドは、PO ID、PO品目ID、または追加または削除された場合に「true」と表示されるおよびフィールドのみです。
3. PO IDまたはPO品目ID以外の各フィールド要素には、の2つの新しい要素が含まれます。フィールドには、この改訂で作成または更新された新しい値が含まれ、フィールドには以前の改訂の値が含まれます。 これについては、以下の「フィールド定義」セクションで詳しく説明します。

発注書にアクセスするためのURLは次のとおりです。 https://<instance>/api/purchase_order_revisions

Coupa 16

アクション

Coupaの発注書の改訂APIを使用すると、次のことができます。

 

以下は、発注書改訂APIで使用できる列です。これらは注文ヘッダーと同じです。

 

Coupa 15

Coupa 14ファイルがまだ必要な場合は、ダウンロードしてください。

  • リリース15のフラットファイルインテグレーションエクスポートフォーマット
  • リリース15のフラットファイルインテグレーションインポートフォーマット

検索基準

クエリパラメーターの「ベース」パスは、改訂レコード要素内にあります。id=123を渡すと、PO 123の修正記録ではなく、ID 123の修正記録が取得されます。特定のPOを検索するには、「purchase_order_id」の特別なパラメーターを使用し、値を目的の発注書番号に設定する必要があります。

参照オブジェクト 検索基準オプション
発注書ID 発注書ID
内部修正番号 修正
変更が行われた日付 created-at

 

フィールド定義

自動調整オブジェクトであるおよびフィールドには、完全な自動調整オブジェクトが含まれます。

簡易フィールド更新

<?xml version="1.0" encoding="UTF-8"?>
<status>
	 <from type="string">draft</from>
	 <to type="string">created</to>
</status> 

関連フィールドの更新

<?xml version="1.0" encoding="UTF-8"?>
<updated-by>
	 <from>
			<id type="integer">37</id>
			<login>test_user@coupa.com</login>
			<email>test_user@coupa.com</email>
			<employee-number />
			<firstname>Test</firstname>
			<lastname>User</lastname>
			<salesforce-id nil="true" />
			<custom_field_on_the_user>ABC</custom_field_on_the_user>
	 </from>
	 <to>
			<id type="integer">24</id>
			<login>update_user@coupa.com</login>
			<email>update_user@coupa.com</email>
			<employee-number />
			<firstname>Update</firstname>
			<lastname>User</lastname>
			<salesforce-id nil="true" />
			<custom_field_on_the_user>DEF</custom_field_on_the_user>
	 </to>
</updated-by> 

サンプルAPI GET応答

<?xml version="1.0" encoding="UTF-8"?>
<order-header-revision>
	 <revision-record>
			<revision type="integer">1</revision>
			<id type="integer">30</id>
			<created-at type="datetime">2010-12-11T14:27:15-08:00</created-at>
			<created-by type="integer">1</created-by>
	 </revision-record>
	 <comments />
	 <test-text-field>
			<from type="string">test_receipts</from>
			<to type="string" />
	 </test-text-field>
	 <id type="integer">2143</id>
	 <order-lines>
			<order-line>
				 <testfield>
						<from type="string" />
						<to type="string" />
				 </testfield>
				 <id type="integer">3060</id>
				 <line-num type="integer">1</line-num>
				 <need-by-date>
						<from type="datetime">2010-07-23T07:00:00-07:00</from>
						<to type="datetime">2010-07-23T00:00:00-07:00</to>
				 </need-by-date>
				 <source-part-num>
						<from type="string" />
						<to type="string" />
				 </source-part-num>
				 <updated-at>
						<from type="datetime">2010-12-10T20:40:45-08:00</from>
						<to type="datetime">2010-12-11T14:27:13-08:00</to>
				 </updated-at>
				 <updated-by>
						<from>
							 <email>matt.support+supportAPI@coupa.com</email>
							 <employee-number nil="true" />
							 <firstname>Matt</firstname>
							 <id type="integer">44</id>
							 <lastname>Support</lastname>
							 <login>matt.support+supportAPI@coupa.com</login>
						</from>
						<to>
							 <email>upgrade@coupa.com</email>
							 <employee-number />
							 <firstname>Coupa</firstname>
							 <id type="integer">1</id>
							 <lastname>Support</lastname>
							 <login>coupasupport</login>
						</to>
				 </updated-by>
			</order-line>
			<order-line>
				 <testfield>
						<from type="string" />
						<to type="string" />
				 </testfield>
				 <id type="integer">3061</id>
				 <line-num type="integer">2</line-num>
				 <need-by-date>
						<from type="datetime">2010-12-11T04:40:42-08:00</from>
						<to type="datetime">2010-12-11T00:00:00-08:00</to>
				 </need-by-date>
				 <source-part-num>
						<from type="string" />
						<to type="string" />
				 </source-part-num>
				 <updated-at>
						<from type="datetime">2010-12-10T20:40:45-08:00</from>
						<to type="datetime">2010-12-11T14:27:13-08:00</to>
				 </updated-at>
				 <updated-by>
						<from>
							 <email>matt.support+supportAPI@coupa.com</email>
							 <employee-number nil="true" />
							 <firstname>Matt</firstname>
							 <id type="integer">44</id>
							 <lastname>Support</lastname>
							 <login>matt.support+supportAPI@coupa.com</login>
						</from>
						<to>
							 <email>upgrade@coupa.com</email>
							 <employee-number />
							 <firstname>Coupa</firstname>
							 <id type="integer">1</id>
							 <lastname>Support</lastname>
							 <login>coupasupport</login>
						</to>
				 </updated-by>
			</order-line>
	 </order-lines>
	 <ship-to-user>
			<from>
				 <email>coupauser+2010-12-10T20:40:37-0800@coupa.com</email>
				 <employee-number nil="true" />
				 <firstname>Test</firstname>
				 <id type="integer">144</id>
				 <lastname>Account</lastname>
				 <login>query_user_2010-12-10T20:40:37-0800</login>
			</from>
			<to>
				 <email>coupauser+2010-12-10T17:48:07-0800@coupa.com</email>
				 <employee-number />
				 <firstname>Test</firstname>
				 <id type="integer">45</id>
				 <lastname>Account</lastname>
				 <login>flow_user_2010-12-10T17:48:07-0800</login>
			</to>
	 </ship-to-user>
	 <updated-at>
			<from type="datetime">2010-12-10T20:40:46-08:00</from>
			<to type="datetime">2010-12-11T14:27:14-08:00</to>
	 </updated-at>
	 <updated-by>
			<from>
				 <email>matt.support+supportAPI@coupa.com</email>
				 <employee-number nil="true" />
				 <firstname>Matt</firstname>
				 <id type="integer">44</id>
				 <lastname>Support</lastname>
				 <login>matt.Support+supportAPI@coupa.com</login>
			</from>
			<to>
				 <email>upgrade@coupa.com</email>
				 <employee-number />
				 <firstname>Coupa</firstname>
				 <id type="integer">1</id>
				 <lastname>Support</lastname>
				 <login>coupasupport</login>
			</to>
	 </updated-by>
	 <version>
			<from type="integer">1</from>
			<to type="integer">2</to>
	 </version>
</order-header-revision> 

 

このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。

関連アイテム


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エンドポイントを整理しました。