Skip to content

Credit card payment

Request via POST method, this endpoint generates a credit card transaction.

POST https://[base_url]/v2/virtual-terminal/credit-card

Endpoint body

The data of the "card_item" object must be encrypted, as explained in Security on sensitive data

{
  "order": {
    "ref_name": "Jhon Doe",
    "ref_lastname": "Jhon Doe",
    "ref_number": "123456789",
    "external_ref_id": "mkid-000000001-test",
    "temp_webhook_url": "https://<host_url>/webhook",
    "source": "Autocore WebApp"
    "detail": "Booking payment Hotel ABC",
    "amount": 1000,
    "installments":2,
    "tax_percent": 0,
    "service_percent": 0,
    "hotel_id": 1,
    "email": "[email protected]",
    "phone": "3012104578",
    "address":"My address"
    "fiscal_number": "123456789",
    "ip": "181.204.153.195"
  },
  "card_item": {
    "cc_code": "SOGBH+0cTEUzCNK00bQ41ofYw==",
    "cc_number": "dBLXqs5dK3MCABhEtVhhA==",
    "cc_expire_month": "rNmtqARSyKdccv4CNfqLATTg==",
    "cc_expire_year": "nORC2oEmmNHmDYe8bbZXD9g60sqQK8ih2w==",
    "cc_holder": "AUXYaEB5+UAldL7Srmuw=="
  }
}

Body parameters

PARAMETER TYPE REQ DESCRIPTION
order Object Yes Payment Order Details
order.ref_name String Yes Buyer's Name
order.ref_lastname String Yes Buyer's Lastname
order.ref_number String Yes Order Reference in the merchant. This payment will be identified using this reference
order.external_ref_id String No Client unique identifier.
order.temp_webhook_url String No Url of the webhook to which the payment notification will be sent by Autocore. It must be an endpoint that receives POST requests.
order.source String No Identifies the origin of the integration. Used to distinguish between multiple integration sources connected to the same client. Please contact [email protected] to get your sources indentifiers.
order.detail String No Description of the order to be paid. Maximum length of 99 characters
order.amount Float Yes Total amount to be charged, includes the amount for services and taxes. Format: Decimal with two fraction digits
order.installments Integer Yes Number of installments to defer the purchase.
order.tax_percent Float No The tax rate that will be applied to this payment. Format: Decimal with two fraction digits. The value must be between 0.00 and 1.00
order.service_percent Float No The service charge rate that will be applied to this payment. Format: Decimal with two fraction digits. Format: Decimal with two fraction digits. The value must be between 0.00 and 1.00
order.hotel_id Int Yes Unique identifier of the hotel, Refer to List hotels
order.email String No Buyer's Email Address
order.phone String No Buyer's Phone number
order.address String No Buyer's address
order.fiscal_number String No Buyer's Tax ID
order.ip String No Buyer's IPv4 address
card_item.cc_code String Yes Encrypted string representing 3 or 4 digits of the credit/debit card security code (CVV/CVC)
card_item.cc_number String Yes Encrypted string representing the credit/debit card number
card_item.cc_expire_month String Yes Encrypted string representing 1 or 2 digits of the credit/debit card expiration month (MM)
card_item.cc_expire_year String Yes Encrypted string representing 4 digits of the credit/debit card expiration year (yyyy)
card_item.cc_holder String Yes Encrypted string representing the name of the credit/debit card holder

Test cards:

Card Number Status CVC Expiry Date Description
4111111111111111 Approved 123 Any future Test card for successful payments
1111111111111111 Declined 123 Any future Test card for failed payments
36417002140808 Pending - Approved 123 Any future Test card for pending approved transactions
5555555555554444 Pending - Declined 123 Any future Test card for pending approved transactions

Endpoint response

