Create Authorization

Post a credit card authorization order: two steps

POST https://api.stage.localpayment.com /api/payin

Post a Credit Card Authorization payment order

Headers

Name
Type
Description

Authorization*

string

Mandatory. JWT token in format Bearer eyJ0... . For more information about authentication, please refer to Authentication

x-capture*

string

Mandatory. Due to create the authorization. Add value: "true"

Request Body

Name
Type
Description

paymentMethod*

OBJECT

Manatory. Payment method details

paymentMethod.type*

string

Mandatory. CreditCard.

paymentMethod.code*

string

Mandatory. Select among the codes available in each country for a payin BankTransfer payment type. NOTE: payment method code might affect the collection currency in bimonetary countries. For more info, see the side note on currency field.

paymentMethod.flow*

string

Mandatory. The payment method data could be embeded in the API request (DIRECT)or collected via an aditional form or plugin (REDIRECT). Currently, only DIRECT flow is allowed.

externalId*

string

Mandatory. An ID that is meaningful to you and your system. Must be unique.

country*

string

Mandatory. Your end user's country (i.e. country in which the payment will be processed), in ISO format. Please refer to Country Codes for a full list of supported countries.

amount*

number

Mandatory. Amount to charge to your end user.

currency*

string

Mandatory. The currency in which the amount is expressed. It could be A) the local currency of the selected country or B) the account's currency. If A), the amount will be charged to the customer's cash payment method. If B) and it differs from the local currency, the amount specified will be credited to your account and Localpayment will perform a Foreign Exchange operation to collect the amount expressed in local currency. In bimonetary countries, paymentMethod.code resolves possible ambiguity: the payment will be executed in the currency of that specific payment method network. e.i.: SPID (USD); SPEI (MXN)

accountNumber*

string

Mandatory. Your Localpayment account number in which the amount will be credited.

conceptCode

string

Mandatory. Choose the suitable concept code from our Concept Code List. Based on our experience, the most usual are 0039 (remittances) and 0040 (corporate payments).

comment

string

Optional. A comment related to the transaction. It should be something meaningful to your business.

exchangeRateToken

string

Optional. Token provided by the Foreign Exchange service in order to use an upfront agreed exchange rate.

payer*

OBJECT

Mandatory. Party Object. Information related to the payer.

type*

string

Mandatory. Possible values: COMPANY, INDIVIDUAL

name*

string

Mandatory. COMPANY, INDIVIDUAL name (Please enter the name as it is shown on the card).

lastName

string

Mandatory for INDIVIDUAL / Ignored for COMPANY.

document*

OBJECT

Mandatory.Party Object. Valid identity document.

document.type*

string

document.id*

string

Mandatory. Identity document Id. Usually numbers or combination of numbers and letters.

userReference

string

Optional. Username or id in your platform.

email*

string

Mandatory.

phone

OBJECT

Optional. Party Object. Contact phone number

phone.countryCode

string

Optional.

phone.areaCode

string

Optional

phone.number

string

Optional

birthdate

string

Optional. Individual birthdate / company incorporation date. ISO 8601 format (YYYY-MM-DD)

nationality

string

Optional

address

OBJECT

Optional. Party Object. Contact address

address.street

string

Optional

address.number

string

Optional

address.city

string

Optional

address.state

string

Optional

address.country

string

Optional

address.zipCode

string

Optional. Zip code / Postal code

address.comment

string

Optional. Additional info, such as floor or apartment number.

intermediaries

array

Optional. Array of Party objects. It represents others parties in the payment chain because of the end user is not your direct customer. Take into account the array sequence: your client should be the first element, the client of your client should be the second and so on, until there are no more intermediaries.

device

OBJECT

Optional.

device.id

string

Optional. Android / iPhone device ID. Can be blank for other device types such as PC / Mac.

device.ip

string

Optional. Device IP address

device.browser

string

Optional. Browser

metaData

OBJECT

Optional. Unstructured object to record any metadata meaningful to you.

commercialData

OBJECT

Optional. Party Object. Extra information related to the goods or services traded.

lastName

string

Optional only for INDIVIDUAL type / Ignored for COMPANY.

name*

string

Mandatory. INDIVIDUAL/COMPANY name

merchant*

OBJECT

Mandatory. Party Object.

type*

string

Mandatory. Possible values: COMPANY, INDIVIDUAL

document.type

string

