Open an account for a business customer
Create the business buyer with its house terms and open its account with your organization — the customer that buys on invoice.
Customers · a play in 2 steps.
The steps
- Create the business buyer with its house terms. — createCorporateCustomer
- Open the customer’s account with your organization. — createOrgCustomer
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
createCorporateCustomer
createCorporateCustomer — mutation · Create a new corporate customer — a business buyer with house terms at your organization.
Example request
mutation ExampleCreateCorporateCustomer($input: NewCorporateCustomerInput!) {
createCorporateCustomer(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
legalName
taxId
code
}
}
Variables:
{
"input": {
"caption": "Blue jeans"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createCorporateCustomer": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "CU-EXMP-0000-000F",
"type": "CorporateCustomer",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"legalName": "Blue jeans",
"taxId": "<tax id>",
"code": "BJ-001"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
createOrgCustomer
createOrgCustomer — mutation · Create a new customer of your organization at your organization.
Example request
mutation ExampleCreateOrgCustomer($input: NewOrgCustomerInput!) {
createOrgCustomer(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
corporateCustomerId
accountNumber
paymentTerms
customerPriceGroupId
priceListId
billToContactId
shipToContactId
code
arBalanceMinor
arCurrency
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"organizationId": "01900000-0000-7000-8000-44b781470000",
"corporateCustomerId": "01900000-0000-7000-8000-e09097190000"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createOrgCustomer": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "EC-EXMP-0000-000F",
"type": "OrgCustomer",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"corporateCustomerId": "01900000-0000-7000-8000-e09097190000",
"accountNumber": "<account number>",
"paymentTerms": "<payment terms>",
"customerPriceGroupId": "01900000-0000-7000-8000-dfbf5aa40000",
"priceListId": "01900000-0000-7000-8000-7844e9fb0000",
"billToContactId": "01900000-0000-7000-8000-cd1d9f9e0000",
"shipToContactId": "01900000-0000-7000-8000-abe45fdf0000",
"code": "BJ-001",
"arBalanceMinor": 1,
"arCurrency": "<ar currency>"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}