• 最終編集日時: 25 March 2021

会社API

会社APIを使用して、会社データを作成、更新、またはクエリします。

会社APIを使用して、会社データを作成、更新、またはクエリします。 

APIにアクセスするためのURLは次のとおりです。 https://<instance>.cso.coupahost.com/api/companies

詳細については、 「インテグレーションのベストプラクティス 」を参照してください。

アクション

動詞 パス アクション 説明
取得 /api/companies インデックス すべての会社を取得するGetアクションを実行
投稿 /api/companies 作成 1つまたは複数のCompaniesオブジェクトを作成します。
プット /api/companies 更新 1つ以上の会社を更新します。一括更新を実行できます。
取得 /api/companies/:id 表示 会社データを1つ表示します。 
プット /api/companies/:id 更新 IDを使用して一度に1つの会社を更新

要素

以下は会社APIで使用できる要素です

フィールド名 フィールドの説明 必須 一意ですか? 許容値 アウト* タイプ
ID

会社のID

  はい     はい 整数
state 会社のステータス    

Active、Removed(大文字と小文字を区別)

はい はい string型
名前 会社名   はい   はい はい 文字列
電話番号 会社の電話番号       はい はい 文字列
メール 会社のメール       はい はい 文字列
番地 会社の住所の番地       はい はい 文字列
郵便番号 会社の住所の郵便番号の一部       はい はい 文字列
city 会社の住所の市区町村       はい はい string型
会社の住所の国部分       はい はい 文字列
duns-scac 会社のDUNS SCACコード。       はい はい 文字列
キーワード 会社に関連付けられたキーワード       はい はい 文字列
メモ

 応答ペイロードにnull値が表示されません。

この例では、会社APIについてクエリを実行しました。URLにGETしました: 

https://<instance>.cso.coupahost.com/api/companies 

会社のGET応答

{
		"total": 7,
		"compannies": [
				{
						"id": "9219592888303484960",
						"state": "Active",
						"name": "! New Supplier (Spanish)"
				},
				{
						"id": "9219594398656586067",
						"state": "Active",
						"name": "! Simon Test Organization",
						"email": "simon@kepgames.com"
				},
				{
						"id": "9219592919623127484",
						"state": "Active",
						"name": "! SKF (test bidders)"
				},
				{
						"id": "9219592881350550871",
						"state": "Active",
						"name": "! Spanish bidder",
						"email": "heloisa.spanish@tradeext.com"
				},
				{
						"id": "9219592230193035378",
						"state": "Active",
						"name": "! TE",
						"email": "lorena@te.se",
						"duns-scac": "testing123456789",
						"keywords": "test"
				},
				{
						"id": "9219596145584379778",
						"state": "Active",
						"name": "! TE Test Company"
				},
				{
						"id": "9219592639285418804",
						"state": "Active",
						"name": "! TE Test Company 2",
						"phone-number": "123-234-3456",
						"email": "testcompany2+upg@coupa.com",
						"street": "street address1",
						"zip-code": "12345",
						"city": "valahalla",
						"country": "United States Minor Outlying Islands",
						"keywords": "Carrier"
				}
	 ]
}

作成/更新

以下では、Coupa APIを使用して会社でアクションを実行する方法について説明します。

作成

/api/companies

以下のペイロードは2つの会社を作成します。

Payload: 
{
		"companies": [
				{
						"state": "Active",
						"name": "Yes Heloisa",
						"duns-scac": "Shall be updated"
				},
				{
						"name": "TE Test Company 2",
						"phone-number": "123-234-3456",
						"email": "testcompany2+upg@coupa.com"
				}
		]
}

Response: 201
{
		"result": [
				{
						"type": "api.post.added",
						"description": "2 objects created."
				}
		],
		"added": 2,
		"companies": [
				{
						"id": "9220538753256092391"
				},
				{
						"id": "9220538753250662192"
				}
		]
}	 

更新

/api/companies

以下のペイロードは会社を更新します。 

To update one or more Company at a time: 
Payload:
{
		"companies": [
				{
						"id": "9219594319065198091",
						"state": "Active",
						"name": "! (TE) Heloisa",
						"duns-scac": "Shall be updated"
				},
				{
						"id": "9219596218212801426",
						"state": "Active",
						"name": "! (TE) Org only with bidders (Italian)",
						"duns-scac": "Shall be updated",
						"email": "testbidders_itl@coupa.com"
				},
				{
						"id": "9219596218212801429",
						"state": "Active",
						"name": "! (TE) Org with only bidders",
						"duns-scac": "Shall be updated",
						"keywords": "Bidders"
				}
		]
}

Response: 200 OK
{
		"result": [
				{
						"type": "api.put.updated",
						"description": "3 objects updated."
				}
		],
		"updated": 3
}
メモ

 更新は寛大な方法で行われます。たとえば、1つのリソースの更新に失敗した場合、他のリソースは正常に更新される可能性があります。更新には会社IDが必要です。

成功したリクエストは返り HTTP 200 Responseます。回答の本文には、作成された申請書が含まれます。失敗したリクエストは返 HTTP 400 Bad Requestされる。応答の本文には、XMLとしてフォーマットされた検証エラーが含まれます。

このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。

関連アイテム


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