createBusinessEntity

Parameters

Parameter Type Required
user_id UUID true
email Email true
phone String false
phone_country String false
contact_first_name String true
business_type BusinessType false
business_name String true
business_address1 String true
contact_last_name String true
business_address2 String false
business_city String false
business_state_province_region String false
business_postal_code PostalCode false
business_country ISO3166_1 true
tax_number TaxNumber false
accept_terms_and_conditions Boolean true
platform_id UUID true

GraphQL Schema

mutation createBusinessEntity (
    $user_id: UUID!
    $email: Email!
    $phone: String
    $phone_country: String
    $contact_first_name: String!
    $contact_last_name: String!
    $business_type: BusinessType
    $business_name: String!
    $business_address1: String!
    $business_address2: String
    $business_city: String
    $business_state_province_region: String
    $business_postal_code: PostalCode
    $business_country: ISO3166_1!
    $tax_number: TaxNumber
    $accept_terms_and_conditions: Boolean!
        $platform_id: UUID!
) {
    createBusinessEntity (
        user_id: $user_id
        email: $email
        phone: $phone
        phone_country: $phone_country
        contact_first_name: $contact_first_name
        contact_last_name: $contact_last_name
          business_type: $business_type
        business_name: $business_name
        business_address1: $business_address1
        business_address2: $business_address2
        business_city: $business_city
        business_state_province_region: $business_state_province_region
        business_postal_code: $business_postal_code
        business_country: $business_country
        tax_number: $tax_number
        accept_terms_and_conditions: $accept_terms_and_conditions
        platform_id: $platform_id
    )
}

Variables

JSON

{
  "user_id": "",
  "email": "",
  "phone": "",
  "contact_first_name": "",
  "contact_last_name": "",
  "business_type": "",
  "business_name": "",
  "business_address1": "",
  "business_address2": "",
  "business_city": "",
  "business_state_province_region": "",
  "business_postal_code": "",
  "business_country": "",
  "tax_number": "",
  "accept_terms_and_conditions": true,
    "platform_id": ""
}

NodeShell

const axios = require('axios');

let data = JSON.stringify({

query: `mutation createBusinessEntity (

$user_id: UUID!

$email: Email!

$phone: String

$phone_country: String

$contact_first_name: String!

$contact_last_name: String!

$business_name: String!

$business_address1: String!

$business_address2: String

$business_city: String

$business_state_province_region: String

$business_postal_code: PostalCode

$business_country: ISO3166_1!

$tax_number: TaxNumber

$accept_terms_and_conditions: Boolean!

$platform_id: UUID!

) {

createBusinessEntity (

user_id: $user_id

email: $email

phone: $phone

phone_country: $phone_country

contact_first_name: $contact_first_name

contact_last_name: $contact_last_name

business_name: $business_name

business_address1: $business_address1

business_address2: $business_address2

business_city: $business_city

business_state_province_region: $business_state_province_region

business_postal_code: $business_postal_code

business_country: $business_country

tax_number: $tax_number

accept_terms_and_conditions: $accept_terms_and_conditions

platform_id: $platform_id

)
}
`,

variables: {"user_id":"","email":"","phone":"","phone_country":"","contact_first_name":"","contact_last_name":"","business_name":"","business_address1":"","business_address2":"","business_city":"","business_state_province_region":"","business_postal_code":"","business_country":"","tax_number":"","accept_terms_and_conditions":true}
});

let config = {

method: 'post',

maxBodyLength: Infinity,

url: 'https://sandbox.external.routefusion.com/graphql',

headers: {

'Content-Type': 'application/json',

'Authorization': '••••••'

},

data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
{
  "data": {
    "createRepresentative": "573442c4-e010-480b-9acf-861fac940e9a"
  }
}