Activate Card
Request URL
POST /cards/:AFiCardId/activate
Description
This endpoint activates a card, if it has not already been activated. The card is identified by the path parameter.
If the card was previously activated, then this call has no effect, and the card record is returned. If the call succeeds, the record for the newly activated card is returned with the status
set to "active" and the isActive
property set to true.
Schema
Property table for cards/:AFiCardId/activate
Property | Description | Required | Schema |
---|---|---|---|
AFiCardId | ampliFi ID for the card | Yes | { "type": "string" } |
Snippet Examples
javascript
const axios = require('axios');
const config = {
method: 'POST',
url: '${AMPLIFI_BASE_URL}/cards/:AFiCardId/activate',
headers: {
'Content-Type': "application/json",
'token': "A long random string token received from /token request"
},
};
let result;
try {
result = await axios.request(config);
if (result.status === 200) {
console.log(JSON.stringify(result.data));
}
} catch (err) {
console.log({
errCode: err.code,
responseStatus: err.response && err.response.status,
data: err.response && JSON.stringify(err.response.data)
});
}
cURL
curl --location "AMPLIFI_BASE_URL/cards/:AFiCardId/activate" --header "Content-Type: application/json" --header "token: A long random string token received from /token request"
Successful Response Examples
200 CARDS/:AFICARDID/ACTIVATE SUCCESSFUL RESPONSE CARD ACTIVATION
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
token | A long random string token received from /token request |
PARAMETERS
Parameter | Description | Value |
---|---|---|
AFiCardId | [required] | qwegalgnuyocdfoxg |
REQUEST BODY
RESPONSE BODY
{
"success": true,
"card": {
"AFiCardId": "qwegalgnuyocdfoxg",
"AFiAccountId": "qwegalgnuyocdfoxg",
"typeId": "virtual",
"AFiUserId": "qweaurl8kgtlv9pc",
"cardIdBO": "cd_5cws26xjxlfbb",
"accountIdBO": "cd_5cws26xjxlfbb",
"backOfficeId": "evolve",
"backOfficeName": "evolve",
"status": "active",
"isActive": true,
"isActivated": false,
"isClosed": false,
"num": "123456******1234",
"dtsOpened": "2023-04-19T15:38:14.436Z",
"dtsExpiry": "2026-05-01T03:59:59.999Z",
"currency": "USD",
"name_on_card": "JOHN TESTMAN",
"image": "images/card3.png",
"primaryUserAFiUserId": null,
"dtsUpdated": "2023-12-11T14:24:21.081Z"
}
}