White Label

Resumo

A API de White Label é um serviço da GoTokens utilizada para a parametrização da loja e personalização das diferentes interfaces disponívies no sistema através da gestão de templates, é possível personalizar o Painel Administrativo, Loja e App.

Como funciona

O cliente deve passar como parâmetro suas credenciais de usuário e caso ela esteja ativo e possua o serviço de White Label da GoBlockchain ele poderá definir parâmetros da loja e listar, criar, editar e excluir templates.

O que são Temas?

São Layouts disponibilizados pela GoBlockchain para serem usado como base do template.

O que são Templates?

São personalizaçẽos criadas pela empresa, possuem o código do tema a ser usado e as variáveis de personalizações, pode-se criar multiplos templates com o mesmo tema e personalizações diferentes ou multiplos templates com themas diferentes. *Podem serem usados em datas comemorativas por exemplo.

Configurações

As configurações armazenam dados usados no preenchimento e montagem das telas, dados como links de redes sociais, meios de pagamento aceitos, logotipo, cores principais, etc. Estão diretamente no objeto settings, após a empresa finalizar a configuração inicial o white label já está pronto para operar com uma Loja Padrão.

Templates

A criação de templates é um processo separado, a empresa deverá escolher o tema para o template que está criando e personalizar para web e mobile, depois a empresa poderá atribuir esse template a uma Company (todas as comunidades da emrpesa passam a usar esse template como padrão) e/ou Comunidade (caso queria usar templates distintos em diferentes comunidades)

O Objeto template recebe dados de personalização separados em header/page/card/footer e são utilizados em Cascata, ou seja o frontend da loja dará preferência para as variáveis seguindo a seguinte hierarquia de prioridades: Template da Comunidades, Template da Empresa, e Default (caso não configure no template)

Objeto Settings

Exemplo de Objeto de Configurações
{
  "companyId": "",
  "title": "StockCar",
  "description": "StockCar is a decentralized platform for trading and investing in sports cars.",
  "termsAndConditions": "https://stockcar.io/terms-and-conditions",
  "privacyPolicy": "https://stockcar.io/privacy-policy",
  "supportEmail": "",
  "supportUrl": "https://stockcar.io/contact-us",
  "googleAnalyticsId": "",
  "GTMTrackinID": "GTM-NSBFS33",
  "logo": "https://stockcar.io/assets/img/logo.png",
  "mainColor": "#e0c160",
  "secondaryColor": "#e0c160",
  "theme": "default",
  "websiteUrl": "https://www.stockproseries.com.br",
  "twitterUrl": "https://twitter.com/stock_car?lang=en",
  "facebookUrl": "https://www.facebook.com/stockcaroficial",
  "instagramUrl": "https://www.instagram.com/stock_car/?hl=en",
  "youtubeUrl": "https://www.youtube.com/user/stockcarchannel",
  "telegramUrl": "https://t.me/+pmcn19QEC2s0ZWIx"
  "walletProviders": ["metamask"],
  "socialLogin": ["google", "facebook"],
  "socialLoginActive": true
}

Objeto Template

Exemplo de Objeto de Template
{
  "id": "123123",
  "companyId": "1234234234",
  "web": {
    "theme": "default",
    "mainColorLight": "#e0c160",
    "secondaryColorLight": "#e0c160",
    "mainColorDark": "#e0c160",
    "secondaryColorDark": "#e0c160",
    "header": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ],
      "logo": {
        "url": "https://i.imgur.com/mWkGKDB.jpeg",
        "width": "100px",
        "height": "100px",
        "position": "left"
      }
    },
    "footer": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ],
      "logo": {
        "url": "https://i.imgur.com/mWkGKDB.jpeg",
        "width": "100px",
        "height": "100px",
        "position": "left"
      }
    },
    "page": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ]
    },
    "card": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ]
    }
  },
  "mobile": {}
}

Endpoints

Configurações

  • GET /v1/white-label/settings/:companyId

  • PATCH /v1/white-label/settings/:companyId

Templates

  • POST /v1/white-label/templates

  • GET /v1/white-label/templates

  • GET /v1/white-label/templates/:templateId

  • PATCH /v1/white-label/tempaltes/:templateId

  • DELETE /v1/white-label/templates/:templateId

Atribuição de templates

  • POST /v1/white-label/templates/community/:communityId

Configurações

Configurações da empresa

GET https://goblockchain.io/gotokens-api/v1/white-label/settings/:companyId

Nível de autorização necessário: público

Path Parameters

