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

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

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

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

このクエリは、ネット30の支払期間を持つすべて<instance url>のサプライヤーを返します: https :///api<instance url>/suppliers?
 
payment - term [days - for - discount - payment] = 10 & status = active

 
このクエリは、1月1日以降に作成されたすべてのサプライヤーを返します。2010 12:00:00: https :// api<instance url>/suppliers? created - at [gt] = 2010 -01 -01 T 12:00:00
 
このクエリは、POメソッドがcXMLに設定されており、バイヤードメイン値に「ドメイン」という単語が含まれているすべてのサプライヤーを返します。https :// api<instance url>/suppliers? po - method = cxml&cxml - domain [contains ]= domain
 
このクエリは、cXML請求が許可されており、サプライヤードメイン値のcXMLインボイス設定に「サプライヤー」という単語が含まれているすべてのサプライヤーを返します。https ://.coupahost.com/api/suppliers?allow-cxml-invoicing=true&cxml-supplier-domain [contains ]= supplier
 
このクエリは、プライマリコンタクト電子<instance>メールに次の単語が含まれているすべてのサプライヤーを返します。value "coupa.com" and the supplier address where the city is Charleston: https :///api<instance url>/suppliers? primary - contact [email] [contains] = coupa.com&primary - address [city] = Charleston
 
このクエリは、システムに5つ以上のユーザーレビューを持つすべてのサプライヤーを返します。https ://<instance url>/api/suppliers? reviews - count [gt] = 5
 

サプライヤーを取得

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

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

https :///api<instance url>/suppliers/6
または
https :///api<instance url>/suppliers? id = 6

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

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

<suppliers type="array">

	<supplier>

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

		2008 <created-at type="datetime">-10 -27 T 12:56:39 - 07:00</created-at>

		2009 <updated-at type="datetime">-07 -01 T 11: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>テスト</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>

		2 -<invoice-matching-level> 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>夜明け</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>ポートランド</city>

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

			<name>VWR</name>

			<postal-code>82323</postal-code>

			<state>または</state>

			<street1>09 Addison Ave</street1>

			<street2></street2>

			<country>

				<code>US</code>

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

				<name>米国</name>

			</country>

		</primary-address>

		<payment-term>

			<code>2/10 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を使用していません。

次のURLに投稿しました: https ://<instance url>/api/suppliers.

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

<supplier>

	 <name>CDW</name>

	 <number>cdw 2323</number>

	 <status>active</status>

	 <po-method>プロンプト</po-method>

	 <po-email />

	 <account-number>2323</account-number>

	 <duns />

	 <tax-id>283923</tax-id>

	 <invoice-matching-level>3点</invoice-matching-level>

	 <payment-term>

			<code>30日以内の支払い</code>

	 </payment-term>

	 <primary-contact>

			<email>joe.smith@cdw.com</email>

			<name-family>スミス</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>サンマテオ</city>

			<state>カナダ</state>

			<postal_code>93325</postal_code>

			<country>

				 <code>米国</code>

			</country>

	 </primary_address>

</supplier>

サプライヤー作成-ドラフトとベーシック

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

次のURLに投稿しました: https ://<instance url>/api/suppliers.これにより、サプライヤーがドラフト状態になりました。

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

<supplier>

	 <name>CDW</name>

	 <po-method>プロンプト</po-method>

	 <account-number>2323</account-number>

	 <duns />

	 <tax-id />

	 <invoice-matching-level>3点</invoice-matching-level>

	 <payment-term>

			<code>30日以内の支払い</code>

	 </payment-term>

</supplier> 

サプライヤーを更新-完全な更新

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

次のURLに置きました: https ://<instance url>/api/suppliers/<supplier id> 

たとえば、サプライヤーID 83用にサプライヤーの発注書方法を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>ID</cxml-domain>

	 <cxml-identity>coupa</cxml-identity>

	 ネットワーク<cxml-supplier-domain>ID</cxml-supplier-domain>

	 サプライヤーID<cxml-supplier-identity> 1</cxml-supplier-identity>

	 <cxml-secret>シーーーー</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>なし</invoice-matching-level>

	 <primary-contact>

			<email>supplier@test.com</email>

			<name-family>ドノヴァン</name-family>

			<name-given>フレッド</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>ペトラ(US)</name>

	 1 <number>-112</number>

	 <primary-address>

			<street1>425 Market Street # 2250</street1>

			<street2 />

			<city>サンフランシスコ</city>

			<state>カナダ</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に置きました:  https ://<instance url>/api/suppliers/<supplier id> 

たとえば、サプライヤーID 83のサプライヤーのサプライヤーステータスを非アクティブにアップデートするには:

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

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

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

<supplier>

	 <status>非有効</status>

</supplier>

たとえば、サプライヤーID 83でプロンプトを表示するようにサプライヤーPOメソッドを更新するには:

サプライヤーを更新-発注方法を変更

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

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

<supplier>

	 <po-method>プロンプト</po-method>

</supplier> 

たとえば、主要サプライヤー担当者のEメールアドレスをサプライヤー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>

 

関連アイテム


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