NAV
bash javascript php python

Info

Welcome to the generated API reference. Get Postman Collection

CardPay

Endpoint for cards usage

Charge

Example request:

curl --location 'https://sandbox-cardpay.xcoop.global/api/payin/charge' \
--header 'apikey: $10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********' \
--header 'secret: $10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********' \
--header 'Content-Type: application/json' \
--data-raw '{"amount":90050,"currency":"ARS","cardData":{"cardNumber":"4507990000004905","expiration_Month":"12","expiration_Year":"30","cvv":"123"},"cardHolder":{"fName":"MARIA","mName":"MELANI","lName":"MONZI","docType":"passport","docNr":"12345678", "email":"[email protected]","phone":"5544332211","city":"Buenos Aires","address":"Av. Cordoba 123","postalCode":"1107","state":"Agentina","country":"ARG","ip":"0.0.0.0"},"establishment":{"name":"TestX","transactionId":"{{timestamp}}","customerId":11},"okUrl":"https://test.local/activity","notOkUrl":"https://test.local/activity","confirmationUrl":"https://test.local.net/v1/notification/webhook"}'
const url = new URL("https://sandbox-cardpay.xcoop.global/api/payin/charge"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "api_key": "$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********",
    "secret": "$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********",
};

let body = {
    "amount": 1015,
    "currency": "USD",
    "cardData": {
        "cardNumber": 4507990000004901,
        "expiration_Month": "08",
        "expiration_Year": "30",
        "cvv": 123
    },
    "cardHolder": {
        "fName": "MARIA",
        "mName": "MELANI",
        "lName": "MONZI",
        "docType": "passport",
        "docNr": "12345678",
        "email": "[email protected]",
        "phone": "5544332211",
        "city": "Buenos Aires",
        "address": "Av. Cordoba 123",
        "postalCode": "1107",
        "state": "Agentina",
        "country": "ARG",
        "ip": "0.0.0.0"
    },
    "establishment": {
        "name": "TEST SRL",
        "transactionId": "123",
        "customerId": "123"
    }
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://cardpay.xcoop.global/api/charge',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'api_key' => '$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********',
            'secret' => '$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********',
        ],
        'json' => [
            'amount' => 1015,
            'currency' => 'USD',
            'cardData' => [
                'cardNumber' => 4507990000004901,
                'expiration_Month' => '08',
                'expiration_Year' => '30',
                'cvv' => 123,
            ],
            'cardHolder' => [
                'fName' => 'MARIA',
                'mName' => 'MELANI',
                'lName' => 'MONZI',
                'docType' => 'passport',
                'docNr' => '12345678',
                'email' => '[email protected]',
                'phone' => '5544332211',
                'city' => 'Buenos Aires',
                'address' => 'Av. Cordoba 123',
                'postalCode' => '1107',
                'state' => 'Agentina',
                'country' => 'ARG',
                'ip' => '0.0.0.0',
            ],
            'establishment' => [
                'name' => 'TEST SRL',
                'transactionId' => '123',
                'customerId' => '123',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://cardpay.xcoop.global/api/charge'
payload = {
    "amount": 1015,
    "currency": "USD",
    "cardData": {
        "cardNumber": 4507990000004901,
        "expiration_Month": "08",
        "expiration_Year": "30",
        "cvv": 123
    },
    "cardHolder": {
        "fName": "MARIA",
        "mName": "MELANI",
        "lName": "MONZI",
        "docType": "passport",
        "docNr": "12345678",
        "email": "[email protected]",
        "phone": "5544332211",
        "city": "Buenos Aires",
        "address": "Av. Cordoba 123",
        "postalCode": "1107",
        "state": "Agentina",
        "country": "ARG",
        "ip": "0.0.0.0"
    },
    "establishment": {
        "name": "TEST SRL",
        "transactionId": "123",
        "customerId": "123"
    }
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'api_key': '$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********',
  'secret': '$10$GcPARFuvLk9LKjpdmH5MYOq7Pa3cPmMc********'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "detail": {
        "status": true,
        "requestId": "cec7a282-ee3e-435f-891c-d7e319926549",
        "id": 13224962,
        "date": "2023-05-30",
        "time": "20:04:00",
        "dataResponse": {
            "authorization": "200421",
            "description": "approved",
            "binInformation": {
                "bin": "450799",
                "bank": "",
                "product": "credit",
                "type": "",
                "brand": "Visa"
            },
            "lastFour": "4905"
        }
    },
    "result": "Completed",
    "reason": "00 - Approved or completed successfully",
    "identificator": "f604d8efb2164ff75c50df9bc3883e99",
    "cpId": 2292,
    "cardInformation": {
        "bin": "450799",
        "bank": "VISA ARGENTINA, S.A.",
        "brand": "VISA",
        "product": "CREDIT",
        "level": "",
        "iso_country": "AR",
        "lastFour": "4905"
    }
}

HTTP Request

POST api/charge

Body Parameters

Parameter Type Status Description
amount integer required Amount. No decimal separator, 2 rightmost digits represent decimals; ie.: use 1015 for 10.15.
currency string required Currency in ISO 4217 format; supported values are MXN and USD.
cardData.cardNumber integer optional Card number without spaces, symbols or separators.
cardData.expiration_Month char required Card due month, 2 digits.
cardData.expiration_Year char required Card due year, 2 digits.
cardData.cvv integer required Card CVV.
cardHolder.fName char required CardHolder First Name.
cardHolder.mName char required CardHolder Middle Name.
cardHolder.lName char required CardHolder Last Name.
cardHolder.docType char optional CardHolder ID type.
cardHolder.docNr char optional CardHolder ID number.
cardHolder.email char optional Email.
cardHolder.phone char optional Phone.
cardHolder.city char optional City.
cardHolder.address char optional Address.
cardHolder.postalCode char optional PostalCode.
cardHolder.state char optional State.
cardHolder.country char optional Country (iso3).
cardHolder.ip char optional User IP.
establishment.name char optional Establishment or eCommerce name.
establishment.transactionId char optional ID assigned by the Establishment to the transaction.If not empty then it must be unique.
establishment.customerId char optional Customer ID, assigned by the Establishment.