PIX
Criar cobrança PIX
Cria uma nova cobrança PIX imediata com QR Code e código PIX Copia e Cola
POST
/
api
/
pix
Criar cobrança PIX
curl --request POST \
--url https://sandboxapi.mycredit.com.br/api/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"formaPagamento": {
"tpTransacao": 11,
"idFaturaPag": "9b041599-eacc-4a0f-9a16-e0191c9a66AA",
"modPagamento": 18,
"qtdParcelas": 1,
"valorPagamento": 1.29
}
}
'import requests
url = "https://sandboxapi.mycredit.com.br/api/pix"
payload = { "formaPagamento": {
"tpTransacao": 11,
"idFaturaPag": "9b041599-eacc-4a0f-9a16-e0191c9a66AA",
"modPagamento": 18,
"qtdParcelas": 1,
"valorPagamento": 1.29
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formaPagamento: {
tpTransacao: 11,
idFaturaPag: '9b041599-eacc-4a0f-9a16-e0191c9a66AA',
modPagamento: 18,
qtdParcelas: 1,
valorPagamento: 1.29
}
})
};
fetch('https://sandboxapi.mycredit.com.br/api/pix', 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://sandboxapi.mycredit.com.br/api/pix",
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([
'formaPagamento' => [
'tpTransacao' => 11,
'idFaturaPag' => '9b041599-eacc-4a0f-9a16-e0191c9a66AA',
'modPagamento' => 18,
'qtdParcelas' => 1,
'valorPagamento' => 1.29
]
]),
CURLOPT_HTTPHEADER => [
"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://sandboxapi.mycredit.com.br/api/pix"
payload := strings.NewReader("{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandboxapi.mycredit.com.br/api/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.mycredit.com.br/api/pix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}"
response = http.request(request)
puts response.read_body{
"sucesso": true,
"data": {
"retTexto": "Inserido com sucesso.",
"retUrl": "00020101021226990014br.gov.bcb.pix2577pix.bpp.com.br/23114447/qrs2/v2/02bQN4pZi9ZfA841zm0obUq0xDJ4kK5kebEiF8e2iGr1G52040000530398654041.005802BR5924SATURNIA TECNOLOGIA LTDA6009SAO PAUL062070503***63044F29",
"transacaoId": "9f8b4c46-82cd-4388-52b4-08dddfd74ba1",
"expira": "2025-08-20T11:29:24.4187003Z"
}
}{
"sucesso": false,
"errors": "Mensagem de erro"
}{
"sucesso": false,
"errors": "Mensagem de erro"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Dados da cobrança PIX imediata
⌘I
Criar cobrança PIX
curl --request POST \
--url https://sandboxapi.mycredit.com.br/api/pix \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"formaPagamento": {
"tpTransacao": 11,
"idFaturaPag": "9b041599-eacc-4a0f-9a16-e0191c9a66AA",
"modPagamento": 18,
"qtdParcelas": 1,
"valorPagamento": 1.29
}
}
'import requests
url = "https://sandboxapi.mycredit.com.br/api/pix"
payload = { "formaPagamento": {
"tpTransacao": 11,
"idFaturaPag": "9b041599-eacc-4a0f-9a16-e0191c9a66AA",
"modPagamento": 18,
"qtdParcelas": 1,
"valorPagamento": 1.29
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
formaPagamento: {
tpTransacao: 11,
idFaturaPag: '9b041599-eacc-4a0f-9a16-e0191c9a66AA',
modPagamento: 18,
qtdParcelas: 1,
valorPagamento: 1.29
}
})
};
fetch('https://sandboxapi.mycredit.com.br/api/pix', 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://sandboxapi.mycredit.com.br/api/pix",
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([
'formaPagamento' => [
'tpTransacao' => 11,
'idFaturaPag' => '9b041599-eacc-4a0f-9a16-e0191c9a66AA',
'modPagamento' => 18,
'qtdParcelas' => 1,
'valorPagamento' => 1.29
]
]),
CURLOPT_HTTPHEADER => [
"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://sandboxapi.mycredit.com.br/api/pix"
payload := strings.NewReader("{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandboxapi.mycredit.com.br/api/pix")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.mycredit.com.br/api/pix")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"formaPagamento\": {\n \"tpTransacao\": 11,\n \"idFaturaPag\": \"9b041599-eacc-4a0f-9a16-e0191c9a66AA\",\n \"modPagamento\": 18,\n \"qtdParcelas\": 1,\n \"valorPagamento\": 1.29\n }\n}"
response = http.request(request)
puts response.read_body{
"sucesso": true,
"data": {
"retTexto": "Inserido com sucesso.",
"retUrl": "00020101021226990014br.gov.bcb.pix2577pix.bpp.com.br/23114447/qrs2/v2/02bQN4pZi9ZfA841zm0obUq0xDJ4kK5kebEiF8e2iGr1G52040000530398654041.005802BR5924SATURNIA TECNOLOGIA LTDA6009SAO PAUL062070503***63044F29",
"transacaoId": "9f8b4c46-82cd-4388-52b4-08dddfd74ba1",
"expira": "2025-08-20T11:29:24.4187003Z"
}
}{
"sucesso": false,
"errors": "Mensagem de erro"
}{
"sucesso": false,
"errors": "Mensagem de erro"
}