{
  "payment_status": "En proceso",
  "amount": 1000,
  "payment_date": "2025-05-20T11:21:06.417487",
  "company": "Company Example",
  "hotel": "Booking payment Hotel ABC",
  "voucher_url": "https://api-dev.autocore.pro/v2/terminal-payments/xxx/vouchers",
  "transaction_id": "7e83a7a2-54c6-4ce0-9a8b-660348805b2a",
  "external_ref_id": "mkid-000000001-test",
  "details": {
    "type": "charge",
    "id": "123456789",
    "external_ref_id": "mkid-000000001-test",
    "status_code": "in_process",
    "status_detail": "En proceso",
    "comments": "Pago con referencia 123456789 en proceso de revisión.",
    "transaction_id": "7e83a7a2-54c6-4ce0-9a8b-660348805b2a",
    "transaction_date": "2025-05-20T11:22:01.884045"
  }
}
{
  "msg": "Pago realizado correctamente",
  "voucher_url": "v2/terminal-payments/481/vouchers",
  "details": {
      "type": "charge",
      "id": "123456789",
      "external_ref_id": "mkid-000000001-test",
      "status_code": "applied",
      "status_detail": "Aplicado",
      "comments": "Pago con referencia 123456789 procesado correctamente",
      "transaction_id": "RB-703242",
      "transaction_date": "2025-04-23 12:45:24.706330"
  }
}
{
    "code": 0,
    "message": "Error http: 400",
    "detail": "El pago ha sido rechazado",
    "extra_info": {
    "voucher_url": "v2/terminal-payments/481/vouchers",
    "details": {
        "type": "charge",
        "id": "123456789",
        "external_ref_id": "mkid-000000001-test",
        "status_code": "rejected",
        "status_detail": "Rechazado",
        "comments": "Fondos insuficientes.",
        "transaction_id": null,
        "transaction_date": "2025-04-23 13:08:40.738978"
    }
    }
}

Webhook:

A webhook notification will be sent to the URL in order.temp_webhook_url:

{
  "payment_status": "Rechazado",
  "amount": 1000,
  "payment_date": "2025-05-20T11:23:36.750836",
  "company": "Company Example",
  "hotel": "Booking payment Hotel ABC",
  "voucher_url": "https://api-dev.autocore.pro/v2/terminal-payments/xxx/vouchers",
  "transaction_id": "N/A",
  "external_ref_id": "mkid-000000001-test",
  "details": {
    "type": "charge",
    "id": "123456789",
    "external_ref_id": "mkid-000000001-test",
    "status_code": "rejected",
    "status_detail": "Rechazado",
    "comments": "El número de tarjeta de crédito no es válido., El código de seguridad de la tarjeta es inválido.",
    "transaction_id": "N/A",
    "transaction_date": "2025-05-20T11:23:36.750836"
  }
}
{
  "payment_status": "Aplicado",
  "amount": 1000,
  "payment_date": "2025-05-20T11:21:06.417487",
  "company": "Company Example",
  "hotel": "Booking payment Hotel ABC",
  "voucher_url": "https://api-dev.autocore.pro/v2/terminal-payments/xxx/vouchers",
  "transaction_id": "0196ed6d-145c-7025-b8d2-35c7b9c69bae",
  "external_ref_id": "mkid-000000001-test",
  "details": {
    "type": "charge",
    "id": "123456789",
    "external_ref_id": "mkid-000000001-test",
    "status_code": "applied",
    "status_detail": "Aplicado",
    "comments": "Pago con referencia 123456789 procesado correctamente",
    "transaction_id": "0196ed6d-145c-7025-b8d2-35c7b9c69bae",
    "transaction_date": "2025-05-20T11:21:06.417487"
  }
}
{
  "payment_status": "En proceso",
  "amount": 1000,
  "payment_date": "2025-05-20T11:21:06.417487",
  "company": "Company Example",
  "hotel": "Booking payment Hotel ABC",
  "voucher_url": "https://api-dev.autocore.pro/v2/terminal-payments/xxx/vouchers",
  "transaction_id": "7e83a7a2-54c6-4ce0-9a8b-660348805b2a",
  "external_ref_id": "mkid-000000001-test",
  "details": {
    "type": "charge",
    "id": "123456789",
    "external_ref_id": "mkid-000000001-test",
    "status_code": "in_process",
    "status_detail": "En proceso",
    "comments": "Pago con referencia 123456789 en proceso de revisión.",
    "transaction_id": "7e83a7a2-54c6-4ce0-9a8b-660348805b2a",
    "transaction_date": "2025-05-20T11:22:01.884045"
  }
}