Fluent Commerce Logo
Docs
Sign In

billingAccount graphQL query and mutation

Essential knowledge

Author:

Fluent Commerce

Changed on:

23 Nov 2023

Overview

The

`billingAccount`
is an entity used for linking customer entities with
`payment`
,
`creditMemo`
and
`invoice`
.

Key points

  • The page provides GQL example on how to use
    `billingAccount`
    :
    • Create
    • Update
    • Query

Create

1POST: {{fluentApiHost}}/graphql
2
3QUERY:
4
5
6
7mutation createBillingAccount ($input: CreateBillingAccountInput) {
8    createBillingAccount (input: $input) {
9        id
10        ref
11        type
12        status
13        name
14        createdOn
15        updatedOn
16        address{
17            city
18            name
19        }
20    }
21}
22
23
24Variables:
25
26{
27  "input": {
28    "ref": "199_Ivory_Predovic@yahoo.com:199_MAN05",
29    "type": "CUSTOMER",
30    "name": "Mrs Customer Name",
31    "retailer": {
32      "id": 199
33    },
34    "customer": {
35      "ref": "199_Ivory_Predovic@yahoo.com"
36    },
37    "address": {
38        "city": "bill city",
39        "companyName": "bill companyName",
40        "country": "bill country",
41        "latitude": 1.0,
42        "name" :"my name",
43        "longitude": 2.0,
44        "postcode": "bill postcode",
45        "region": "bill region",
46        "state": "bill state",
47        "street": "bill street",
48        "timeZone": "GMT+10"
49    }
50  }
51}
52

Language: graphqlschema

Name: billingAccount create example

Description:

[Warning: empty required content area]

Update

1POST: {{fluentApiHost}}/graphql
2
3Query
4
5
6
7mutation updateBillingAccount ($input: UpdateBillingAccountInput) {
8    updateBillingAccount (input: $input) {
9        id
10        ref
11        type
12        status
13        name
14        createdOn
15        updatedOn
16    }
17}
18Variables
19
20
21
22{
23  "input": {
24    "ref": "199_Ivory_Predovic@yahoo.com:199_MAN04",
25    "status": "ACTIVE",
26    "name": "Test Name 04",
27    "attributes": {
28      "name": "ATTR_NAME1",
29      "type": "STRING",
30      "value": "HEELLOO WORLDD"
31    },
32    "address": {
33        "city": "bill city4",
34        "companyName": "bill companyName4",
35        "country": "bill country4",
36        "latitude": 1.40,
37        "longitude": 2.40,
38        "name": "my new name",
39        "postcode": "bill postcode4",
40        "region": "bill region4",
41        "state": "bill state4",
42        "street": "bill street4",
43        "timeZone": "GMT+11"
44    }
45  }
46}

Language: graphqlschema

Name: billingAccount update example

Description:

[Warning: empty required content area]

Query

1query billingAccount
2
3POST: {{fluentApiHost}}/graphql
4
5Query:
6
7
8
9{
10    billingAccount(ref:"1_Brandyn9@gmail.com:1_2720e"){
11        id
12                ref
13                status
14                customer{
15                    ref
16                }
17                name
18                retailer{
19                    id
20                }
21                address{
22                    city
23                    companyName
24                    country
25                    latitude
26                    longitude
27                    name
28                    postcode
29                    region
30                    state
31                    street
32                    timeZone
33                }
34                type
35
36                createdOn
37    }
38}

Language: plain_text

Name: billingAccount query example

Description:

[Warning: empty required content area]


1POST: {{fluentApiHost}}/graphql
2
3Query:
4
5
6
7{
8    billingAccounts(retailer:{id:1}){
9        edges{
10            node{
11                id
12                ref
13                status
14                customer{
15                    ref
16                }
17                name
18                retailer{
19                    id
20                }
21                address{
22                    city
23                    companyName
24                    country
25                    latitude
26                    longitude
27                    name
28                    postcode
29                    region
30                    state
31                    street
32                    timeZone
33                }
34                type
35
36                createdOn
37                
38            }
39        }
40    }
41}

Language: plain_text

Name: billingAccounts query example

Description:

[Warning: empty required content area]


Fluent Commerce

Fluent Commerce