メインコンテンツまでスキップ

 

 

Coupa Japanese

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

このページは機械翻訳を使用して翻訳されています。


概要

発注書改訂APIを使用すると、PO変更履歴への読み取りアクセスが可能になります。このAPIには、POへの各変更のレコードが含まれます。変更の結果、POがサプライヤーに再送信されるか(新規品目または品目の修正数量など)、内部で変更された場合(アカウントコードの変更など)に関係します。

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

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

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

クーパ16

アクション

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

 

これらは、発注書改訂APIに利用可能な列です。これらは注文ヘッダーと同じです。

 

クーパ15

それでも必要な場合は、Coupa 14ファイルをダウンロードします。

  • リリース15フラットファイル統合エクスポートフォーマット
  • Release 14 Flat File Integration Import Format.xlsx

検索基準

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

参照オブジェクト 検索基準オプション
注文番号%{id} Purchase_order_id
内部改訂番号 修正
変更が行われた日付 created-at

 

フィールド定義

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

単純なフィールド更新

<?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> 

 

  • この記事は役に立ちましたか?