{
  "companyId": "",
  "title": "StockCar",
  "description": "StockCar is a decentralized platform for trading and investing in sports cars.",
  "termsAndConditions": "https://stockcar.io/terms-and-conditions",
  "privacyPolicy": "https://stockcar.io/privacy-policy",
  "supportEmail": "",
  "supportUrl": "https://stockcar.io/contact-us",
  "googleAnalyticsId": "",
  "GTMTrackinID": "GTM-NSBFS33", 
  "logo": "https://stockcar.io/assets/img/logo.png",
  "mainColor": "#e0c160",
  "secondaryColor": "#e0c160",
  "defaultTheme": "default",
  "socialLinks": {
    "websiteUrl": "https://www.stockproseries.com.br",
    "twitterUrl": "https://twitter.com/stock_car?lang=en",
    "facebookUrl": "https://www.facebook.com/stockcaroficial",
    "instagramUrl": "https://www.instagram.com/stock_car/?hl=en",
    "youtubeUrl": "https://www.youtube.com/user/stockcarchannel",
    "telegramUrl": "https://t.me/+pmcn19QEC2s0ZWIx"
  },
  "walletProviders": ["metamask"],
  "socialLogin": ["google", "facebook"],
  "socialLoginActive": true
}

(JWT) Altera configurações da empresa

PATCH https://goblockchain.io/gotokens-api/v1/white-label/settings/:companyId

Nível de autorização necessário: company_admin

Path Parameters

Headers

Request Body

{
  "companyId": "",
  "title": "StockCar",
  "description": "StockCar is a decentralized platform for trading and investing in sports cars.",
  "termsAndConditions": "https://stockcar.io/terms-and-conditions",
  "privacyPolicy": "https://stockcar.io/privacy-policy",
  "supportEmail": "",
  "supportUrl": "https://stockcar.io/contact-us",
  "googleAnalyticsId": "",
  "GTMTrackinID": "GTM-NSBFS33", 
  "logo": "https://stockcar.io/assets/img/logo.png",
  "mainColor": "#e0c160",
  "secondaryColor": "#e0c160",
  "defaultTheme": "default",
  "socialLinks": {
    "websiteUrl": "https://www.stockproseries.com.br",
    "twitterUrl": "https://twitter.com/stock_car?lang=en",
    "facebookUrl": "https://www.facebook.com/stockcaroficial",
    "instagramUrl": "https://www.instagram.com/stock_car/?hl=en",
    "youtubeUrl": "https://www.youtube.com/user/stockcarchannel",
    "telegramUrl": "https://t.me/+pmcn19QEC2s0ZWIx"
  },
  "walletProviders": ["metamask"],
  "socialLogin": ["google", "facebook"],
  "socialLoginActive": true
}

Templates

(JWT) Cria um template com as informações enviadas

POST https://goblockchain.io/gotokens-api/v1/white-label/templates

Nível de autorização necessário: company_admin

Headers

Request Body

{
  "id": "123123",
  "companyId": "1234234234",
  "mobile": {
    "theme": "default",
    "mainColorLight": "#e0c160",
    "secondaryColorLight": "#e0c160",
    "mainColorDark": "#e0c160",
    "secondaryColorDark": "#e0c160",
    "header": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ],
      "logo": {
        "url": "https://i.imgur.com/mWkGKDB.jpeg",
        "width": "100px",
        "height": "100px",
        "position": "left"
      }
    },
    "footer": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ],
      "logo": {
        "url": "https://i.imgur.com/mWkGKDB.jpeg",
        "width": "100px",
        "height": "100px",
        "position": "left"
      }
    },
    "page": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ]
    },
    "card": {
      "backgroundColor": "#1a1a1a",
      "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
      "titles": [
        {
          "tag": "h1",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "24px"
        },
        {
          "tag": "h2",
          "color": "#ffffff",
          "font": "Arial",
          "style": "bold",
          "size": "18px"
        }
      ],
      "text": {
        "color": "#ffffff",
        "font": "Arial",
        "style": "bold",
        "size": "12px"
      },
      "buttons": [
        {
          "name": "primary",
          "type": "circle",
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "icon": "fa fa-lightbulb-o",
          "iconPosition": "left",
          "borderColor": "#ffffff",
          "borderEffect": "none",
          "color": "#ffffff",
          "font": "Arial",
          "size": "12px",
          "style": "bold",
          "hover": {
            "borderColor": "#ffffff",
            "borderEffect": "none",
            "backgroundColor": "#1a1a1a",
            "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
            "color": "#ffffff",
            "font": "Arial",
            "size": "12px",
            "style": "bold"
          }
        }
      ]
    }
  },
  "web": {}
}

(JWT) Lista de templates da empresa

GET https://goblockchain.io/gotokens-api/v1/white-label/templates

