價格屬於某個商品,決定金額、幣別,以及是單筆(OneTime)還是週期性扣款(Recurring)。amount 是整數:像 TWD 這種沒有小數位的幣別,amount 就是金額本身。
GET/api/Price— 列出價格,可用 productId 篩選
| 屬性 | 值 |
|---|
| 所需權限 | prices:read |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
page | query | integer (int32) | |
pageSize | query | integer (int32) | |
orderBy | query | string | |
orderDirection | query | string | |
createdFrom | query | string (date-time) | |
createdTo | query | string (date-time) | |
productId | query | string | |
POST/api/Price— 為某個商品建立一個新價格
| 屬性 | 值 |
|---|
| 所需權限 | prices:write |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
active | body | boolean | |
amount | body | integer (int32) | |
currency | body | string | |
interval | body | string | |
intervalCount | body | integer (int32) | |
productId | body | string | |
trialDays | body | integer (int32) | |
type | body | string | |
GET/api/Price/{priceId}— 讀取單一價格
| 屬性 | 值 |
|---|
| 所需權限 | prices:read |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
priceId | path | string | 必填 |
PUT/api/Price/{priceId}— 更新價格。
| 屬性 | 值 |
|---|
| 所需權限 | prices:write |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
priceId | path | string | 必填 |
active | body | boolean | |
GET/api/Price/{priceId}/EntitlementPolicy— 價格:EntitlementPolicy。
| 屬性 | 值 |
|---|
| 所需權限 | entitlements:read |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
priceId | path | string | 必填 |
page | query | integer (int32) | |
pageSize | query | integer (int32) | |
orderBy | query | string | |
orderDirection | query | string | |
createdFrom | query | string (date-time) | |
createdTo | query | string (date-time) | |
POST/api/Price/{priceId}/EntitlementPolicy— 價格:EntitlementPolicy。
| 屬性 | 值 |
|---|
| 所需權限 | entitlements:write |
| Idempotency-Key | 不需要 |
| 參數 | 位置 | 型別 | 必填 |
|---|
priceId | path | string | 必填 |
allowed | body | string | |
creditGrantAmount | body | integer (int32) | |
limit | body | integer (int32) | |
limitAmount | body | integer (int32) | |