Processar Pagamento
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"creditCard": {
"number": "5448280000000007",
"expirate_at": "1228",
"cvv": "123"
}
}
'import requests
url = "https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment"
payload = { "creditCard": {
"number": "5448280000000007",
"expirate_at": "1228",
"cvv": "123"
} }
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({creditCard: {number: '5448280000000007', expirate_at: '1228', cvv: '123'}})
};
fetch('https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment', 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/{subscriptionId}/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'creditCard' => [
'number' => '5448280000000007',
'expirate_at' => '1228',
'cvv' => '123'
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment"
payload := strings.NewReader("{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/{subscriptionId}/payment")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"plan": {
"id": 1,
"name": "Proteção Clubfix",
"coverages": [
"Quebra de Tela",
"Danos Líquidos",
"Oxidação",
"Alto Falantes",
"Microfone",
"Danos Internos",
"Conector de Carga",
"Wi-Fi/Sinal"
]
},
"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": 1,
"name": "onetouch|5017A PIXI3 4.5 SS",
"brand": {
"id": 1,
"name": "Alcatel",
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/brands/1"
}
},
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/models/1"
},
"serial_number": "356133319339502",
"is_used": true
},
"valor": 7.04,
"franchise": 84.83,
"status": "PROTECTED",
"created_at": "2023-07-26 08:43:56"
}Assinaturas
Processa o pagamento de uma assinatura
Registra o pagamento da primeira parcela via gateway ClubFix, ativando a assinatura
POST
/
subscriptions
/
{subscriptionId}
/
payment
Processar Pagamento
curl --request POST \
--url https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"creditCard": {
"number": "5448280000000007",
"expirate_at": "1228",
"cvv": "123"
}
}
'import requests
url = "https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment"
payload = { "creditCard": {
"number": "5448280000000007",
"expirate_at": "1228",
"cvv": "123"
} }
headers = {
"Accept": "<accept>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({creditCard: {number: '5448280000000007', expirate_at: '1228', cvv: '123'}})
};
fetch('https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment', 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/{subscriptionId}/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'creditCard' => [
'number' => '5448280000000007',
'expirate_at' => '1228',
'cvv' => '123'
]
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment"
payload := strings.NewReader("{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Accept", "<accept>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/{subscriptionId}/payment")
.header("Accept", "<accept>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://homolog.clubfix.com.br/webservice/subscriptions/{subscriptionId}/payment")
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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"creditCard\": {\n \"number\": \"5448280000000007\",\n \"expirate_at\": \"1228\",\n \"cvv\": \"123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"plan": {
"id": 1,
"name": "Proteção Clubfix",
"coverages": [
"Quebra de Tela",
"Danos Líquidos",
"Oxidação",
"Alto Falantes",
"Microfone",
"Danos Internos",
"Conector de Carga",
"Wi-Fi/Sinal"
]
},
"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": 1,
"name": "onetouch|5017A PIXI3 4.5 SS",
"brand": {
"id": 1,
"name": "Alcatel",
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/brands/1"
}
},
"meta": {
"link": "https://homolog.clubfix.com.br/webservice/models/1"
},
"serial_number": "356133319339502",
"is_used": true
},
"valor": 7.04,
"franchise": 84.83,
"status": "PROTECTED",
"created_at": "2023-07-26 08:43:56"
}integer
required
ID da assinatura retornada na contratação (
POST /subscriptions). A assinatura deve estar com status pending.string
required
Token de autenticação do tipo Bearer obtido através do endpoint de login.
object
required
Dados do cartão de crédito do cliente.
string
required
Número do cartão de crédito, somente dígitos (ex:
4111111111111111).string
required
Data de validade do cartão no formato
MMYY (ex: 1228 para dezembro/2028).string
required
Código de segurança do cartão (CVV/CVC). 3 ou 4 dígitos.
Quando usar
Este endpoint é para parceiros que utilizam o gateway de pagamento ClubFix. O pagamento é processado diretamente pela ClubFix ao receber este request.Este endpoint só está disponível para parceiros com gateway ClubFix habilitado. Parceiros com gateway externo devem usar
POST /subscriptions/{id}/installments/{id}/notify-payment e receberão erro 422 ao chamar este endpoint.Fluxo
POST /subscriptions → status: pending
↓
POST /subscriptions/{id}/payment ← este endpoint
↓
Assinatura: status pago ✓ (ativada)
Para o gateway ClubFix, apenas a primeira parcela é cobrada aqui. As parcelas subsequentes são processadas automaticamente pela recorrência configurada.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?
