Skip to content

Unable to create new CustomerClientLink #518

Description

@denizelderenbos

When I attempt to update a CustomerClientLink via the CustomerClientLinkService helper, the API returns a request_error: OPERATION_REQUIRED. It appears that my mutate payload never gets wrapped with a valid create, update, or remove operation. Am I doing something wrong here?

const customer = this.getCustomer(this.managerAccountId)

const customerClientLink: resources.ICustomerClientLink = {
  resource_name: ResourceNames.customerClientLink(
    this.managerAccountId,
    clientCustomerId,
    this.managerAccountId
  ),
  client_customer: clientCustomerId,
  status: enums.ManagerLinkStatus.PENDING,
}

try {
  const result: services.MutateCustomerClientLinkResponse =
    await customer.customerClientLinks.create([customerClientLink])
  console.log(result)
} catch (err) {
  console.log(err)
}

Produces the following error:

{
  "errors": [
    {
      "error_code": {
        "request_error": "OPERATION_REQUIRED"
      },
      "message": "Mutate operations must have 'create', 'update', or 'remove' specified.",
      "location": {
        "field_path_elements": [
          {
            "field_name": "operation"
          }
        ]
      }
    }
  ],
  "request_id": "ZFsHdIA2oGXjtqflUhd5vw"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions