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

 

 

Coupa Japanese

サプライヤーAPIの呼び出し例

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


サプライヤークエリオプションを取得

サプライヤーAPIを使用して必要な結果セットをクエリして取得する方法の例を以下に示します。

このクエリは、cXMLに設定されたPOメソッドを持つすべてのサプライヤーを返します:https://<instance url>/api/suppliers?po-method=cxml

このクエリは、支払期間が30日であるすべてのサプライヤーを返します。
https://<instance url>/api/suppliers?payment-term[code]=Net+30
 
このクエリは、請求から10日以内で、サプライヤーが現在システムで有効な場合、支払割引が適用されるすべてのサプライヤーを返します<b id="i2"><a id="x2" xid="i7.1.1">。</a></b>https://<instance url>/api/suppliers?payment-term[days-for-discount-payment]=10&status=active
 
このクエリは、2010年1月1日12:00:00以降に作成されたすべてのサプライヤーを返します:https://<instance url>/api/suppliers?created-at[gt]=2010-01-01T12:00:00
 
このクエリは、POメソッドがcXMLに設定され、購入者のドメイン値に "domain"という単語が含まれるすべてのサプライヤーを返します<b id="i4"><a id="x4" xid="i9.1.1">。</a></b>https://<instance url>/api/suppliers?po-method=cxml&cxml-domain[contains]=domain
 
このクエリは、cXML請求が許可されているすべてのサプライヤーを返します。サプライヤードメイン値のcXML請求書設定に「サプライヤー」という単語が含まれています<b id="i5"><a id="x5" xid="i10.1.1">。</a></b>https://<instance>.coupahost.com/api/suppliers?allow-cxml-invoicing=true&cxml-supplier-domain[contains]=supplier
 
このクエリは、その主な連絡先のメール値「coupa.com」と市がチャールストンであるサプライヤーアドレスが含まれているすべてのサプライヤーが返されます:https://<instance url>/api/suppliers?primary-contact[email][contains]=coupa.com&primary-address[city]=Charleston
 
このクエリは、システムに少なくとも5つのユーザーレビューを持つすべてのサプライヤーを返します。   https://<instance url>/api/suppliers?reviews-count[gt]=5
 

サプライヤーを取得

この例では、IDが6の単一のサプライヤーレコードを照会しました。

URLにGETを行いました:

https://<instance url>/api/suppliers/6
あるいは
https://<instance url>/api/suppliers?id=6


検索条件に一致する応答は次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<suppliers type="array">
  <supplier>
    <id type="integer">6</id>
    <created-at type="datetime">2008-10-27T12:56:39-07:00</created-at>
    <updated-at type="datetime">2009-07-01T11:59:33-07:00</updated-at>
    <name>VWR</name>
    <number></number>
    <status>active</status>
    <website></website>
    <po-method>cxml</po-method>
    <cxml-url>http://www.dummy.com</cxml-url>
    <cxml-domain>http://demo.coupahost.com</cxml-domain>
    <cxml-identity>Coupa</cxml-identity>
    <cxml-supplier-domain>http://www.vwr.com</cxml-supplier-domain>
    <cxml-supplier-identity>VWR-Test</cxml-supplier-identity>
    <cxml-secret>test</cxml-secret>
    <cxml-protocol>cXML</cxml-protocol>
    <po-email>upgrade@coupa.com</po-email>
    <account-number></account-number>
    <duns></duns>
    <tax-id></tax-id>
    <coupa-connect-secret></coupa-connect-secret>
    <invoice-matching-level>2-ay</invoice-matching-level>
    <primary-contact>
      <email>upgrade@coupa.com</email>
      <id type="integer">6</id>
      <name-additional nil="true"></name-additional>
      <name-family>Frontage</name-family>
      <name-fullname nil="true"></name-fullname>
      <name-given>Dawn</name-given>
      <name-prefix nil="true"></name-prefix>
      <name-suffix nil="true"></name-suffix>
      <notes nil="true"></notes>
    </primary-contact>
    <primary-address>
      <attention nil="true"></attention>
      <city>Portland</city>
      <id type="integer">6</id>
      <name>VWR</name>
      <postal-code>82323</postal-code>
      <state>OR</state>
      <street1>09 Addison Ave</street1>
      <street2></street2>
      <country>
        <code>US</code>
        <id type="integer">223</id>
        <name>United States</name>
      </country>
    </primary-address>
    <payment-term>
      <code>2/10 Net 30</code>
      <days-for-discount-payment type="integer">10</days-for-discount-payment>
      <days-for-net-payment type="integer">30</days-for-net-payment>
      <discount-rate type="float">2.0</discount-rate>
      <id type="integer">3</id>
    </payment-term>
  </supplier>
</suppliers>

サプライヤー作成-有効かつ詳細

この例では、アクティブなサプライヤーを作成しています。参照オブジェクトにCoupaシステムIDを使用していません。

