Go / Bond APIs / activate a physical card [w/optional fields]
Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global_Ref.html">Global Unlock Sample for sample code.
http := chilkat.NewHttp()
var success bool
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "cvv": "XXX",
// "expiry_date": "MMYYYY"
// }
json := chilkat.NewJsonObject()
json.UpdateString("cvv","XXX")
json.UpdateString("expiry_date","MMYYYY")
http.SetRequestHeader("Content-Type","application/json")
http.SetRequestHeader("Authorization","{{authorization}}")
http.SetRequestHeader("Identity","{{identity}}")
sbRequestBody := chilkat.NewStringBuilder()
json.EmitSb(sbRequestBody)
resp := http.PTextSb("PATCH","https://{{environment}}.bond.tech/api/v0/cards/:card_id/activate_physical_card",sbRequestBody,"utf-8","application/json",false,false)
if http.LastMethodSuccess() == false {
fmt.Println(http.LastErrorText())
http.DisposeHttp()
json.DisposeJsonObject()
sbRequestBody.DisposeStringBuilder()
return
}
fmt.Println(resp.StatusCode())
fmt.Println(resp.BodyStr())
resp.DisposeHttpResponse()
http.DisposeHttp()
json.DisposeJsonObject()
sbRequestBody.DisposeStringBuilder()
Curl Command
curl -X PATCH
-H "Content-Type: application/json"
-H "Authorization: {{authorization}}"
-H "Identity: {{identity}}"
-d '{
"cvv": "XXX",
"expiry_date": "MMYYYY"
}'
https://{{environment}}.bond.tech/api/v0/cards/:card_id/activate_physical_card
Postman Collection Item JSON
{
"name": "activate a physical card [w/optional fields]",
"request": {
"method": "PATCH",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json",
"disabled": true
},
{
"key": "Authorization",
"type": "text",
"value": "{{authorization}}"
},
{
"key": "Identity",
"type": "text",
"value": "{{identity}}"
},
{
"key": "",
"value": "",
"type": "text",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "{\n \"cvv\": \"XXX\",\n \"expiry_date\": \"MMYYYY\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/cards/:card_id/activate_physical_card",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"cards",
":card_id",
"activate_physical_card"
],
"variable": [
{
"key": "card_id",
"value": "{{card_id}}"
}
]
},
"description": "Add Card financial Core"
},
"response": [
{
"name": "activate a physical card [w/optional fields]",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json",
"disabled": true
},
{
"key": "Authorization",
"type": "text",
"value": "{{authorization}}"
},
{
"key": "Identity",
"type": "text",
"value": "{{identity}}"
},
{
"key": "",
"value": "",
"type": "text",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "{\n \"cvv\": \"XXX\",\n \"expiry_date\": \"MMYYYY\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/cards/:card_id/activate_physical_card",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"cards",
":card_id",
"activate_physical_card"
],
"variable": [
{
"key": "card_id",
"value": null
}
]
}
},
"_postman_previewlanguage": "json",
"header": null,
"cookie": [
],
"body": "{\n\"card_id\":\"2742ff6a-7455-4066-8b45-ae12d3acca34\",\n\"last_four\":\"6169\",\n\"status\":\"Active\"\n}"
}
]
}