Is there an API Endpoint / GraphQL Mutation to create Purchase Orders?

I need to be able to create purchase orders (Shopify Help Center | Purchase orders) via the Shopify API. I can work with either one (Rest or GraphQl), I just can’t find documentation for it anywhere. I’m specifically trying to create the purchase orders that have been implemented directly into the admin under products > purchase orders.

Am I missing something, or is the endpoint not public yet?

I think I solved my own question. Too bad Shopify devs are too unresponsive and silent on this question (I noticed it’s been asked a few times with no response or useless answers).

I found both GraphQL mutations needed for this via the chrome dev console: CreateSupplier and PurchaseOrderCreateMutation.

Unfortunately, they both appear to be in the production branch on the unstable API version and I am unable to access them from the released unstable version. I guess we’ll all need to find a workaround for the next two years till they finally remember to add them into a release. Why add purchase orders into the admin and not the mutations to go with them? The mutations clearly work as is, since the admin has to use them to create the dang things…

Screenshot 2024-01-01 200430.png

Hi!

How do you find that mutation?
I just did a POST to https://{{SHOP_NAME}}.myshopify.com/admin/api/unstable/graphql.json with the following body:

query IntrospectionQuery {
    __schema {
      queryType { name }
      mutationType { name }
      subscriptionType { name }
      types {
        ...FullType
      }
      directives {
        name
        description
        args {
          ...InputValue
        }
        onOperation
        onFragment
        onField
      }
    }
  }

  fragment FullType on __Type {
    kind
    name
    description
    fields(includeDeprecated: true) {
      name
      description
      args {
        ...InputValue
      }
      type {
        ...TypeRef
      }
      isDeprecated
      deprecationReason
    }
    inputFields {
      ...InputValue
    }
    interfaces {
      ...TypeRef
    }
    enumValues(includeDeprecated: true) {
      name
      description
      isDeprecated
      deprecationReason
    }
    possibleTypes {
      ...TypeRef
    }
  }

  fragment InputValue on __InputValue {
    name
    description
    type { ...TypeRef }
    defaultValue
  }

  fragment TypeRef on __Type {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
        }
      }
    }
  }

but I could not find “PurchaseOrderCreateMutation” in the response.

Kind regards,
-Louise

Yeah you can’t send any requests to it as even the public unstable version of the API does not have this mutation yet, only the Shopify Admin does.

I simply opened my dev store’s purchase order page (https://admin.shopify.com/store/store-name/purchase_orders),,) opened the Chrome network monitor, and created a purchase order via the admin UI. Then just find the request that the Shopify Admin sent to thr API. It will include the mutation and full payload.

I was able to get an email forwarded to the Director of Product Management today, and he said it’s releasing soon, but he couldn’t say when. Fingers crossed it will be part of this new Dev Editions.

Hi Ryan,

Thank you for your response.
Ah ok I see.
I’ll cross my fingers as well :grin:

Kind regards,
-Louise

I too would make use of this mutation. Give me that sweet sweet PO mutation

+1 for API support for Purchase Orders

Thank you for pushing it through, Ryan!

I was wondering if there is any update on this?

I’m really struggling with our sketchy workarounds. Have you heard back from anyone?

Is there any way to track progress on this?

Really looking forward for this to be implemented!

Hi Ana,

I haven’t received any updates since May, unfortunately. My industry experience tells me the product managers want to release it, but the folks up top are chasing the shiny new “AI” penny, and have all dev resources focused there. That’s just my speculation though.

If you need this for your own store, I recommend using Microsoft Power Automate (UI) or Selenium Web Driver (Code) as your workaround. For my app on another merchant’s store, I’m currently creating a regular order with a “purchaseorder” tag and having them manually create a matching purchase order and then cancelling the regular order. Huge pain if it’s not your own store.

We’re now 1 month and 19 days away from the anniversary of this thread. I predicted 2 years before they finally release it… prove me wrong, folks @ Shopify!

Any update on this topic? I am desperately looking into just reading the information from the purchase_orders. cant be too complicated, cant it?
@Shopify_77 can you update us here?

Spot on @RyanTechLLC ! Would be great to see some movement on this :disappointed_face:

Did you figure out a workaround here?

+1 for updates on this topic.

Looking forward to seeing this in the API sometime, too. We may want to mark it unresolved, as there’s no sign of it reaching public API yet.

Hey there, any any any idea on whats hapenning with this?