Confirm declined recurring charge

Solved
dmogil
New Member
8 0 0

Sometimes store owner can decline the application charge, instead of accepting it.

As I understand from the Shopify docs, charge can be re-confirmed using confirmation link. Here https://shopify.dev/api/admin/rest/reference/billing/recurringapplicationcharge#show-2021-01 , in the example response I see "confirmation_url" field. 

But when I'm trying to get declined charge info, "confirmation_url" field is MISSING in the response object! What should I do with this? How can get charge confirmation link and provide it in the app?

Accepted Solution (1)

Accepted Solutions
SteveTT
Shopify Partner
31 4 10

This is an accepted solution.

I don't think the charge can be "re-confirmed"...

I believe the flow is this:

  1. create (POST) a recurring application charge
    • you should set "return_url" in the payload
    • I think the response from creating this also includes "decorated_return_url" that shows the exact url (see step 3) that shopify will redirect back to you, if the merchant accepts.
    • at this stage, the list (GET) of recurring application charges will have the latest one that is status: "pending"
    • the merchant has neither confirmed or declined the charge at this stage
  2. redirect to "confirmation_url" that you got in the response from step 1
    • this is shopify's url
    • IF the merchant accepts or declines, it's out of your control at this point
  3. IF the merchant accepts, shopify will redirect back to your app at "return_url", (specifically "decorated_return_url", but please check yourself,  see step 1, my own docs are a bit sketchy)
    • there will be a "charge_id" in the request. This is the id of the recurring application charge in question
    • at this stage, the list of recurring application charges will have that charge_id with status: "active"
  4. if the merchant declines, I think shopify will redirect back to the TOP level of Apps (not your app)
    • if you ever check,  the list of recurring application charges will have that charge_id with status: "declined"
  5. if the merchant neither accepts or declines, I think the list of recurring application charges will stick around "forever" and I don't think they can be "cleaned up"

Hope this helps! If it does, show some love!

View solution in original post

Reply 1 (1)
SteveTT
Shopify Partner
31 4 10

This is an accepted solution.

I don't think the charge can be "re-confirmed"...

I believe the flow is this:

  1. create (POST) a recurring application charge
    • you should set "return_url" in the payload
    • I think the response from creating this also includes "decorated_return_url" that shows the exact url (see step 3) that shopify will redirect back to you, if the merchant accepts.
    • at this stage, the list (GET) of recurring application charges will have the latest one that is status: "pending"
    • the merchant has neither confirmed or declined the charge at this stage
  2. redirect to "confirmation_url" that you got in the response from step 1
    • this is shopify's url
    • IF the merchant accepts or declines, it's out of your control at this point
  3. IF the merchant accepts, shopify will redirect back to your app at "return_url", (specifically "decorated_return_url", but please check yourself,  see step 1, my own docs are a bit sketchy)
    • there will be a "charge_id" in the request. This is the id of the recurring application charge in question
    • at this stage, the list of recurring application charges will have that charge_id with status: "active"
  4. if the merchant declines, I think shopify will redirect back to the TOP level of Apps (not your app)
    • if you ever check,  the list of recurring application charges will have that charge_id with status: "declined"
  5. if the merchant neither accepts or declines, I think the list of recurring application charges will stick around "forever" and I don't think they can be "cleaned up"

Hope this helps! If it does, show some love!