The function of this service is to allow an Authorization, both with Token and by sending the Card data.

Environment

EndPoint

Method

Development

https://api.dev.alignet.io/charges

POST

Production

https://api.alignet.io/charges

POST

Headers

Header

Value

Required

Content-Type

application/json

Yes

ALG-API-VERSION

API version to be used. Available values: 1618440906

Yes 

Authorization

Bearer <Access_Token>

Yes

"Content-Type":"application/json",
"ALG-API-VERSION":"1618440906",
"Authorization":"Bearer yJhbGciOiJSUzI1NsInR5cCI6IkpXVCIsImt………",
JSON

Request

Parameter

Type

Long.

Description

Req.

action

String

(AN)

-

The intent of the merchant. In this case it is "authorize".

Yes

channel

String

(N)

3

The channel from which the request originates. In this case:

1 = eCommerce (“Card” or “Token + CVV”)

3 = Card on File (only “Token”)

Yes

payment_method.token.id

String

(AN)

25

The identifier of the token to be used.

It is not required if "Card" object is sent.

Yes

payment_method.token.security_code

String

(AN)

4

Security code of the card associated to the Token.

It is only required if Channel is 1.

-

payment_method.card.pan

String

(N)

20

Card number.

It is not required if "Token" object is sent.

-

payment_method.card.expiry_date

String

(N)

4

Card expiration date, in MMYY format.

It is not required if "Token" object is sent.

-

payment_method.card.security_code

String

(N)

4

Card security code. In case Channel is 3 send 000.

It is not required if "Token" object is sent..

-

transaction.currency

String

(AN)

3

Numeric currency code in ISO 4217 format

Yes

transaction.amount

String

(N)

15

Amount of the transaction in cents of currency, taking into account that we consider the last 5 positions as the decimal part of the amount.

Yes

transaction.meta.internal_operation_number

String

(N)

9

The customer's internal transaction number. This can be the order number or another number that the customer considers important.

Yes

transaction.meta.description

String

(AN)

50

Description of the transaction.

No

transaction.meta.additional_fields

String

(AN)

-

In this object are inserted fields that the customer believes to be important. These fields are determined and configured by the customer.

No

transaction.meta.additional_fields.plan

String

(N)

5

Value corresponding to the plan.

No

transaction.meta.additional_fields.cuota

String

(N)

5

Value corresponding to the installment.

No

address.shipping.id

String

(AN)

50

The id of a previously returned address object. A new address id is generated each time a new address is generated.

No

address.shipping.first_name

String

(AN)

50

Shipping’s First Name.

No

address.shipping.last_name

String

(AN)

50

Shipping’s Last Name.

No

address.shipping.email

String

(AN)

60

Shipping’s First Email.

No

address.shipping.phone.country_code

String

(AN)

5

Shipping’s Phone Country Code.

No

address.shipping.phone.subscriber

String

(AN)

20

Shipping’s Phone Number.

No

address.shipping.location.line_1

String

(AN)

50

Shipping’s Address Line 1.

No

address.shipping.location.line_2

String

(AN)

50

Shipping’s Address Line 1.

No

address.shipping.location.city

String

(AN)

30

Shipping’s City.

No

address.shipping.location.state

String

(AN)

30

Shipping’s Sate.

No

address.shipping.location.country

String (AN)

2

Shipping’s ISO Country Code.

No

address.shipping.location.zip_code

String

(AN)

10

Shipping’s Zip Code.

No

address.billing.id

String

(AN)

50

The id of a previously returned address object. A new address id is generated each time a new address is generated.

No

address.billing.first_name

String

(AN)

50

Billing’s First Name.

Yes

address.billing.last_name

String

(AN)

50

Billing’s Last Name.

Yes

address.billing.email

String

(AN)

60

Billing’s Email.

Yes

address.billing.phone.country_code

String

(AN)

5

Billing’s Phone Country.

Yes

address.billing.phone.subscriber

String

(AN)

20

Billing’s Phone.

Yes

address.billing.location.line_1

String

(AN)

50

Billing’s Address Line 1.

Yes

address.billing.location.line_2

String

(AN)

50

Billing’s Address Line 2.

Yes

address.billing.location.city

String

(AN)

30

Billing’s City.

Yes

address.billing.location.state

String

(AN)

30

Billing’s State.

Yes

address.billing.location.country

String (AN)

2

Billing’s ISO Country Code.

Yes

address.billing.location.zip_code

String

(AN)

10

Billing’s Zip Code.

Yes

card_holder.first_name

String

(AN)

50

Cardholder's name.

Yes

card_holder.last_name

String

(AN)

50

Cardholder's last name.

Yes

card_holder.email_address

String

(AN)

60

Cardholder's Email.

Yes

card_holder.identity_document_country

String

(AN)

50

Cardholder's ID Country.

Yes

card_holder.identity_document_type

String

(AN)

30

Cardholder's ID Type.

Yes

card_holder.identity_document_identifier

String

(AN)

20

Cardholder's ID Number.

Yes

1️⃣ Ejemplo: Authorization with Channel 3, sending only Token (Card on File)

