Criar Assinatura
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/subscriptions \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://homolog.clubfix.com.br/webservice/subscriptions"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://homolog.clubfix.com.br/webservice/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://homolog.clubfix.com.br/webservice/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://homolog.clubfix.com.br/webservice/subscriptions"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://homolog.clubfix.com.br/webservice/subscriptions")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 19,
"customer": {
"id": 11,
"name": "Sergio Danilo Jr.",
"document": "31815134070",
"phone": "32863751018",
"email": "sergio8@email.com",
"address": {
"street": "Beco João Veloso",
"number": 770,
"complement": null,
"zipcode": "82820320",
"neighborhood": "Bairro Alto",
"city": "Curitiba",
"state": "PR"
}
},
"device": {
"id": 2,
"name": "onetouch|5017E PIXI3 4.5 DS",
"brand": {
"id": 1,
"name": "Alcatel",
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/brands/1"
}
},
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/models/2"
},
"serial_number": "356133319339510"
},
"valor": 7.75,
"franchise": 93.33,
"is_used": true,
"status": {
"id": 18,
"assinatura_id": 19,
"status": "protegido",
"created_at": "2023-07-26T12:06:30.000000Z",
"updated_at": "2023-07-26T12:06:30.000000Z"
},
"created_at": "2023-07-26 09:06:30"
}Assinaturas
Registra uma assinatura
Contrata uma assinatura de proteção mensal para o dispositivo do cliente
POST
/
subscriptions
Criar Assinatura
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/subscriptions \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>'import requests
url = "https://homolog.clubfix.com.br/webservice/subscriptions"
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Accept: '<accept>', Authorization: 'Bearer <token>'}};
fetch('https://homolog.clubfix.com.br/webservice/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://homolog.clubfix.com.br/webservice/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://homolog.clubfix.com.br/webservice/subscriptions"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://homolog.clubfix.com.br/webservice/subscriptions")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = '<accept>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 19,
"customer": {
"id": 11,
"name": "Sergio Danilo Jr.",
"document": "31815134070",
"phone": "32863751018",
"email": "sergio8@email.com",
"address": {
"street": "Beco João Veloso",
"number": 770,
"complement": null,
"zipcode": "82820320",
"neighborhood": "Bairro Alto",
"city": "Curitiba",
"state": "PR"
}
},
"device": {
"id": 2,
"name": "onetouch|5017E PIXI3 4.5 DS",
"brand": {
"id": 1,
"name": "Alcatel",
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/brands/1"
}
},
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/models/2"
},
"serial_number": "356133319339510"
},
"valor": 7.75,
"franchise": 93.33,
"is_used": true,
"status": {
"id": 18,
"assinatura_id": 19,
"status": "protegido",
"created_at": "2023-07-26T12:06:30.000000Z",
"updated_at": "2023-07-26T12:06:30.000000Z"
},
"created_at": "2023-07-26 09:06:30"
}string
required
Token de autenticação do tipo Bearer obtido através do endpoint de login.
integer
required
ID do plano de assinatura. Obtido via
GET /plans.integer
required
ID do cliente (segurado). Obtido via
POST /customers ou GET /customers/{document}.integer
required
ID do modelo do dispositivo a ser protegido. Obtido via
GET /models.string
IMEI ou número de série do dispositivo. Opcional na contratação — o cliente pode informar na vistoria pela área do segurado. Deve ser diferente de
second_serial_number.string
Segundo IMEI (para aparelhos dual-SIM). Opcional. Deve ser diferente de
serial_number.boolean
Indica se o dispositivo possui mais de 3 meses de uso.
true ou false. Padrão: false.integer
ID de uma sub-loja vinculada ao parceiro. Opcional — permite atribuir a contratação a uma filial específica. Obtido via
GET /shopkeepers.number
Valor do LMI (Limite Máximo de Indenização) desejado. Quando informado, a API verifica se o valor está dentro da faixa autorizada para o parceiro — se estiver, aplica; caso contrário, usa o padrão do modelo. Não gera erro se fora da faixa.
object
Metadados opcionais para rastreamento e atribuição da contratação.
string
Identificador da origem da contratação (ex:
"app_ios", "pdv_sp_01", "ecommerce"). Máx. 100 caracteres.Resposta
Retorna o recurso da assinatura criada.| Campo | Tipo | Descrição |
|---|---|---|
id | integer | Identificador da assinatura. Usar nas chamadas subsequentes |
status | string | pending — aguardando pagamento da primeira parcela |
lmi | number | LMI aplicado ao contrato |
installments_count | integer | Número total de parcelas |
A assinatura permanece em
pending até que o pagamento da primeira parcela seja processado. Use GET /subscriptions/{id}/installments para listar as parcelas e POST /subscriptions/{id}/installments/{id}/notify-payment (gateway externo) ou POST /subscriptions/{id}/payment (gateway ClubFix) para ativar.Was this page helpful?
