Remit to Addresses APIのサンプルコール
このページは機械翻訳を使用して翻訳されています。
住所に送金するためのさまざまなクエリオプション
経費レポートAPIを使用してクエリを実行し、必要な結果セットを取得する方法の例を以下に示します。
このクエリは、合計が特定の金額を超える経費レポートを提供します
https://<instance>.coupahost.com/api/expense_reports?total[gt]=800
このクエリは、Login = 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
このクエリは、国コードUSの住所へのすべての送金を提供します。
https://<instance>.coupahost.com/api/suppliers/1/addresses?country[code]=US
単一の支払先住所を取得
この例では、492のIDで対処する単一の支払を照会しました。
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>