Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change apply_on for remove discount in a subscription #30

Open
wants to merge 1 commit into
base: chargebee-v2
Choose a base branch
from

Conversation

BillWilson
Copy link

According to the parameters description here, the ApplyOn is required when creating new discount.

And it works as expected when creating new discount with empty apply_on.

{
  "message": "discounts[apply_on][0] : cannot be blank",
  "type": "invalid_request",
  "api_error_code": "invalid_request",
  "param": "discounts[apply_on][0]",
  "error_code": "param_should_not_be_blank",
  "error_msg": "cannot be blank",
  "error_param": "discounts[apply_on][0]",
  "http_status_code": 400
}

But when I try to delete a discount from subscription.
I always got this message unless I remove the key apply_on from the request payload.

{
  "message": "discounts[apply_on][0] : should not be sent when operation type is REMOVE",
  "type": "invalid_request",
  "api_error_code": "invalid_request",
  "param": "discounts[apply_on][0]",
  "error_code": "param_should_not_be_sent",
  "error_msg": "should not be sent when operation type is REMOVE",
  "error_param": "discounts[apply_on][0]",
  "http_status_code": 400
}

type UpdateForItemsDiscountParams struct {
ApplyOn enum.ApplyOn `json:"apply_on"`

@BillWilson BillWilson changed the title Change apply_on for remove discount in a subscription Change apply_on for remove discount in a subscription Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant