Hello,
We are building an API integration from Salesforce, which stores all of our inventory, with our new Shopify store. Customers, Products, and Orders are syncing smoothly, however I get an error when trying to populate Fulfillment info from Salesforce (which is integrated with our shipping providers) into an Order in Shopify.
Error: 403 - "This action requires merchant approval for write_orders scope." however the private App grants Read and Write access to "Orders, transactions and fulfillments".
What else do I need to change?
Thank you
A sample POST stripped of sensitive data would be ideal.
Hi Karl, thanks for responding.
We are using Admin REST API in a Production environment. We did not have any permissions issues in a dev environment. The Order status is "Unfulfilled" and Payment Status is "Paid".
Creation of Fulfillment Using REST Admin API For Order (OrderId : 1021757390906) :
Authentication : We are using API Key and API Secret for Authentication.
EndPointUrl: https://storewpd.myshopify.com/admin/orders/1021757390906//fulfillments.json
Method: “POST”
Header: “'application/json”
Body :
When shipment method is “Fedex”
{
"fulfillment": {
"tracking_company": “Fedex”,
"tracking_number": "123456",
"tracking_urls": [ "https://www.fedex.com/apps/fedextrack/?tracknumbers='Opportunity.Shipment_Tracking_Number__c" ]
}
}
When shipment method is “USPS”
{
"fulfillment": {
"tracking_company": “USPS”,
"tracking_number": "123456",
"tracking_urls": [ "https://tools.usps.com/go/TrackConfirmAction?tLabels='+oppObj.Shipment_Tracking_Number__c" ]
}
}
When shipment method is “UPS”
{
"fulfillment": {
"tracking_company": “UPS”,
"tracking_number": "123456",
"tracking_urls": [ "https://www.ups.com/track?loc=en_US&tracknum='Opportunity.Shipment_Tracking_Number__c" ]
}
}
Okay, unless you left out some fields in those payloads, I see the following error::Since multi-location fulfillments were introduced, you have to provide a location_id
So taking your Fedex example should be:
{
"fulfillment": {
"location_id": 123456789,
"tracking_company": "Fedex",
"tracking_number": "123456",
"tracking_urls": ["https://www.fedex.com/apps/fedextrack/?tracknumbers='Opportunity.Shipment_Tracking_Number__c"]
}
}
Hope that solves the issue although I cannot verify leaving out the location_id would throw that weird unrelated error (not on my dev machine now)
Best wishes!
Ah, missed the part where you mention it works on dev, not in prod. Hmm, out of ideas.
Anyone @Shopify?
Just to verify that I do have write_orders access:
curl https://xxxx:xxxx@gemma-by-wp-diamonds.myshopify.com/admin/oauth/access_scopes.json
{"access_scopes":[{"handle":"read_analytics"},{"handle":"write_customers"},{"handle":"write_draft_orders"},{"handle":"write_fulfillments"},{"handle":"write_inventory"},{"handle":"read_locations"},{"handle":"read_marketing_events"},{"handle":"write_orders"},{"handle":"write_price_rules"},{"handle":"write_product_listings"},{"handle":"write_products"},{"handle":"write_shipping"},{"handle":"read_shopify_payments_payouts"},{"handle":"read_all_orders"},{"handle":"read_customers"},{"handle":"read_draft_orders"},{"handle":"read_fulfillments"},{"handle":"read_inventory"},{"handle":"read_orders"},{"handle":"read_price_rules"},{"handle":"read_product_listings"},{"handle":"read_products"},{"handle":"read_shipping"}]}
@Brian_Oconnell wrote:My team of developers and I have tried with the location_id and we still get the same permission error: "[API] This action requires merchant approval for write_orders scope."
How do I as the merchant grant this approval to myself?
Hi Brian,
did you figure out the solution here? I'm having a similar issue
User | Count |
---|---|
12 | |
12 | |
10 | |
7 | |
6 |