Nível de autorização necessário: company_admin

Query Parameters

{
  "templates": [
    {
      "mobile": {
        "theme": "default",
        "mainColorLight": "#e0c160",
        "secondaryColorLight": "#e0c160",
        "mainColorDark": "#e0c160",
        "secondaryColorDark": "#e0c160",
        "header": {
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "titles": [
            {
              "tag": "h1",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "24px"
            },
            {
              "tag": "h2",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "18px"
            }
          ],
          "text": {
            "color": "#ffffff",
            "font": "Arial",
            "style": "bold",
            "size": "12px"
          },
          "buttons": [
            {
              "name": "primary",
              "type": "circle",
              "backgroundColor": "#1a1a1a",
              "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
              "icon": "fa fa-lightbulb-o",
              "iconPosition": "left",
              "borderColor": "#ffffff",
              "borderEffect": "none",
              "color": "#ffffff",
              "font": "Arial",
              "size": "12px",
              "style": "bold",
              "hover": {
                "borderColor": "#ffffff",
                "borderEffect": "none",
                "backgroundColor": "#1a1a1a",
                "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
                "color": "#ffffff",
                "font": "Arial",
                "size": "12px",
                "style": "bold"
              }
            }
          ],
          "logo": {
            "url": "https://i.imgur.com/mWkGKDB.jpeg",
            "width": "100px",
            "height": "100px",
            "position": "left"
          }
        },
        "footer": {
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "titles": [
            {
              "tag": "h1",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "24px"
            },
            {
              "tag": "h2",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "18px"
            }
          ],
          "text": {
            "color": "#ffffff",
            "font": "Arial",
            "style": "bold",
            "size": "12px"
          },
          "buttons": [
            {
              "name": "primary",
              "type": "circle",
              "backgroundColor": "#1a1a1a",
              "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
              "icon": "fa fa-lightbulb-o",
              "iconPosition": "left",
              "borderColor": "#ffffff",
              "borderEffect": "none",
              "color": "#ffffff",
              "font": "Arial",
              "size": "12px",
              "style": "bold",
              "hover": {
                "borderColor": "#ffffff",
                "borderEffect": "none",
                "backgroundColor": "#1a1a1a",
                "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
                "color": "#ffffff",
                "font": "Arial",
                "size": "12px",
                "style": "bold"
              }
            }
          ],
          "logo": {
            "url": "https://i.imgur.com/mWkGKDB.jpeg",
            "width": "100px",
            "height": "100px",
            "position": "left"
          }
        },
        "page": {
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "titles": [
            {
              "tag": "h1",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "24px"
            },
            {
              "tag": "h2",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "18px"
            }
          ],
          "text": {
            "color": "#ffffff",
            "font": "Arial",
            "style": "bold",
            "size": "12px"
          },
          "buttons": [
            {
              "name": "primary",
              "type": "circle",
              "backgroundColor": "#1a1a1a",
              "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
              "icon": "fa fa-lightbulb-o",
              "iconPosition": "left",
              "borderColor": "#ffffff",
              "borderEffect": "none",
              "color": "#ffffff",
              "font": "Arial",
              "size": "12px",
              "style": "bold",
              "hover": {
                "borderColor": "#ffffff",
                "borderEffect": "none",
                "backgroundColor": "#1a1a1a",
                "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
                "color": "#ffffff",
                "font": "Arial",
                "size": "12px",
                "style": "bold"
              }
            }
          ]
        },
        "card": {
          "backgroundColor": "#1a1a1a",
          "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
          "titles": [
            {
              "tag": "h1",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "24px"
            },
            {
              "tag": "h2",
              "color": "#ffffff",
              "font": "Arial",
              "style": "bold",
              "size": "18px"
            }
          ],
          "text": {
            "color": "#ffffff",
            "font": "Arial",
            "style": "bold",
            "size": "12px"
          },
          "buttons": [
            {
              "name": "primary",
              "type": "circle",
              "backgroundColor": "#1a1a1a",
              "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
              "icon": "fa fa-lightbulb-o",
              "iconPosition": "left",
              "borderColor": "#ffffff",
              "borderEffect": "none",
              "color": "#ffffff",
              "font": "Arial",
              "size": "12px",
              "style": "bold",
              "hover": {
                "borderColor": "#ffffff",
                "borderEffect": "none",
                "backgroundColor": "#1a1a1a",
                "backgroundUrl": "https://i.imgur.com/mWkGKDB.jpeg",
                "color": "#ffffff",
                "font": "Arial",
                "size": "12px",
                "style": "bold"
              }
            }
          ]
        }
      },
      "web": {
        /* mesmo padrão do mobile */
      }