curl --request PATCH \
--url https://api.malga.io/v1/charges/{id}/antifraud \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"status": "approved"
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({status: 'approved'})
};
fetch('https://api.malga.io/v1/charges/{id}/antifraud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/charges/{id}/antifraud"
payload := strings.NewReader("{\n \"status\": \"approved\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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))
}{
"id": "148d5db0-f1c3-439f-902d-f1f268086e1d",
"clientId": "cc0b1e41-2936-45c5-947f-93995ffcdc00",
"createdAt": "2012-06-30 23:59:59 +0000",
"amount": 150,
"currency": "BRL",
"orderId": "32c68ff7-902c-408b-b464-cf487c7cda97",
"statementDescriptor": "LOJA JOAO",
"description": "Descrição longa da cobrança",
"capture": false,
"isDispute": false,
"status": "pre_authorized",
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"paymentSource": {
"sourceType": "card",
"cardId": "148d5db0-f1c3-439f-902d-f1f268086e1d"
},
"transactionRequests": [
{
"id": "78601913-a176-4d71-b7e8-abb6fc49a340",
"idempotencyKey": "fafe857b176e45d6b12e32fcaf228996",
"providerId": "2c3b57d8-ee43-4b19-bc8a-949a88c51df1",
"providerType": "STRIPE",
"transactionId": "ch_3JYE7MHjGFBGEeiP0lfTD3Ob",
"amount": 1500,
"authorizationNsu": "1cc8391c-f0d5-4b7a-9fcf-653cea26be13",
"requestStatus": "success",
"requestType": "authorization",
"responseTs": "2633ms",
"createdAt": "2021-08-12T16:08:39.536Z",
"updatedAt": "2021-08-12T16:08:42.212Z",
"providerAuthorization": {
"networkAuthorizationCode": "00",
"networkResponseCode": ""
}
}
],
"appInfo": {
"platform": {
"integrator": "malga",
"name": "pluging-vtex-ppp",
"version": "1.12"
},
"device": {
"name": "iOS",
"version": "10.12"
},
"system": {
"name": "VTEX",
"version": "13.12"
}
}
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Alterar o status do antifraude no ambiente de sandbox
curl --request PATCH \
--url https://api.malga.io/v1/charges/{id}/antifraud \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"status": "approved"
}
'const options = {
method: 'PATCH',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({status: 'approved'})
};
fetch('https://api.malga.io/v1/charges/{id}/antifraud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.malga.io/v1/charges/{id}/antifraud"
payload := strings.NewReader("{\n \"status\": \"approved\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Client-Id", "<api-key>")
req.Header.Add("X-Api-Key", "<api-key>")
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))
}{
"id": "148d5db0-f1c3-439f-902d-f1f268086e1d",
"clientId": "cc0b1e41-2936-45c5-947f-93995ffcdc00",
"createdAt": "2012-06-30 23:59:59 +0000",
"amount": 150,
"currency": "BRL",
"orderId": "32c68ff7-902c-408b-b464-cf487c7cda97",
"statementDescriptor": "LOJA JOAO",
"description": "Descrição longa da cobrança",
"capture": false,
"isDispute": false,
"status": "pre_authorized",
"paymentMethod": {
"paymentType": "credit",
"installments": 1
},
"paymentSource": {
"sourceType": "card",
"cardId": "148d5db0-f1c3-439f-902d-f1f268086e1d"
},
"transactionRequests": [
{
"id": "78601913-a176-4d71-b7e8-abb6fc49a340",
"idempotencyKey": "fafe857b176e45d6b12e32fcaf228996",
"providerId": "2c3b57d8-ee43-4b19-bc8a-949a88c51df1",
"providerType": "STRIPE",
"transactionId": "ch_3JYE7MHjGFBGEeiP0lfTD3Ob",
"amount": 1500,
"authorizationNsu": "1cc8391c-f0d5-4b7a-9fcf-653cea26be13",
"requestStatus": "success",
"requestType": "authorization",
"responseTs": "2633ms",
"createdAt": "2021-08-12T16:08:39.536Z",
"updatedAt": "2021-08-12T16:08:42.212Z",
"providerAuthorization": {
"networkAuthorizationCode": "00",
"networkResponseCode": ""
}
}
],
"appInfo": {
"platform": {
"integrator": "malga",
"name": "pluging-vtex-ppp",
"version": "1.12"
},
"device": {
"name": "iOS",
"version": "10.12"
},
"system": {
"name": "VTEX",
"version": "13.12"
}
}
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}{
"error": {
"code": 123,
"declinedCode": "<string>",
"key": "<string>",
"businessCode": "<string>",
"message": "<string>",
"details": "<array>"
}
}Path Parameters
Id da cobrança que deseja alterar no sandbox
Body
Status do antifraude
approved, reproved, failed Response
Success
Identificador da transação
Identificador do cliente na Malga
Identificador do merchant id utilizado na transação
Identificador do customer id
Descrição da cobrança para consulta futura
Valor da transação em centavos, exemplo 100 para cobrar R$ 1,00
Valor da transação em centavos, exemplo 100 para cobrar R$ 1,00
Identificador da moeda para processamento da cobrança, formato ISO 4217.
Descrição a ser exibida na fatura do comprador
Determina se a transação deve ser capturada automaticamente
Determina se a transação está em disputa
Status da transação na Malga
pending, pre_authorized, authorized, failed, canceled, voided, charged_back, refund_pending, capture_pending Identificador único da cobrança do lado do cliente para conciliação futura
Nome do provedor de pagamento responsável pela transação
- Cartão de crédito
- Pix
- Boleto
- NuPay
- Drip
- Voucher
- ApplePay
Show child attributes
Show child attributes
Dados para cobrança por cartão de crédito salve
- Cartão de crédito
- Cartão tokenizado
- Customer
- Wallet
Show child attributes
Show child attributes
Data de criação do cartão
Data de atualização do cartão
Parâmetros adicionais para analise de fraude
Show child attributes
Show child attributes
Campos adicionais para uso em condicionais dos fluxos inteligentes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Informações sobre a rastreabilidade da cobrança
Show child attributes
Show child attributes
Parâmetros adicionais para transacionar com Split
Show child attributes
Show child attributes
Detalhes da taxa de plataforma aplicada na cobrança quando há splitRules e o merchant tem platform fee habilitado. Ausente quando não há aplicação de platform fee.
Show child attributes
Show child attributes
Related topics
Fluxo do Antifraude AssíncronoAlterar o status de uma cobrança no ambiente de sandboxAlterar status de recebedor no SandboxGuia de testeWas this page helpful?