Shopify payment authorization

I’ve been building an app for a “Buy Now, Try, and Pay Later” model. To enable this, I set the product price to 0 at checkout. I need a way to charge customers later if they decide to keep the product after the trial. Is there a payment authorization token we can store at checkout to facilitate this? Does Gadget offer a simpler solution, and should I store this token in the PostgreSQL database provided by Gadget?
26 Replies
Ahmad Bilal
Ahmad BilalOP7mo ago
Someone please help Someone please help Someone please help
ljspoor94
ljspoor947mo ago
Please stop spamming and be patient The gadget team is small and will help you when they have availability.
Ahmad Bilal
Ahmad BilalOP7mo ago
Sure
Chocci_Milk
Chocci_Milk7mo ago
Hello, Looking at the Shopify docs, there doesn't seem to be a way to defer payment if the product is added to the cart and checked out from the storefront. You could do it using draft orders but you would probably need to make a completely separate checkout just for that product (from what I can tell). Have you thought about asking the Shopify Partners Slack community to see if they have any insights?
Ahmad Bilal
Ahmad BilalOP7mo ago
Hey, I am not able to access their slack community. I think I need an invite for that but cant find any link. Do you think i can use this method https://shopify.dev/docs/api/admin-graphql/2025-01/objects/customerpaymentmethod
Shopify
CustomerPaymentMethod - GraphQL Admin
A customer's payment method.
Chocci_Milk
Chocci_Milk7mo ago
You won't be able to make a charge on the user's card with that resource
Ahmad Bilal
Ahmad BilalOP7mo ago
I think other apps like this are doing that not sure how. https://apps.shopify.com/tryon-try-before-you-buy?utm_source=youtube
Tryon: Try Before You Buy - Tryon: Try Before You Buy experience | ...
Embrace the Try Before You Buy purchasing strategy in minutes. Integrates smoothly with your product and checkout pages.
Chocci_Milk
Chocci_Milk7mo ago
In that case I must be wrong. I don't know how you'd go about building this. I don't have enough experience with checkouts and checkout workarounds to tell you
Ahmad Bilal
Ahmad BilalOP7mo ago
Do you know where should I ask this question. I am not a part of their slack community and really stuck on this problem! 🥲
Chocci_Milk
Chocci_Milk7mo ago
You should join their Slack community and ask. It shouldn't take very long to join
Ahmad Bilal
Ahmad BilalOP7mo ago
I think I need an invite to join that
Chocci_Milk
Chocci_Milk7mo ago
How can I join Shopify Slack channels?
Hey, I run a shopify dev and marketing agency and would love to join a couple of Slack channels for Shopify partners, agencies, marketing and for devs.  One of the channels I want to join is ShopifyPartners.slack.com but need someone to send an invite... Please invite me.. Cheers!
Ahmad Bilal
Ahmad BilalOP7mo ago
No description
Chocci_Milk
Chocci_Milk7mo ago
Looking at the functionality for orders, I don't see a way to update the price. You should reach out to Shopify support
Ahmad Bilal
Ahmad BilalOP7mo ago
They are saying this
No description
Chocci_Milk
Chocci_Milk7mo ago
I would recommend looking around the docs for information on what they're saying. I wasn't able to find anything The only things I could find were related to draftOrders but that's not what you need
Chocci_Milk
Chocci_Milk7mo ago
I don't see how that helps though.
Ahmad Bilal
Ahmad BilalOP7mo ago
They provided me with this link https://shopify.dev/docs/api/admin-rest/2025-01/resources/payment#%5Bpost%5D/admin/api/2023-10/payments.json not sure how i can use this to modify checkout page and gain the authorisation of their payment method to charge them later
Shopify
Payment - REST
Create and update payments to provide a custom checkout experience for your sales channel.
Chocci_Milk
Chocci_Milk7mo ago
The REST API is going to be deprecated in April so you should find the GraphQL alternative Btw, what they sent is what I told you about having to make a completely different sales channel (checkout experience) Its a lot of work
Ahmad Bilal
Ahmad BilalOP7mo ago
They said you can use the Checkout API to authorize payments when creating a checkout. You just need to set the payment_action to authorize. Maybe this way its easier to build this feature?
Chocci_Milk
Chocci_Milk7mo ago
Did they give you a link to the checkout API?
Chocci_Milk
Chocci_Milk7mo ago
Its not in their APIs section
No description
Ahmad Bilal
Ahmad BilalOP7mo ago
Here it is To access the Checkout API for Shopify, you can refer to the following link: Checkout API Documentation. https://shopify.dev/api/admin-rest/2025-01/resources/checkout#%5Bpost-checkouts-token-payments%5D
Shopify
Checkout - REST
Create and update checkouts to provide a custom checkout experience for your sales channel.
Ahmad Bilal
Ahmad BilalOP7mo ago
They are providing me with rest api urls Make sure your app has the necessary permissions to read and write payment mandates by requesting the read_payment_mandate and write_payment_mandate scopes when setting up your app. For more details, refer to the Checkout API documentation. Additionally, keep in mind that the REST Admin API is being deprecated, so consider migrating to the GraphQL API for future-proofing your app. You can find more information on this in the API deprecation announcement. To create a full authorization on the customer's payment method at checkout through your app, you can use the Checkout API. Specifically, you should set the payment_action to authorize when creating a checkout. This allows you to hold the funds on the customer's card without capturing them immediately. After the trial period, if the customer decides to keep the product, you can then capture the payment using the previously authorized transaction.
Chocci_Milk
Chocci_Milk7mo ago
Make sure that you use the GraphQL API if you do anything. I really want to stress that the REST API is being deprecated in the next API version

Did you find this page helpful?