Clarifications regarding B2B, Catalog, Publication APIs

Clarifications regarding B2B, Catalog, Publication APIs

evaldas_92
Shopify Partner
58 1 26

Link to the original post in Shopify's slack community for partners: https://shopifypartners.slack.com/archives/C02EW5SBUTT/p1676121873923959

 

In Step 2: Create B2B Catalog (https://shopify.dev/docs/apps/b2b/getting-started#step-2-create-a-b2b-catalog), a publication Id is used to create a catalog for company locations. Where does this publication ID come from? From what I gather we can fetch markets, and markets have a publication ID on them, but what about publications for B2B catalogs? I think it was unclear as to how do we create a custom publication referencing a specific set of product variants or collections so that we can create a B2B catalog for specific company locations containing those specific items? I have seen publications a while back but I can't seem to find much much information on how to use them.  Perhaps a requirement could be linked to a guide for how to use publications - though I couldn't find one. I did some digging in the GraphQL API, but it would be nice to know if the below assumptions are correct / valid / future proof to the extent that they can be:

 

1. Is it then correct that we can basically create an "empty" publication using the following example?

 

mutation CreatePublication($publication: PublicationCreateInput!){
  publicationCreate(input: $publication){
    publication {
      id
    }
    userErrors {
      code
      field
      message
    }
  }
}

{
  "publication": {
    "defaultState": "ALL_PRODUCTS",
    "autoPublish": true
  }
}

2. And then publish any item to it with?

 

mutation Publish($id: ID!, $publications: [PublicationInput!]!) {
  publishablePublish(id: $id, input: $publications){
    publishable {
      resourcePublicationsV2(first:10) {
        nodes {
          publication {
            id
          }
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

{
  "id": "gid://shopify/Product/7834825588898",
  "publications": [
    {
      "publicationId": "gid://shopify/Publication/93249536162",
      "publishDate": null
    }
  ]
}

3. It also seems that you can publish product IDs but not variant IDs - is that definitive? As a result you cannot limit specific variants to a country or b2b location? I don't suppose it's a common requirement, but I have heard it at least once before.

4. Publications don't seem to have any "title" or "name" field on them  - is it correct that there are no plans to expose these in the admin?
5. It appears 1 publication can only be attached to one catalog. So if we have a 2 catalogs which would share 1 publication but have different price lists - it is not possible to create this right now, is that correct? We would have to create a publication for each b2b catalog and then publish all items to each of the publications?
6. Are there any plans to create the publication automatically when a catalog is created without a publication ID, instead of having to create a publication and then a catalog referencing it?
7. When a catalog (say for a company) is deleted, is the publication deleted automatically or we need to delete it afterward catalog is deleted?
8. Is there a limit of how many catalogs we can create?
9. Is there a limit of how many company locations can be associated to a catalog?
10. Is there a limit of how many publications we can create? I imagine this has accommodate both B2B and Market specific catalogs

 

Replies 0 (0)