Optional. Document type (related to the merchant's residence)

phone.countryCode

string

Optional.

phone

OBJECT

Optional. Party Object. Contact phone number

email

string

Mandatory.

userReference

string

Optional. Username or id in your platform.

document.id

string

Optional. Identity document id. Usually numbers or combination of numbers and letters.

document

OBJECT

Optional. Party Object.

address

OBJECT

Optional. Party Object. Contact address

nationality

string

Optional.

birthdate

string

Optional. Individual birthdate / company incorporation date. ISO 8601 format (YYYY-MM-DD).

phone.number

string

Optional.

phone.areaCode

string

Optional.

address.comment

string

Optional. Additional info, such as floor or apartment number.

address.city

string

Optional.

address.number

string

Optional.

address.street

string

Optional.

address.zipCode

string

Optional. Zip code / Postal code

address.country

string

Optional.

address.state

string

Optional.

card*

OBJECT

Mandatory. Party Object. Payer debit card data.

card.name*

string

Mandatory. Cardholder name, as printed on the front of the debitcard.

card.expirationMonth*

string

Mandatory. Card expiration month. Format MM.

card.cvv*

string

Mandatory. Card Verification Value

card.number*

number

Mandatory. Card number (PAN)

card.expirationYear*

string

Mandatory. Card expiration year. Format YYYY

item.id

string

Optional. Item ID

invoice

string

Optional. Invoice reference

item

array

Optional. List of sold items

items.quantity

number

Optional. Item quantity

items.categoryId

string

Optional. Item category

items.pictureUrl

string

Optional. URL pointing to an item picture

items.description

string

Optional. Item description

item.title

string

Optional. Item title

items.unitPrice

number

Optional. Unit price

shipments.city

string

Optional. City

shipments.number

string

Optional. Number address

shipments.street

string

Optional. Street address

shipments

array

Optional. List of shipping addresses

shipments.country

string

Optional. State/Province

shipments.state

string

Optional. State/ProvinceShipping country

shipments.comment

string

Optional. Additional info

shipments.zipCode

string

Optional. Zip code

lastName

string

Optional only for INDIVIDUAL type / Ignored for COMPANY.

name

string

Optional.INDIVIDUAL/COMPANY name

type

string

Optional.INDIVIDUAL/COMPANY name

beneficiary

OBJECT

Optional. Party Object.

document.id

string

Optional. Identity document id. Usually numbers or combination of numbers and letters.

document.type

string

Optional. Document type (related to the beneficiary's residence)

document

OBJECT

Optional. Party Object.

email

string

Optional.

{
    "transactionType": "PayIn",
    "externalId": "1652992053",
    "internalId": "afe79706-ec82-487f-b452-dc4c331b2742",
    "paymentMethod": {
        "type": "CreditCard",
        "code": "1000",
        "flow": "DIRECT"
    },
    "country": "ARG",
    "currency": "ARS",
    "amount": 1002.0,
    "accountNumber": "032.032.00000001",
    "confirmed": {
        "currency": "ARS",
        "amount": 1002.0,
        "fxQuote": 1.0,
        "exchangeRateToken": null
    },
    "payment": {
        "installment": null,
        "currency": "ARS",
        "fxQuote": 1.0,
        "financingFee": 0.0,
        "amount": 1002.0
    },
    "localTaxes": [],
    "withHoldings": [],
    "fees": {
        "description": "Fee",
        "currency": "ARS",
        "fxSource": 210.39,
        "fxQuote": 1.0,
        "amount": 13.02,
        "account": "032.032.00000001"
    },
    "status": {
        "code": "102",
        "description": "AUTHORIZED",
        "detail": "The payin was authorized"
    },
    "ticket": null,
    "qr": null,
    "beneficiary": null,
    "merchant": {
        "type": "COMPANY",
        "name": "Merchant's name",
        "lastname": "",
        "document": null,
        "email": null,
        "phone": null,
        "address": null,
        "birthdate": null,
        "nationality": null
    },
    "payer": {
        "type": "INDIVIDUAL",
        "name": "Payer's name",
        "lastname": "Payer's last name",
        "document": {
            "id": "37895247",
            "type": "DNI"
        },
        "email": "payer@mail.com",
        "phone": {
            "countryCode": "1",
            "areaCode": "11",
            "number": "98789632"
        },
        "address": null,
        "birthdate": null,
        "nationality": null
    },
    "intermediaries": [],
    "wireInstructions": null,
    "date": {
        "creationDate": "2022-05-19T20:27:33.368+00:00",
        "processedDate": "2022-05-19T20:27:34.2202",
        "expirationDate": "0001-01-01T00:00:00"
    },
    "card": {
        "token": "0/H2bZ6jhfixXXaMR/qvuU2QYrRJWFRXj0LlzTA3lRQ=",
        "bin": "402670",
        "brand": "VISA",
        "country": "RS",
        "name": "Cardholder Name",
        "last4": "3263",
        "expirationYear": 2025,
        "expirationMonth": 9
    },
    "errors": []
}

Examples: Credit Card Authorization payin request

To create an authorization credit card payment order through LP api, the request body examples are detailed below.

To generate an authorization, in "Headers", check the "key": "x-capture" and add the value: "true".

The credit card authorization order should be executed between 1-7 days, since the creation date.

curl --location --request POST 'https://api.stage.localpayment.com/api/payin/' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjUwMjkyMDc4LCJqdGkiOiIxYzFlMTIzNGE5OTU0YmJmYmMwNWQ1M2YwNGNkYzk5YiIsInVzZXJfaWQiOjMwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjpmYWxzZSwicm9sZXMiOlsiQUxMIl0sImNvdW50cmllcyI6WyJBTEwiXSwiY29tcGFueSI6IjAwMDEiLCJjbGllbnRfY29kZSI6IjAwMDEifQ.Cj8aj21J-OwDtYSJueyR-MNSKk20pu5SbiUHvx_eskA' \
--header 'Content-Type: application/json' \
--header 'x-capture: true' \
--data-raw '{
  "paymentMethod": {
    "type": "CreditCard",
    "code": "1000",
    "flow": "DIRECT"
  },
  "externalId": "1650291993",
  "country": "ARG",
  "amount": 1000,
  "currency": "ARS",
  "accountNumber": "032.032.00000001",
  "conceptCode": "0001",
  "comment": "test",
  "merchant": {
    "type": "COMPANY",
    "name": "Merchant'\''s name",
    "lastname": "",
    "document": {
      "type": "",
      "id": ""
    },
    "email": ""
  },
  "payer": {
    "type": "INDIVIDUAL",
    "name": "Payer'\''s name",
    "lastname": "Payer'\''s last name",
    "document": {
      "id": "37895247",
      "type": "DNI"
    },
    "email": "payer@mail.com",
    "phone": {
      "countryCode": "1",
      "areaCode": "11",
      "number": "98789632"
    }
  },
  "card": {
    "number": "4539637489022690",
    "name": "Cardholder Name",
    "cvv": "442",
    "expirationMonth": "05",
    "expirationYear": "2025",
    "installments": 1
  }
}'

Example: Create an Authorization Credit Card payin response

{
    "transactionType": "PayIn",
    "externalId": "1652992053",
    "internalId": "afe79706-ec82-487f-b452-dc4c331b2742",
    "paymentMethod": {
        "type": "CreditCard",
        "code": "1000",
        "flow": "DIRECT"
    },
    "country": "ARG",
    "currency": "ARS",
    "amount": 1002.0,
    "accountNumber": "032.032.00000001",
    "confirmed": {
        "currency": "ARS",
        "amount": 1002.0,
        "fxQuote": 1.0,
        "exchangeRateToken": null
    },
    "payment": {
        "installment": null,
        "currency": "ARS",
        "fxQuote": 1.0,
        "financingFee": 0.0,
        "amount": 1002.0
    },
    "localTaxes": [],
    "withHoldings": [],
    "fees": {
        "description": "Fee",
        "currency": "ARS",
        "fxSource": 210.39,
        "fxQuote": 1.0,
        "amount": 13.02,
        "account": "032.032.00000001"
    },
    "status": {
        "code": "102",
        "description": "AUTHORIZED",
        "detail": "The payin was authorized"
    },
    "ticket": null,
    "qr": null,
    "beneficiary": null,
    "merchant": {
        "type": "COMPANY",
        "name": "Merchant's name",
        "lastname": "",
        "document": null,
        "email": null,
        "phone": null,
        "address": null,
        "birthdate": null,
        "nationality": null
    },
    "payer": {
        "type": "INDIVIDUAL",
        "name": "Payer's name",
        "lastname": "Payer's last name",
        "document": {
            "id": "37895247",
            "type": "DNI"
        },
        "email": "payer@mail.com",
        "phone": {
            "countryCode": "1",
            "areaCode": "11",
            "number": "98789632"
        },
        "address": null,
        "birthdate": null,
        "nationality": null
    },
    "intermediaries": [],
    "wireInstructions": null,
    "date": {
        "creationDate": "2022-05-19T20:27:33.368+00:00",
        "processedDate": "2022-05-19T20:27:34.2202",
        "expirationDate": "0001-01-01T00:00:00"
    },
    "card": {
        "token": "0/H2bZ6jhfixXXaMR/qvuU2QYrRJWFRXj0LlzTA3lRQ=",
        "bin": "402670",
        "brand": "VISA",
        "country": "RS",
        "name": "Cardholder Name",
        "last4": "3263",
        "expirationYear": 2025,
        "expirationMonth": 9
    },
    "errors": []
}

REMEMBER:

To generate an authorization, in "Headers", check the "key": "x-capture" and add the value: "true".

Check the Payin Status Codes

Payin

Last updated