支払先住所APIコールの例

支払先住所のさまざまなクエリオプション

以下は、経費レポートAPIを使用して、希望する結果セットを取得するための使用例です。

このクエリは、合計金額が一定額を超える経費レポートを取得します

https ://<instance>[gt] = 800

このクエリは、ログイン名が「coupasupport」のユーザーによって更新された支払先住所を取得します

https ://<instance>[login ]= coupasupport

このクエリは、2010年3月1日以降に作成されたすべての支払先住所を取得します

https ://<instance>.coupahost.com/api/suppliers/1/addresses?created-at [gt] = 2010 -03 -01 T 12:00:00

このクエリは、国コードが「US」のすべての支払先住所を取得します

https ://<instance>[code] = US

単一の支払先住所の取得

この例では、IDが492の単一の支払先住所をクエリしています

以下のURLに対してGETリクエストを実行しました。

https ://<instance>.coupahost.com/api/suppliers/1/addresses/492

または

https ://<instance>.coupahost.com/api/suppliers/1/addresses?id=492

結果:

支払先住所のクエリ結果サンプル
<?xml version="1.0" encoding="UTF-8"?> <remit-to-address> <id type="integer">492</id> <created-at type="datetime">2014 -04 -02 T 15:23:59 - 07:00</created-at> <updated-at type="datetime">2014 -04 -03 T 09:04:07 - 07:00</updated-at> <remit-to-code>REMIT 1</remit-to-code> <name>Test Remit Address</name> <street1>123 test street</street1> <street2>testing</street2> <city>Pleasanton</city> <state>CA</state> <postal-code>94566</postal-code> <active type="boolean">true</active> <country> <id type="integer">223</id> <code>US</code> <name>米国</name> </country> <created-by> <id type="integer">1</id> <login>coupasupport</login> <email>upgrade@coupa.com</email> <employee-number /> <firstname>Coupa</firstname> <lastname>Support</lastname> <salesforce-id nil="true" /> <mycustom-userfield /> </created-by> <updated-by> <id type="integer">1</id> <login>coupasupport</login> <email>upgrade@coupa.com</email> <employee-number /> <firstname>Coupa</firstname> <lastname>Support</lastname> <salesforce-id nil="true" /> <mycustom-userfield /> </updated-by> </remit-to-address>

支払先住所の作成

この例では、ID「1」のサプライヤーに対して、ステータスが「アクティブ」の支払先住所を作成しています。 参照として、CoupaシステムのサプライヤーIDを使用しています。

以下のURLに対してPOSTリクエストを送信しました。
https ://<instance url>/api/suppliers/<supplier id>/addresses /.
これにより、ステータスが「アクティブ」の支払先住所が作成されました。
送金先住所を作成するためのコード例
<?xml version="1.0" encoding="UTF-8"?> <remit-to-address> <remit-to-code>REMIT</remit-to-code> <name>Test Remit Address</name> <street1>123 test street</street1> <street2>testing</street2> <city>Pleasanton</city> <state>CA</state> <postal-code>94566</postal-code> <active>true</active> <country> <name>United States</name> </country> </remit-to-address>

支払先住所の更新

以下の例では、単一の支払先住所レコードを更新しています。

私たちはURLに置きました: https://instance.coupahost.com/api/expense_reports/<id>

たとえば、サプライヤーID「1」の支払先住所ID「495」のステータスを更新するには、以下のURLを使用します

URL: https://instance.coupahost.com/api/s.../addresses/495

送金先住所のステータスを更新するためのサンプルコード
<?xml version="1.0" encoding="UTF-8"?> <remit-to-address> <active>true</active> </remit-to-address>

たとえば、支払先住所ID「495」の送金コードを更新するには、以下を使用します

支払先住所の支払先コードを更新するためのサンプルコード
<?xml version="1.0" encoding="UTF-8"?> <remit-to-address> <remit-to-code>5</remit-to-code> </remit-to-address>