Would you be able to share some more recent examples (within 2 months)?
I can see that this order was created at 2022-12-27 and unfortunately we don’t have the log anymore for me to debug further.
On the other hand, a recent order 5126537576611 seems have the contract successfully created.
We can use the order you’ve shared (Order 5126537576611) as an example to investigate. I tried querying this order via the GraphQL API and it does not show a contract.
I ran the following query:
{
order(id:"gid://shopify/Order/5126537576611") {
id
lineItems(first:1) {
edges {
node {
currentQuantity
sellingPlan {
name
}
contract {
id
}
}
}
}
}
}
The GraphQL API endpoint I’m calling is version 2023-07 but I have tried this with all the other available API versions (including 2023-10) and get the same result.
My app has all of the required OAuth permission scopes:
[‘read_orders’, ‘read_all_orders’, ‘read_own_subscription_contracts’] so it is not a permissions issue (also we would be getting a 401 error).
So it appears that the contract is successfully being created but the contract information is not being returned in the API. Could you investigate why this is happening? Are you able to obtain the contract information from this order when you run the same query above?
I was not aware that contracts could not be accessed cross-app, that explains it.
We need to be able to fetch the information from our Contracts via API to automate our store operations. Could you share how you are able to query the Orders via Native Subscriptions app?
Are you using the access token that is shared with the app? I can’t find where I can fetch this access token to use in our own queries within the admin UI.
Unfortunately, I was only able to do that internally.
As for now, only the app that owns the subscription contracts can read and write on their contracts.