発注書の改訂APIの呼び出しの例

概要

発注書の改訂APIを使用すると、発注書の変更履歴へのアクセスを読み取ることができます。このAPIには、発注書への各変更のレコードが含まれています。変更が発注書がサプライヤーに再送信されるかどうか(新しい明細行や明細行の変更された数量など)、または変更が内部の場合(アカウントコードの変更など)です。

APIは、3つの主な違いがあるため、発注書APIと構造が似ています。

1.このレコードには「revision - record」要素が含まれています。これには、このレコードにキャプチャされた特定の「内部改訂」またはPOへの変更に関する情報が含まれています。
2.少数の例外を除き、フィールドが変更されたフィールドのみが表示されます。変更に関係なく表示されるフィールドは、PO ID、POラインID、または追加または削除された場合に「true」<created/>と表示されると<deleted/>フィールドのみです。
3.各非発注IDまたは発注明細IDフィールド要素には、2つの新しい要素<from/>とが含まれてい<to/>ます。<to/> フィールドには、この改訂で作成または更新された新しい値が含まれますが、<from/>フィールドには前回の改訂の値が含まれます。これについては、以下のフィールド定義セクションで詳細を説明します。

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

Coupa 16

アクション

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

 

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

 

Coupa 15

それでも必要な場合は、Coupa 14ファイルをダウンロードしてください。

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

検索基準

クエリパラメータの'base'パスは、revision - record要素内にあります。Id = 1 2 3を渡すことは、PO 1 2 3の改訂レコードではなく、ID 1 2 3を有する改訂レコードを引き出すことになる。特定のPOを検索するには、特別なパラメータ"purchase_order_id"を使用し、値を希望する発注書番号に設定する必要があります。

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

 

フィールド定義

<to/> および関連オブジェクトである<from/>フィールドには、完全な関連オブジェクトが含まれます。

単純フィールドの更新

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

<status>

	 <from type="string">ドラフト</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>テスト</firstname>

			<lastname>ユーザー</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>更新</firstname>

			<lastname>ユーザー</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>

			2010 <created-at type="datetime">-12 -11 T 14: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 -23 T 07:00:00 - 07:00</from>

						2010 <to type="datetime">-07 -23 T 00:00:00 - 07:00</to>

				 </need-by-date>

				 <source-part-num>

						<from type="string" />

						<to type="string" />

				 </source-part-num>

				 <updated-at>

						2010 <from type="datetime">-12 -10 T 20:40:45 - 08:00</from>

						2010 <to type="datetime">-12 -11 T 14: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>サポート</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>サポート</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>

						2010 <from type="datetime">-12 -11 T 04:40:42 - 08:00</from>

						2010 <to type="datetime">-12 -11 T 00:00:00 - 08:00</to>

				 </need-by-date>

				 <source-part-num>

						<from type="string" />

						<to type="string" />

				 </source-part-num>

				 <updated-at>

						2010 <from type="datetime">-12 -10 T 20:40:45 - 08:00</from>

						2010 <to type="datetime">-12 -11 T 14: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>サポート</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>サポート</lastname>

							 <login>coupasupport</login>

						</to>

				 </updated-by>

			</order-line>

	 </order-lines>

	 <ship-to-user>

			<from>

				 <email>coupauser +2010 -12 -10 T 20:40:37 -0800@coupa.com</email>

				 <employee-number nil="true" />

				 <firstname>テスト</firstname>

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

				 <lastname>勘定科目</lastname>

				 <login>query_user_2010 -12 -10 T 20:40:37 -0800</login>

			</from>

			<to>

				 <email>coupauser +2010 -12 -10 T 17:48:07 -0800@coupa.com</email>

				 <employee-number />

				 <firstname>テスト</firstname>

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

				 <lastname>勘定科目</lastname>

				 <login>flow_user_2010 -12 -10 T 17:48:07 -0800</login>

			</to>

	 </ship-to-user>

	 <updated-at>

			2010 <from type="datetime">-12 -10 T 20:40:46 - 08:00</from>

			2010 <to type="datetime">-12 -11 T 14: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>サポート</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>サポート</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エンドポイントを整理しました。