openapi: 3.0.1 servers: - url: http://pay.agribus-connect.net description: Generated server url security: - bearerAuth: [] tags: - name: V1Stripe description: Stripe関係のAPI - name: V1Pay description: 課金関連のAPI - name: V1MarketMonitor description: マーケット情報 (AgriBus-DWH) 連携API - name: V1Google description: Google関係のAPI - name: V1Navi description: Navi関係のAPI paths: /v1/stripe/subscriptions/{subscriptionId}/{planId}: put: tags: - V1Stripe description: プランのアップグレード/ダウングレード operationId: changePlan parameters: - name: subscriptionId in: path required: true schema: type: string - name: planId in: path required: true schema: type: string responses: "200": description: OK /v1/stripe/subscriptions/payment_method/{subscriptionId}/{paymentMethodType}: put: tags: - V1Stripe description: 支払い方法の変更 operationId: changePaymentMethodType parameters: - name: subscriptionId in: path required: true schema: type: string - name: paymentMethodType in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/AddCardRequest' required: true responses: "200": description: OK /v1/stripe/customer/name: put: tags: - V1Stripe description: Customerの名前更新 operationId: updateCustomerName requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateStripeCustomerNameRequest' required: true responses: "200": description: OK /v1/stripe/customer/email: put: tags: - V1Stripe description: Customerのメールアドレス更新 operationId: updateCustomerEmail requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateStripeCustomerEmailRequest' required: true responses: "200": description: OK /v1/stripe/card/{cardId}: put: tags: - V1Stripe description: Stripeで利用するデフォルトのクレカを選択します operationId: selectCard parameters: - name: cardId in: path required: true schema: type: string responses: "200": description: OK delete: tags: - V1Stripe description: Stripeからクレカを削除します operationId: deleteCard parameters: - name: cardId in: path required: true schema: type: string responses: "200": description: OK /v1/navi/status/purchase/{deviceId}: put: tags: - V1Navi description: NAVI端末内のGoogle課金情報を保存する operationId: saveAndroidPurchases parameters: - name: deviceId in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/AndroidPurchases' required: true responses: "200": description: OK /v1/stripe/subscriptions/{subscriptionId}: post: tags: - V1Stripe description: サブスクリプションを解約します。トライアル期間中は即時解約ですが、本契約期間中の途中解約は支払い済みの期間はスタンダード有効であり、期間が終了したら自動終了となります。 operationId: unsubscribe parameters: - name: subscriptionId in: path required: true schema: type: string responses: "200": description: OK /v1/stripe/subscription: post: tags: - V1Stripe description: サブスクリプション開始。 operationId: subscribe requestBody: content: application/json: schema: $ref: '#/components/schemas/StripeSubscribeRequest' required: true responses: "200": description: OK /v1/stripe/card: post: tags: - V1Stripe description: Stripeにクレカを登録します operationId: addCard requestBody: content: application/json: schema: $ref: '#/components/schemas/AddCardRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/StripeInfo' /v1/pay/calculate/functionality: post: tags: - V1Pay description: usernameからFunctionalityを計算し、Authサーバに通知します。 operationId: calculateFunctionality requestBody: content: application/json: schema: $ref: '#/components/schemas/CalculateFunctionalityRequest' required: true responses: "200": description: OK /v1/navi/status/purchase/check: post: tags: - V1Navi description: Google課金情報がすでに存在するかチェックする operationId: checkAndroidPurchases requestBody: content: application/json: schema: $ref: '#/components/schemas/AndroidPurchases' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/CheckAndroidPurchasesResponse' /v1/google/play/rtdn: post: tags: - V1Google description: Googleの課金情報自動同期 operationId: receiveNotification requestBody: content: application/json: schema: type: object additionalProperties: type: string format: 2016-01-01T00:00:00.000Z required: true responses: "200": description: OK /v1/stripe/plans: get: tags: - V1Stripe description: 支払いプランのリストを取得します operationId: listBillingPlans responses: "200": description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/StripePlan' /v1/stripe/invoices: get: tags: - V1Stripe description: 請求情報を取得します operationId: getInvoices responses: "200": description: OK deprecated: true /v1/stripe/invoices/upcoming: get: tags: - V1Stripe description: 現在期間の請求情報を取得します operationId: getInvoicesUpcoming responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/StripeInvoice' deprecated: true /v1/stripe/info: get: tags: - V1Stripe description: Userに紐づいたStripe情報を取得します operationId: getInfo responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/StripeInfo' /v1/stripe/coupons: get: tags: - V1Stripe description: クーポン一覧を取得します operationId: listCoupons responses: "200": description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Coupon' /v1/pay/purchases: get: tags: - V1Pay description: TokenからPurchaseInfoを取得します operationId: getPurchaseInfoFromToken responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/PurchaseInfo' /v1/pay/purchases/{username}: get: tags: - V1Pay description: usernameからPurchaseInfoを取得します operationId: getPurchaseInfoFromUsername parameters: - name: username in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/PurchaseInfo' /v1/market-monitor/feed-access-token: get: tags: - V1MarketMonitor description: ニュースフィード (feed-api) 閲覧用の短命トークンを発行します。無料会員にも発行し、表示範囲は plan claim で feed-api 側が制御します。 operationId: getFeedAccessToken responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/MarketMonitorAccessTokenResponse' /v1/market-monitor/access-token: get: tags: - V1MarketMonitor description: 有料プラン会員に soybean/wheat-monitor 閲覧用の短命トークンを発行します。無料プランは403。 operationId: getMarketMonitorAccessToken responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/MarketMonitorAccessTokenResponse' components: schemas: AddCardRequest: required: - stripeCardName - stripeToken type: object properties: stripeToken: type: string stripeCardName: type: string UpdateStripeCustomerNameRequest: type: object properties: name: type: string UpdateStripeCustomerEmailRequest: type: object properties: email: type: string AndroidPurchase: type: object properties: packageName: type: string orderId: type: string productId: type: string developerPayload: type: string purchaseTime: type: integer format: int64 purchaseState: type: integer format: int32 purchaseToken: type: string purchased: type: boolean testPurchase: type: boolean AndroidPurchases: type: object properties: standardPlan: $ref: '#/components/schemas/AndroidPurchase' StripeSubscribeRequest: required: - addCardRequest - couponCode - paymentMethodTypes - planId type: object properties: addCardRequest: $ref: '#/components/schemas/AddCardRequest' planId: type: string couponCode: type: string paymentMethodTypes: type: string Purchase: type: object properties: billingVendor: type: string enum: - Google - Stripe startedAt: type: string format: 2016-01-01T00:00:00.000Z expiredAt: type: string format: 2016-01-01T00:00:00.000Z planId: type: string orderId: type: string invoiceId: type: string state: type: string enum: - Paid - Trial - NotPaid - Canceled amountPaid: type: integer format: int64 invoiceUrl: type: string currency: type: string autoRenewing: type: boolean collectionMethod: type: string StripeCard: type: object properties: defaultCard: type: boolean id: type: string brand: type: string name: type: string last4: type: string expMonth: type: integer format: int32 expYear: type: integer format: int32 StripeInfo: type: object properties: publishableKey: type: string currency: type: string customerId: type: string cards: type: array items: $ref: '#/components/schemas/StripeCard' purchases: type: array items: $ref: '#/components/schemas/Purchase' name: type: string email: type: string CalculateFunctionalityRequest: type: object properties: username: type: string CheckAndroidPurchasesResponse: type: object properties: exists: type: boolean StripePlan: type: object properties: id: type: string plan: type: string enum: - Free - Standard - Enterprise - Plus - Professional productId: type: string active: type: boolean amount: type: number currency: type: string enum: - jpy - usd interval: type: string enum: - day - week - month - year intervalCount: type: integer format: int64 metadata: type: object additionalProperties: type: string nickname: type: string trialPeriodDays: type: integer format: int64 createdAt: type: string format: 2016-01-01T00:00:00.000Z updatedAt: type: string format: 2016-01-01T00:00:00.000Z StripeInvoice: type: object properties: id: type: string amountPaid: type: integer format: int64 amountDue: type: integer format: int64 amountRemaining: type: integer format: int64 hostedInvoiceUrl: type: string currency: type: string periodStart: type: integer format: int64 periodEnd: type: integer format: int64 maxQuantity: type: integer format: int64 AppliesTo: type: object properties: products: type: array items: type: string lastResponse: $ref: '#/components/schemas/StripeResponse' rawJsonObject: $ref: '#/components/schemas/JsonObject' Coupon: type: object properties: amountOff: type: integer format: int64 appliesTo: $ref: '#/components/schemas/AppliesTo' created: type: integer format: int64 currency: type: string currencyOptions: type: object additionalProperties: $ref: '#/components/schemas/CurrencyOption' deleted: type: boolean duration: type: string durationInMonths: type: integer format: int64 id: type: string livemode: type: boolean maxRedemptions: type: integer format: int64 metadata: type: object additionalProperties: type: string name: type: string object: type: string percentOff: type: number redeemBy: type: integer format: int64 timesRedeemed: type: integer format: int64 valid: type: boolean responseGetter: $ref: '#/components/schemas/StripeResponseGetter' lastResponse: $ref: '#/components/schemas/StripeResponse' rawJsonObject: $ref: '#/components/schemas/JsonObject' CurrencyOption: type: object properties: amountOff: type: integer format: int64 lastResponse: $ref: '#/components/schemas/StripeResponse' rawJsonObject: $ref: '#/components/schemas/JsonObject' JsonArray: type: object properties: asString: type: string empty: type: boolean asInt: type: integer format: int32 asDouble: type: number format: double asLong: type: integer format: int64 asBoolean: type: boolean asNumber: type: number asFloat: type: number format: float asByte: type: string format: byte asCharacter: type: string deprecated: true asBigDecimal: type: number asBigInteger: type: integer asShort: type: integer format: int32 asJsonObject: $ref: '#/components/schemas/JsonObject' jsonObject: type: boolean jsonPrimitive: type: boolean jsonArray: type: boolean jsonNull: type: boolean asJsonArray: $ref: '#/components/schemas/JsonArray' asJsonPrimitive: $ref: '#/components/schemas/JsonPrimitive' asJsonNull: $ref: '#/components/schemas/JsonNull' JsonNull: type: object properties: asString: type: string asInt: type: integer format: int32 asDouble: type: number format: double asLong: type: integer format: int64 asBoolean: type: boolean asJsonObject: $ref: '#/components/schemas/JsonObject' jsonObject: type: boolean jsonPrimitive: type: boolean jsonArray: type: boolean jsonNull: type: boolean asJsonArray: $ref: '#/components/schemas/JsonArray' asJsonPrimitive: $ref: '#/components/schemas/JsonPrimitive' asJsonNull: $ref: '#/components/schemas/JsonNull' asNumber: type: number asFloat: type: number format: float asByte: type: string format: byte asCharacter: type: string deprecated: true asBigDecimal: type: number asBigInteger: type: integer asShort: type: integer format: int32 JsonObject: type: object properties: empty: type: boolean asString: type: string asInt: type: integer format: int32 asDouble: type: number format: double asLong: type: integer format: int64 asBoolean: type: boolean asJsonObject: $ref: '#/components/schemas/JsonObject' jsonObject: type: boolean jsonPrimitive: type: boolean jsonArray: type: boolean jsonNull: type: boolean asJsonArray: $ref: '#/components/schemas/JsonArray' asJsonPrimitive: $ref: '#/components/schemas/JsonPrimitive' asJsonNull: $ref: '#/components/schemas/JsonNull' asNumber: type: number asFloat: type: number format: float asByte: type: string format: byte asCharacter: type: string deprecated: true asBigDecimal: type: number asBigInteger: type: integer asShort: type: integer format: int32 JsonPrimitive: type: object properties: boolean: type: boolean asString: type: string asInt: type: integer format: int32 asDouble: type: number format: double asLong: type: integer format: int64 asBoolean: type: boolean number: type: boolean string: type: boolean asNumber: type: number asFloat: type: number format: float asByte: type: string format: byte asCharacter: type: string deprecated: true asBigDecimal: type: number asBigInteger: type: integer asShort: type: integer format: int32 asJsonObject: $ref: '#/components/schemas/JsonObject' jsonObject: type: boolean jsonPrimitive: type: boolean jsonArray: type: boolean jsonNull: type: boolean asJsonArray: $ref: '#/components/schemas/JsonArray' asJsonPrimitive: $ref: '#/components/schemas/JsonPrimitive' asJsonNull: $ref: '#/components/schemas/JsonNull' StripeResponse: type: object StripeResponseGetter: type: object PurchaseInfo: type: object properties: billingVendor: type: string enum: - Google - Stripe planStartedAt: type: string format: 2016-01-01T00:00:00.000Z planExpiredAt: type: string format: 2016-01-01T00:00:00.000Z trial: type: boolean subscriptionId: type: string autoRenewing: type: boolean purchases: type: array items: $ref: '#/components/schemas/Purchase' MarketMonitorAccessTokenResponse: type: object properties: accessToken: type: string expiresIn: type: integer format: int64 securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT