Adicionar cartão de crédito ao customer
curl --request POST \
--url https://api.malga.io/v1/customers/{customer_id}/cards \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"cardId": "82aba896-9e37-45b6-aa90-d510c9050596"
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cardId: '82aba896-9e37-45b6-aa90-d510c9050596'})
};
fetch('https://api.malga.io/v1/customers/{customer_id}/cards', 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/customers/{customer_id}/cards"
payload := strings.NewReader("{\n \"cardId\": \"82aba896-9e37-45b6-aa90-d510c9050596\"\n}")
req, _ := http.NewRequest("POST", 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))
}Customers
Adicionar cartão de crédito ao customer
POST
/
v1
/
customers
/
{customer_id}
/
cards
Adicionar cartão de crédito ao customer
curl --request POST \
--url https://api.malga.io/v1/customers/{customer_id}/cards \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Client-Id: <api-key>' \
--data '
{
"cardId": "82aba896-9e37-45b6-aa90-d510c9050596"
}
'const options = {
method: 'POST',
headers: {
'X-Client-Id': '<api-key>',
'X-Api-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cardId: '82aba896-9e37-45b6-aa90-d510c9050596'})
};
fetch('https://api.malga.io/v1/customers/{customer_id}/cards', 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/customers/{customer_id}/cards"
payload := strings.NewReader("{\n \"cardId\": \"82aba896-9e37-45b6-aa90-d510c9050596\"\n}")
req, _ := http.NewRequest("POST", 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))
}Was this page helpful?
⌘I