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@example.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@example.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@example.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@example.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"
}
]
}
}
}PayIn
Authorize ecommerce payment
Processes an ecommerce payment using the authorization API. This endpoint supports card, Yape, bank transfer, QR, Cuotéalo, and PagoEfectivo flows.
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@example.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@example.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@example.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@example.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
Token Bearer obtenido desde autenticacion.
Version del API a usar.
Body
application/json
Accion a ejecutar.
Example:
"authorize"
Canal de la transaccion.
Available options:
ecommerce Example:
"ecommerce"
Codigo del comercio.
Example:
"your_merchant_code"
Identificador unico de la operacion en el comercio.
Example:
"2391645"
Metodo de pago y detalle especifico segun el flujo.
- Tarjeta
- Yape
- Transferencia bancaria
- Cuotealo
- PagoEfectivo
- QR
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Transaccion procesada correctamente.

