shopify payment api I have implemented this api for my app and done payment successfully In response i get charge_id in a url as query string
but I done know how to cross check this charge id after payment done successfully
I want to check this charge_id with the help of api. shopify confirm me again this charge_id we got this amount of payment.
api code
curl -X POST https://syzb.myshopify.com/admin/api/2022-07/graphql.json -H 'Content-Type: application/json' -H 'X-Shopify-Access-Token: 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' -d '{
"query": "mutation AppSubscriptionCreate($test: Boolean, $name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL! ){ appSubscriptionCreate(test: $test, name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id } confirmationUrl } }",
"variables": {
"test": true,
"name": "Premium +",
"returnUrl": "https://example.com/payment-success/?org=329BFBC5745344B58F321A1B842B73F8",
"lineItems": [
{
"plan": {
"appRecurringPricingDetails": {
"price": {
"amount": 99.50,
"currencyCode": "USD"
},
"interval": "EVERY_30_DAYS"
}
}
},
{
"plan": {
"appUsagePricingDetails": {
"terms": "Testing",
"cappedAmount": {
"amount": 10.25,
"currencyCode": "USD"
}
}
}
}
]
}
}'
2
Answers
curl -X GET "https://your-development-store.myshopify.com/admin/api/2022-07/recurring_application_charges/455696195.json"
-H "X-Shopify-Access-Token: {access_token}"
https://shopify.dev/api/admin-rest/2022-07/resources/recurringapplicationcharge#get-recurring-application-charges-recurring-application-charge-id
Have a look the official Shopify documentation!
Curl the resource with:
Your response will be something like this:
What you need to check if a payment has been successful is the
status
value:I hope this can help you!