Skip to main content
POST
/
charges
curl --request POST \
  --url https://api.preprod.alignet.io/charges \
  --header 'ALG-API-VERSION: <alg-api-version>' \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": "authorize",
  "channel": "ecommerce",
  "merchant_code": "your_merchant_code",
  "merchant_operation_number": "2391645",
  "payment_method": {
    "method_name": "CARD",
    "method_details": {
      "pan": "4051420006041115",
      "expiry_date": "1231",
      "security_code": "123",
      "card_holder": {
        "first_name": "Pedro",
        "last_name": "Miranda",
        "email": "pedro@pay-me.com",
        "phone": {
          "prefix": "51",
          "number": "999835685"
        }
      },
      "installments": {
        "plan": "01",
        "number": "3"
      }
    }
  },
  "payment_details": {
    "amount": "15000",
    "currency": "604",
    "billing": {
      "first_name": "Pedro",
      "last_name": "Miranda",
      "email": "pedro@pay-me.com",
      "phone": {
        "country_code": "+51",
        "subscriber": "999835685"
      },
      "location": {
        "line_1": "Av. Casimiro Ulloa 333",
        "line_2": "Miraflores",
        "city": "Lima",
        "state": "Lima",
        "country": "Peru"
      }
    },
    "shipping": {
      "first_name": "Pedro",
      "last_name": "Miranda",
      "email": "pedro@pay-me.com",
      "phone": {
        "country_code": "+51",
        "subscriber": "999835685"
      },
      "location": {
        "line_1": "Av. Casimiro Ulloa 333",
        "line_2": "Miraflores",
        "city": "Lima",
        "state": "Lima",
        "country": "Peru"
      }
    },
    "customer": {
      "first_name": "Pedro",
      "last_name": "Miranda",
      "email": "pedro@pay-me.com",
      "phone": {
        "country_code": "+51",
        "subscriber": "999835685"
      },
      "location": {
        "line_1": "Av. Casimiro Ulloa 333",
        "line_2": "Miraflores",
        "city": "Lima",
        "state": "Lima",
        "country": "Peru"
      }
    },
    "product_details": []
  }
}
'
{
  "success": "true",
  "action": "authorize",
  "merchant_code": "your_merchant_code",
  "merchant_operation_number": "2391645",
  "transaction": {
    "transaction_id": "5hk8rwa3h3cq9oyfs3a28v1ms",
    "channel": "ecommerce",
    "state": "AUTORIZADO",
    "state_reason": "Approval and completed successfully",
    "amount": "15000",
    "currency": "604",
    "payment_method": {
      "method_name": "CARD",
      "method_details": {
        "masked_pan": "411111********1111",
        "brand": "VISA",
        "bin": "411111",
        "last_pan": "9268",
        "card_type": "DEBIT",
        "card_country": "PE",
        "issuer": "BANCO DE CREDITO DEL PERU - BCP",
        "installments": {
          "plan": "NORMAL",
          "installment_number": "2"
        }
      }
    },
    "processor_response": {
      "authorization_code": "055552",
      "brand_transaction_id": "100B",
      "result_message": {
        "code": "00",
        "description": "Approval and completed successfully"
      }
    },
    "additional_fields": null,
    "lifecycle": [
      {
        "state": "REGISTRADO",
        "date": {
          "utc_time": "2024-03-12T22:49:36.018Z",
          "unix_time": 1710282940
        }
      },
      {
        "state": "PENDIENTE",
        "date": {
          "utc_time": "2024-03-12T22:49:36.018Z",
          "unix_time": 1710282940
        }
      },
      {
        "state": "AUTORIZADO",
        "date": {
          "utc_time": "2024-03-12T22:49:36.018Z",
          "unix_time": 1710282940
        }
      }
    ]
  },
  "meta": {
    "status": {
      "code": "00",
      "message_ilgn": [
        {
          "locale": "es_PE",
          "value": "Procesado correctamente"
        }
      ]
    }
  }
}

Headers

Authorization
string
default:Bearer {{access_token}}
required

Token Bearer obtenido desde autenticacion.

ALG-API-VERSION
string
default:1709847567
required

Version del API a usar.

Body

application/json
action
string
required

Accion a ejecutar.

Example:

"authorize"

channel
enum<string>
required

Canal de la transaccion.

Available options:
ecommerce
Example:

"ecommerce"

merchant_code
string
required

Codigo del comercio.

Example:

"your_merchant_code"

merchant_operation_number
string
required

Identificador unico de la operacion en el comercio.

Example:

"2391645"

payment_method
Tarjeta · object
required

Metodo de pago y detalle especifico segun el flujo.

payment_details
object
required

Response

Transaccion procesada correctamente.

success
string
required
Example:

"true"

action
string
required
Example:

"authorize"

merchant_code
string
required
Example:

"your_merchant_code"

merchant_operation_number
string
required
Example:

"2391645"

transaction
object
required
meta
object