Jump to content

Create a Customer In Sage X3 Using GraphQL


 Share

Recommended Posts

I am currently learning how to use GraphQL with Sage X3, and I'm trying to use this tool to insert a customer into Sage X3. However, I'm encountering an error message that says, 'Failed to interface with X3.'

Here's my current mutation:

mutation {
  xtremX3MasterData {
    customer {
      create(data: {
        companyName: "John's Company",
        language: "ENG"
      }) {
        _id
        companyName
      }
    }
  }
}
And this is the response I'm receiving:

{
  "errors": [
    {
      "message": "Failed to interface with X3",
      "locations": [
        {
          "line": 18,
          "column": 7
        }
      ],
      "path": [
        "xtremX3MasterData",
        "customer",
        "create"
      ],
      "extensions": {
        "code": "business-rule-error",
        "diagnoses": [
          {
            "severity": 3,
            "path": [],
            "message": "{\"description\":\"Mandatory field\"}"
          },
          {
            "severity": 1,
            "path": [],
            "message": "|Creation of 81250 "
          }
        ]
      }
    }
  ],
  "data": {
    "xtremX3MasterData": {
      "customer": {
        "create": null
      }
    }
  },
  "extensions": {
    "diagnoses": [
      {
        "severity": 3,
        "path": [],
        "message": "{\"description\":\"Mandatory field\"}"
      },
      {
        "severity": 1,
        "path": [],
        "message": "|Creation of 81250 "
      }
    ]
  }
}

It seems that the error is related to a mandatory field "description" not being filled in correctly but the customer does not have a field named description. I would appreciate any help or guidance on resolving this issue. Thank you!

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...