{
    "action": "authorize",
    "channel": "3",
    "payment_method": {
        "token": [ { "id": "822a-748e-3z9h-0051" } ]
    },
    "transaction": {
        "currency": "604",
        "amount": "1000000",
        "meta": {
            "internal_operation_number": "123456",
            "description": "Descripcion de la transaccion",
            "additional_fields": {
                "reserved1": "Ejemplo valor reservado 1",
                "2": "Ejemplo valor reservado 2",
                "plan": "00",
                "cuota": "005"
            }
        }
    },
    "address": {
        "billing": {
            "first_name": "Juan Diego",
            "last_name": "Perez Sanchez",
            "email": "juan.perez@gmail.com",
            "phone": { "country_code": "51", "subscriber": "987654321" },
            "location": {
                "line_1": "Mi casa",
                "line_2": "Mi casa",
                "city": "LIMA",
                "state": "LIMA",
                "country": "PE",
                "zip_code": "18"
            }
        }
    },
    "card_holder": [
        {
            "first_name": "Juan Diego",
            "last_name": "Perez Sanchez",
            "email_address": "juan.perez@email.com",
            "identity_document_country": "PER",
            "identity_document_type": "DNI",
            "identity_document_identifier": "87654321"
        }
    ]
}
JSON

2️⃣ Ejemplo: Authorization with Channel 1, sending Token + CVV (eCommerce)

{
   "action":"authorize",
   "channel":"1",
   "payment_method":{
      "token":[
         {
            "id":"822a-748e-3z9h-0051",
            "security_code":"123"
         }
      ]
   },
   "transaction":{
      "currency":"604",
      "amount":"1000000",
      "meta":{
         "internal_operation_number":"123456",
         "description":"Descripcion de la transaccion"
      }
   },
   "address":{
      "billing":{
         "first_name":"Juan Diego",
         "last_name":"Perez Sanchez",
         "email":"juan.perez@gmail.com",
         "phone":{ "country_code":"51", "subscriber":"987654321" },
         "location":{
            "line_1":"Mi casa",
            "line_2":"Mi casa",
            "city":"LIMA",
            "state":"LIMA",
            "country":"PE",
            "zip_code":"18"
         }
      }
   },
   "card_holder":[
      {
         "first_name":"Juan Diego",
         "last_name":"Perez Sanchez",
         "email_address":"juan.perez@email.com",
         "identity_document_country":"PER",
         "identity_document_type":"DNI",
         "identity_document_identifier":"87654321"
      }
   ]
}
JSON

3️⃣ Ejemplo: Authorization with Channel 1, by sending Card details (eCommerce)

{ 
   "action":"authorize",
   "channel":"1",
   "payment_method":{ 
      "card":[ { 
            "pan":"4859510000000051",
            "expiry_date":"1220",
            "security_code":"365"
         } ]
   },
   "transaction":{ 
      "currency":"604",
      "amount":"1000000",
      "meta":{ 
         "internal_operation_number":"123456",
         "description":"Descripcion de la transaccion",
         "additional_fields":{ 
            "reserved1":"Ejemplo valor reservado 1",
            "2":"Ejemplo valor reservado 2",
            "plan":"00",
            "cuota":"005"
         }
      }
   },
   "address":{ 
      "billing":{ 
         "first_name":"Juan Diego",
         "last_name":"Perez Sanchez",
         "email":"juan.perez@gmail.com",
         "phone":{ "country_code":"51", "subscriber":"987654321" },
         "location":{ 
            "line_1":"Mi casa",
            "line_2":"Mi casa",
            "city":"LIMA",
            "state":"LIMA",
            "country":"PE",
            "zip_code":"18"
         }
      }
   },
   "card_holder":[ 
      { 
         "first_name":"Juan Diego",
         "last_name":"Perez Sanchez",
         "email_address":"juan.perez@email.com",
         "identity_document_country":"PER",
         "identity_document_type":"DNI",
         "identity_document_identifier":"87654321"
      }
JSON

Response

Parameter

Description

action

Process performed, in this case it is " authorize".

id

Transaction identifier assigned by Pay-me.

success

True in case the request is successful or False otherwise.

transaction.currency

Numeric currency code in ISO 4217 format.

transaction.amount

Amount of the transaction in cents of currency, taking into account that we consider the last 5 positions as the decimal part of the amount.

transaction.meta.internal_operation_number

The customer's internal transaction number. This can be the order number or another number that the customer considers important.

transaction.meta.description

Description of the transaction.

transaction.meta.processor.authorization.code

Processor authorization code

transaction.meta.additional_fields

This object returns the fields defined by the customer. These fields are determined and configured by the customer.

transaction.meta.status.code

Code associated with the operation status

transaction.meta.status.message_ilgn.locale

Locale on which the message is written.

transaction.meta.status.message_ilgn.value

Value of the textual message

validations

This object returns the results of the validations performed.

{
    "action": "authorize",
    "id": "500114",
    "success": "true",
    "transaction": {
        "currency": "604",
        "amount": "1000000",
        "meta": {
            "internal_operation_number": "500114",
            "description": "Descripcion de la transaccion",
            "processor": {
                "authorization": {
                    "code": "191046"
                }
            },
            "additional_fields": {
                "2": "Ejemplo valor reservado 2",
                "reserved1": "Ejemplo valor reservado 1"
            },
            "status": {
                "code": "00",
                "message_ilgn": [
                    {
                        "locale": "es_PE",
                        "value": "Operacion Autorizada"
                    }
                ]
            }
        }
    },
    "validations": null,
    "token": null
}
JSON

Continue to Reverse Transaction ➡️