An open API service indexing awesome lists of open source software.

https://github.com/vtex/admin-customers-graphql

Manage and consume customers information
https://github.com/vtex/admin-customers-graphql

srv-crm xp-merch

Last synced: about 1 month ago
JSON representation

Manage and consume customers information

Awesome Lists containing this project

README

          

## ⚠️ Maintenance ⚠️
*After March 01 of 2023, this application will no longer be maintained by the RPT BR team. Maintenance will be the responsibility of the ecosystem, everyone will be able to make a branch with the changes or improvements they want to make, make a pull request and we will approve it.*

# admin-customers-graphql
This project is a GraphQL API to manage and consume customers informations, it is also possible to list default and custom fields that were configured on Masterdata schema.

The implementation is based on MasterData structure, and manage the documents with acronym "CL".


Table of Contents

* [Query](#query)
* [Mutation](#mutation)
* [Objects](#objects)
* [CacheableDocument](#cacheabledocument)
* [CustomField](#customfield)
* [Document](#document)
* [DocumentPOSTResponse](#documentpostresponse)
* [Field](#field)
* [Pagination](#pagination)
* [Properties](#properties)
* [Property](#property)
* [SchemaResponse](#schemaresponse)
* [User](#user)
* [UserPageResponse](#userpageresponse)
* [Inputs](#inputs)
* [DocumentInput](#documentinput)
* [FieldInput](#fieldinput)
* [Scalars](#scalars)
* [Boolean](#boolean)
* [ID](#id)
* [Int](#int)
* [String](#string)

## Query

Field
Argument
Type
Description

schema
SchemaResponse!

Query to get default and custom fields created on masterdata with acronym "CL"

users
UserPageResponse!

Query to list customers with pagination and filter

perPage
Int!

pageNumber
Int!

filter
String

## Mutation

Field
Argument
Type
Description

saveDocument
DocumentPOSTResponse!

Create a new customer with a list based on key and value. A field with key "email" is required.

document
DocumentInput!

updateDocument
Document!

Update a customer with a list based on key and value. The document id is required.

id
ID!

document
DocumentInput!

deleteDocument
CacheableDocument!

Delete a customer based on document id

id
ID!

## Objects

### CacheableDocument

Field
Argument
Type
Description

cacheId
ID!

id is used as cacheId

id
ID!

Document id

### CustomField

Custom field in a key/value format

Field
Argument
Type
Description

key
String!

Key that identify a custom field

value
Property!

Value of custom field

### Document

Document with fields that was updated

Field
Argument
Type
Description

fields
[Field!]!

Fields were updated

cacheId
ID!

id is used as cacheId

id
ID!

Document id

### DocumentPOSTResponse

Response on create a new customer document

Field
Argument
Type
Description

href
String!

A URL to access the created document by API

documentId
String!

Document id

cacheId
ID!

id is used as cacheId

id
ID!

Mutation id

### Field

Field in a key/value format

Field
Argument
Type
Description

key
String!

Key that identify the field

value
String!

Value of field

### Pagination

A pagination structure

Field
Argument
Type
Description

page
Int!

Page number

pageSize
Int!

Number of items per page

total
Int!

Total number of items

### Properties

Provide the properties about each field

Field
Argument
Type
Description

id
Property!

User ID

firstName
Property!

First name of customer

lastName
Property!

Last name of customer

email
Property!

Email address of customer

document
Property!

No. of CPF or CNPJ of customer

userId
Property!

ID of customer in CRM

birthDate
Property!

User bithdate

phone
Property!

Phone no. of customer

businessPhone
Property!

Registered phone of the company.

tradeName
Property!

Company (PJ) – Trade name

corporateName
Property!

Company name

isCorporate
Property!

Indicates if it is a company

gender
Property!

Gender of customer

homePhone
Property!

Registered phone no. of customer

stateRegistration
Property!

State registration of Company

documentType
Property!

Type of document of customer

corporateDocument
Property!

CNPJ number

isNewsletterOptIn
Property!

Opted to receive Newsletter

rcLastCart
Property!

URl to restock shopping cart with all the products

rcLastSession
Property!

ID of browsing script session

rcLastCartValue
Property!

Value of last cart

rcLastSessionDate
Property!

Date of last browsing session saved

### Property

Property contains fields with informations about custom fields

Field
Argument
Type
Description

type
String

Type of field like string/boolean/integer

title
String

Title of field like a label

format
String

Format of field like date-time/email

maxLength
Int

Max length of field

### SchemaResponse

CRM Schema

Field
Argument
Type
Description

properties
Properties!

Properties of Schema

required
[String!]!

Required fields of Schema

vIndexed
[String!]!

Indexed fields of Schema

customFields
[CustomField!]

Custom fields created by the user

### User

A user contains default properties of masterdata entity

Field
Argument
Type
Description

id
ID!

User ID

isCorporate
Boolean

Indicates if it is a company

tradeName
String

Company (PJ) – Trade name

homePhone
String

Registered phone no. of customer

phone
String

Phone no. of customer

stateRegistration
String

State registration of Company

email
String!

Email address of customer

userId
ID

ID of customer in CRM

firstName
String

First name of customer

lastName
String

Last name of customer

document
String

No. of CPF or CNPJ of customer

isNewsletterOptIn
Boolean

Opted to receive Newsletter

birthDate
String

User bithdate

businessPhone
String

Registered phone of the company.

corporateDocument
String

CNPJ number

corporateName
String

Company name

documentType
String

Type of document of customer

gender
String

Gender of customer

rcLastCart
String

URl to restock shopping cart with all the products

rcLastCartValue
String

Value of last cart

rcLastSession
String

ID of browsing script session

rcLastSessionDate
String

Date of last browsing session saved

### UserPageResponse

A entity that contains a list with users and a pagination properties

Field
Argument
Type
Description

data
[User!]!

List with users

pagination
Pagination!

Pagination info

## Inputs

### DocumentInput

Fields to create or update customer document

Field
Type
Description

fields
[FieldInput!]!

Fields in a key/value format

### FieldInput

Field in a key/value format

Field
Type
Description

key
String

Key that identify the field

value
String

Value of field

## Scalars

### Boolean

The `Boolean` scalar type represents `true` or `false`.

### ID

The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.

### Int

The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

### String

The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.