How to create customer custom attributes using .Net API

I’m getting the following error when using CustomerCustomAttributesApi.CreateCustomerCustomAttributeDefinition(body) via the .Net API:

Category:INVALID_REQUEST_ERROR Code:BAD_REQUEST Detail:Missing required parameter schema Field:schema

The example in the .Net documentation omits the .Schema parameter and model says its optional (as it seems to assume String is the default?) But I’m getting this error and I don’t know how to specify the required JSON Ref in C#. Can someone give example?

Hi,

You can go to the Square.Tests directory in the square-dotnet-sdk and it shows you an example of how a schema is defined.

Here is the link: square-dotnet-sdk/CustomersTest.cs at master · square/square-dotnet-sdk · GitHub

Let me know if that helps! Thanks!

Best,
Mohsin

Thanks Moshin, That works!

1 Like

great news, glad to help!