Assign product to a client via API

Hi @tomasw is there a way to create a product and assign the product to a specific client through the API? As of now, we are creating products in our master 3PL account but we need to assign those SKUs to a client account.

If this cannot be done through the API, is this possible through the Bulk Edit function?

Hi @isaac.wyatt!
Absolutely. Products need to be created on the client account always. You can do that by either:

  1. Adding a customer_account_id on the Mutation payload
  2. Using a Bearer from the client account user

Let me know if this doesn’t help or I could explain better.
Thanks in advance!
Tom

Are we able to update the customer_account_id in an update product mutation?

That is correct @isaac.wyatt
For example let say you wanted to update the product note on a SKU for a specific customer, then you could make this mutation:

mutation{
  product_update(data: {
    customer_account_id:"QWNjb3VudDo3NTU2"
    sku:"1122334459"
    product_note:"Test Note"
  }){
    request_id
    complexity
  }
} 

Being the customer_account_id from:

query {
  account {
    request_id
    complexity
    data {
      customers {
        edges {
          node {
            id
            legacy_id
          }
        }
      }
    }
  }
}