diff --git a/public/openapi.json b/public/openapi.json index fe16d6a0a9..5537abbfd5 100644 --- a/public/openapi.json +++ b/public/openapi.json @@ -1514,5 +1514,98 @@ } ] } + ], + "formattedStripeCouponFields": [ + { + "label": "Standard Mappings", + "name": "standard", + "description": "", + "fields": [ + { + "name": "amount off", + "value": "amount_off", + "description": "

A positive integer representing the amount to subtract from an invoice total (required if percent_off is not passed).

", + "type": "integer", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + }, + { + "name": "duration", + "value": "duration", + "description": "

Specifies how long the discount will be in effect if used on a subscription. Can be forever, once, or repeating. Defaults to once.

", + "type": "string", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + }, + { + "name": "duration in months", + "value": "duration_in_months", + "description": "

Required only if duration is repeating, in which case it must be a positive integer that specifies the number of months the discount will be in effect.

", + "type": "integer", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + }, + { + "name": "max redemptions", + "value": "max_redemptions", + "description": "

A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use.

", + "type": "integer", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + }, + { + "name": "name", + "value": "name", + "description": "

Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the id is shown if name is not set.

", + "type": "string", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + }, + { + "name": "percent off", + "value": "percent_off", + "description": "

A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if amount_off is not passed).

", + "type": "number", + "defaultValue": "", + "requiredValue": "", + "hasOverride": false, + "staticValue": false, + "hasSfValue": false, + "hasRequiredValue": false, + "sfValue": "", + "sfValueType": "" + } + ] + } ] } diff --git a/sfdx/bin/openapi-spec-generator/index.js b/sfdx/bin/openapi-spec-generator/index.js index 76f32b9038..6fac41893c 100644 --- a/sfdx/bin/openapi-spec-generator/index.js +++ b/sfdx/bin/openapi-spec-generator/index.js @@ -15,7 +15,6 @@ const excludedFields = { product: [ // not essential to exclude the ID, but not using a standard ID makes maintaining an account confusing 'id', - 'price' ], @@ -43,7 +42,12 @@ const excludedFields = { 'product_data' ], - subscription_schedule_phase: [] + subscription_schedule_phase: [], + coupon: [ + 'id', + 'currency', + 'redeem_by' + ] } const ListOfStripeObjects = [ @@ -52,6 +56,7 @@ const ListOfStripeObjects = [ 'subscription_schedule', 'subscription_item', 'price', + 'coupon' ] const OPTIONS = {