Hi all,
What I need to accomplish is to create a subscription without payment information associated to it. I tried to do it with the API, creating a subscription draft, adding lines to it and the committing it. But I got the error that payment information was missing.
The scenario is as follows: I’m using subscriptions to create memberships, and sometimes we need to grant free membership to some users. Is this the way to go? Maybe there is some other thing to do that I’m not seeing.
Would you mind sharing the API call you made? I can take a look into it. Considering your use case, the subscriptionDraftDiscountAdd mutation could help you out.
Hi @Luke_K , I’m going to try adding a discount as you said and let you know, however the variant I’m using while adding a line to the subscription draft has a $0 cost.
Thanks!
Hi again @Luke_K , sorry for the late reply. You know I tried adding a discount but it wasn’t enough for stopping the error message asking me for payment information.
I’m going to paste here the mutations that I’m running in case you want to have a look.
Create Subscription Contract Draft:
mutation {
subscriptionContractCreate(
input: {
customerId: "
Add Product Line to Subscription Draft:
```javascript
mutation {
subscriptionDraftLineAdd(
draftId: "
Add discount to Subscription Draft:
```javascript
mutation {
subscriptionDraftDiscountAdd(
draftId: "
And at the end the commit subscription draft:
```javascript
mutation {
subscriptionDraftCommit(draftId: "
Thanks!!
Diffing your SubscriptionContractCreate mutation against the one prescribed in our documentation here, it appears you are omitting a paymentMethodId from the call.
I think additionally this will be a point where you get stuck when it comes to the final subscriptionDraftCommit unfortunately as the API is expecting a CustomerPaymentMethod Id and validates the commit against it. Considering this, perhaps setting the Customer Payment Id earlier on could be a step in the right direction.