支払先住所APIコールの例
支払先住所の異なるクエリオプション
経費レポートAPIを使用して、必要な結果セットをクエリして取得する方法の例を以下に示します。
このクエリは、特定の金額より大きい合計の経費レポートを提供します
https://<instance>.coupahost.com/api/expense_reports?total[gt]=800
このクエリは、ログイン= coupasupportで特定のユーザーによって更新された支払先住所を提供します
https://<instance>.coupahost.com/api/suppliers/1/addresses?updated_by[login]=coupasupport
このクエリは、2010年3月1日以降に作成されたすべての支払先住所を提供します
https://<instance>.coupahost.com/api/suppliers/1/addresses?created-at[gt]=2010-03-01T12:00:00
このクエリにより、すべての支払先住所の国コードが米国になります
https://<instance>.coupahost.com/api/suppliers/1/addresses?country[code]=US
単一の支払先住所を取得
この例では、IDが492の支払先住所を1つ検索しました
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-02T15:23:59-07:00</created-at>
<updated-at type="datetime">2014-04-03T09:04:07-07:00</updated-at>
<remit-to-code>REMIT1</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>United States</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に投稿しました:これにより、https://<instance url>/api/suppliers/<supplier id>/addresses/.
有効なステータスの支払先住所が作成されました。
支払先住所を作成するコード例
<?xml version="1.0" encoding="UTF-8"?>
<remit-to-address>
<remit-to-code>REMIT2</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にPUTを行いました: https://instance.coupahost.com/api/expense_reports/<id>
たとえば、ID 1のサプライヤーのID 495の支払先住所のステータスを更新するには、
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>REMIT5</remit-to-code>
</remit-to-address>
このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。