<b id="i7"><a id="x7" xid="i22.1.1">URL []に</a></b>投稿しました。https://<instance url>/api/suppliers.

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <name>CDW</name>
   <number>cdw2323</number>
   <status>active</status>
   <po-method>prompt</po-method>
   <po-email />
   <account-number>2323</account-number>
   <duns />
   <tax-id>283923</tax-id>
   <invoice-matching-level>3-way</invoice-matching-level>
   <payment-term>
      <code>Net 30</code>
   </payment-term>
   <primary-contact>
      <email>joe.smith@cdw.com</email>
      <name-family>Smith</name-family>
      <name-given>Joe</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>4442932</number>
      </phone-work>
      <phone-mobile>
         <area-code nil="true" />
         <country-code>1</country-code>
         <extension nil="true" />
         <number />
      </phone-mobile>
      <phone-fax>
         <area-code nil="true" />
         <country-code>1</country-code>
         <extension nil="true" />
         <number />
      </phone-fax>
   </primary-contact>
   <primary_address>
      <street1>1234 Concur Drive</street1>
      <street2 />
      <city>San Mateo</city>
      <state>CA</state>
      <postal_code>93325</postal_code>
      <country>
         <code>US</code>
      </country>
   </primary_address>
</supplier>

サプライヤー作成-ドラフトおよび基本

この例では、ドラフトサプライヤーを作成しています。参照オブジェクトにCoupaシステムIDを使用していません。

次のURLに投稿しました:https://<instance url>/api/suppliers.  This created the supplier in a draft status.

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <name>CDW</name>
   <po-method>prompt</po-method>
   <account-number>2323</account-number>
   <duns />
   <tax-id />
   <invoice-matching-level>3-way</invoice-matching-level>
   <payment-term>
      <code>Net 30</code>
   </payment-term>
</supplier> 

サプライヤーの更新-完全更新

これらの例では、サプライヤーレコードの異なる情報を更新しています。

次のURLにPUTを実行しました:https://<instance url>/api/suppliers/<supplier id> 

たとえば、サプライヤーID 83のサプライヤーのPOメソッドをcXMLに更新するには、次のように入力します。

URL:https://<instance url>/api/suppliers/83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <po-method>cxml</po-method>
   <cxml-url>https://testurl.com</cxml-url>
   <cxml-domain>NetworkID</cxml-domain>
   <cxml-identity>coupa</cxml-identity>
   <cxml-supplier-domain>NetworkID</cxml-supplier-domain>
   <cxml-supplier-identity>supplierID1</cxml-supplier-identity>
   <cxml-secret>shhhhh</cxml-secret>
   <cxml-protocol>cxml</cxml-protocol>
</supplier>

たとえば、サプライヤーの主要連絡先情報とサプライヤーID 83の他のいくつかのサプライヤープロファイル情報を更新するには、次のように入力します。

URL:https://<instance url>/api/suppliers/83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <account-number>123456</account-number>
   <duns>DUNS-123</duns>
   <tax-id>taxid-123</tax-id>
   <invoice-matching-level>none</invoice-matching-level>
   <primary-contact>
      <email>supplier@test.com</email>
      <name-family>Donovan</name-family>
      <name-given>Fred</name-given>
      <phone-work>
         <area-code>415</area-code>
         <country-code>1</country-code>
         <extension nil="true" />
         <number>4471010</number>
      </phone-work>
      <phone-fax>
         <area-code>415</area-code>
         <country-code>1</country-code>
         <extension nil="true" />
         <number>4471012</number>
      </phone-fax>
   </primary-contact>
</supplier> 

たとえば、サプライヤーID 83の住所更新を含むサプライヤープロファイルを更新するには、次のようにします。

URL:https://<instance url>/api/suppliers/83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <name>Petra (US)</name>
   <number>1-112</number>
   <primary-address>
      <street1>425 Market Street # 2250</street1>
      <street2 />
      <city>San Francisco</city>
      <state>CA</state>
      <postal_code>94105</postal_code>
      <country>
         <code>US</code>
      </country>
   </primary-address>
</supplier>

たとえば、サプライヤーID 83の支払条件と発送条件を更新するには、次のように入力します。

URL:https://<instance url>/api/suppliers/83

<supplier>
 <shipping-term>
  <id>1</id>
</shipping-term>
 <payment-term>
  <id>5<id>
 </payment-term>
</supplier>

サプライヤーの更新-単純な更新

これらの例では、サプライヤーレコードの単一の属性を更新しています。

次のURLにPUTを実行しました:https://<instance url>/api/suppliers/<supplier id> 

たとえば、サプライヤーIDが83のサプライヤーのサプライヤーステータスを無効に更新するには、次のように入力します。

サプライヤーの更新-非アクティブに設定

urlhttps://<instance url>/api/suppliers/83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <status>inactive</status>
</supplier>

たとえば、サプライヤーのPOメソッドを更新して、サプライヤーIDが83のプロンプトを表示するには、次のようにします。

サプライヤーの更新-PO方法の変更

URL:https://<instance url> / api / suppliers / 83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <po-method>prompt</po-method>
</supplier> 

たとえば、主要サプライヤー連絡先のメールアドレスをサプライヤーID 83で更新するには:

サプライヤーの更新-連絡先メールアドレスの変更

URL:https://<instance url>/api/suppliers/83

<?xml version="1.0" encoding="UTF-8"?>
<supplier>
   <primary-contact>
      <email>test@test.com</email>
   </primary-contact>
</supplier>

 

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