Perform CRUD in REST API with URL












0















I'm using Stripe API(REST) and I need to put a link in email where user can directly unsubscribe/delete subscription(https://stripe.com/docs/billing/subscriptions/canceling-pausing).
I need to know if it is possible to put the arguments and operation in a URL so that when user clicks it, Stripe api is called and subscription is cancelled.



thanks in advance.










share|improve this question



























    0















    I'm using Stripe API(REST) and I need to put a link in email where user can directly unsubscribe/delete subscription(https://stripe.com/docs/billing/subscriptions/canceling-pausing).
    I need to know if it is possible to put the arguments and operation in a URL so that when user clicks it, Stripe api is called and subscription is cancelled.



    thanks in advance.










    share|improve this question

























      0












      0








      0








      I'm using Stripe API(REST) and I need to put a link in email where user can directly unsubscribe/delete subscription(https://stripe.com/docs/billing/subscriptions/canceling-pausing).
      I need to know if it is possible to put the arguments and operation in a URL so that when user clicks it, Stripe api is called and subscription is cancelled.



      thanks in advance.










      share|improve this question














      I'm using Stripe API(REST) and I need to put a link in email where user can directly unsubscribe/delete subscription(https://stripe.com/docs/billing/subscriptions/canceling-pausing).
      I need to know if it is possible to put the arguments and operation in a URL so that when user clicks it, Stripe api is called and subscription is cancelled.



      thanks in advance.







      rest stripe-payments restful-url






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 8:18









      Mohsin AbbasMohsin Abbas

      51




      51
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The short answer is NO.



          Cancelling subscriptions from Stripe API requires your Secret Key which you should NEVER expose in the front end and made public because user will have access to your stripe account in that case.



          Saying that, what you could do is to expose an endpoint in your own web server, which you will need to



          1) create a on time use token which you can look up your customer and related subscriptions; include the token in your URL send to the user



          2) when user click the the url, verify the token (valid non expired) and find the customer and subscriptions



          3) Call stripe API with your secret keys to cancel the subscription for the customer.






          share|improve this answer
























          • Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

            – Mohsin Abbas
            Nov 21 '18 at 9:05











          • Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

            – wsw
            Nov 22 '18 at 6:02











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407772%2fperform-crud-in-rest-api-with-url%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          The short answer is NO.



          Cancelling subscriptions from Stripe API requires your Secret Key which you should NEVER expose in the front end and made public because user will have access to your stripe account in that case.



          Saying that, what you could do is to expose an endpoint in your own web server, which you will need to



          1) create a on time use token which you can look up your customer and related subscriptions; include the token in your URL send to the user



          2) when user click the the url, verify the token (valid non expired) and find the customer and subscriptions



          3) Call stripe API with your secret keys to cancel the subscription for the customer.






          share|improve this answer
























          • Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

            – Mohsin Abbas
            Nov 21 '18 at 9:05











          • Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

            – wsw
            Nov 22 '18 at 6:02
















          0














          The short answer is NO.



          Cancelling subscriptions from Stripe API requires your Secret Key which you should NEVER expose in the front end and made public because user will have access to your stripe account in that case.



          Saying that, what you could do is to expose an endpoint in your own web server, which you will need to



          1) create a on time use token which you can look up your customer and related subscriptions; include the token in your URL send to the user



          2) when user click the the url, verify the token (valid non expired) and find the customer and subscriptions



          3) Call stripe API with your secret keys to cancel the subscription for the customer.






          share|improve this answer
























          • Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

            – Mohsin Abbas
            Nov 21 '18 at 9:05











          • Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

            – wsw
            Nov 22 '18 at 6:02














          0












          0








          0







          The short answer is NO.



          Cancelling subscriptions from Stripe API requires your Secret Key which you should NEVER expose in the front end and made public because user will have access to your stripe account in that case.



          Saying that, what you could do is to expose an endpoint in your own web server, which you will need to



          1) create a on time use token which you can look up your customer and related subscriptions; include the token in your URL send to the user



          2) when user click the the url, verify the token (valid non expired) and find the customer and subscriptions



          3) Call stripe API with your secret keys to cancel the subscription for the customer.






          share|improve this answer













          The short answer is NO.



          Cancelling subscriptions from Stripe API requires your Secret Key which you should NEVER expose in the front end and made public because user will have access to your stripe account in that case.



          Saying that, what you could do is to expose an endpoint in your own web server, which you will need to



          1) create a on time use token which you can look up your customer and related subscriptions; include the token in your URL send to the user



          2) when user click the the url, verify the token (valid non expired) and find the customer and subscriptions



          3) Call stripe API with your secret keys to cancel the subscription for the customer.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 8:56









          wswwsw

          36039




          36039













          • Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

            – Mohsin Abbas
            Nov 21 '18 at 9:05











          • Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

            – wsw
            Nov 22 '18 at 6:02



















          • Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

            – Mohsin Abbas
            Nov 21 '18 at 9:05











          • Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

            – wsw
            Nov 22 '18 at 6:02

















          Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

          – Mohsin Abbas
          Nov 21 '18 at 9:05





          Thank you for the prompt response. Yes I'm aware of the fact that secrect key is not meant to be passed publically but if we ignore the secret key for a moment, is it generally possible without having to expose an endpoint in my own web server?

          – Mohsin Abbas
          Nov 21 '18 at 9:05













          Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

          – wsw
          Nov 22 '18 at 6:02





          Stripe relies on keys to identify the merchant etc. So no, the link without keys will not work in this case.

          – wsw
          Nov 22 '18 at 6:02




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407772%2fperform-crud-in-rest-api-with-url%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini