Apply a purchase to a card
This operation allow you to apply a charge to a card. The charge is similar to Withdrawal, but allow you to specify a merchant description for the charge. This operation decrease your card's available balance and increases your collection balance account.
HTTP Request
POST /cards/purchase
Header Parameters
Header | Description |
---|---|
Authorization required | The Bearer token created in Get authorization Token |
Content-Type required | application/json |
Body parameters
Parameter | Type | Pattern | Description |
---|---|---|---|
card_number required | string | 16 digits* or uuid | The card_number or card_id that will receive the charge. |
amount required | float | digits | The amount to charge |
merchant_description required | string | 1-32 characters | The name or description of the charge |
latitude required | float | Digits format "DD.ddddd" (5 decimal precision) | Latitude from where the purchase is applyed. South latitudes are preceded by a minus sign. Latitudes range from -90 to 90 |
longitude required | float | Digits format "DDD.ddddd" (5 decimal precision) | Longitude from where the purchase is applyed. West longitudes are preceded by a minus sign. Longitudes range from -180 to 180 |
pin optional | string | 4 digits** | The PIN if you need cardholder validation |
note
*If card_number is sended as 16 digits, it must be sended ciphered and Base 64 Encoded. See Data encryption & encoding.
note
*pin must be sended ciphered and Base 64 Encoded. See Data encryption & encoding.
Example JSON Request:
{
"card_number": "11111111-daa7-1234-aaaa-123123123ecd",
"amount": 1000.55,
"merchant_description": "CARGO POR COMISIONES",
"pin": "t7wog3ytUb4pDQZT6AhE1USJab_-v7ut6AztPIH_SJK9gRETQQnFmqFPS-qcexyuRly0Hr9_jaG5YAnE_7CNNl_nbLYBi6YJvpnoZFSQdVgPaI0Pm07pl6SNPz3S0",
"latitude": 12.12345,
"longitude": 15.12345
}
Example JSON Response:
{
"success": true,
"code": 0,
"message": "OK",
"data": {
"operation": {
"id": "4158d533-e95a-4c05-a341-ef7d369d3a09",
"authorization_code": "542010",
"amount": 1000.55,
"merchant_description": "CARGO POR COMISIONES"
},
"card": {
"id": "11111111-daa7-1234-aaaa-123123123ecd",
"masked_card_number": "************1234",
"type": "PHYSICAL",
"status": "ACTIVE"
},
"account": {
"id": "22222222-daa7-1234-aaaa-123123123ecd",
"reference": 555555555
}
}
}