Documentation V3
  • Localpayment documentation V3
  • INTRODUCTION TO OUR SOLUTION
    • Intro to our Documentation
    • Intro to Payment Methods in Emerging Markets
    • Merchant Dashboard
      • Dashboard Navigation
      • Login
      • User Roles
      • Roles
      • Users
      • Whitelist your IPs
      • Whitelist your BINs
      • Setup your Webhooks
      • Reports
        • Balance
        • Projected Balance
        • Activity
        • Transaction Detail
        • FIDES Report
      • Virtual accounts
      • Refunds
        • Refund Bank Transfer
        • Refund Card Capture
        • Refund Cash
      • Chargeback
      • Internal Domestic Transfer
      • Internal Foreign Transfer
      • Currency Exchange
        • Create
      • Wire In
      • Wire Out
    • Intro to FX operations
    • Business definitions
      • Payins
      • Payouts
    • Onboarding & Integration
    • Postman Collection
  • ENVIRONMENTS
    • Environments
  • BEFORE A PAYMENT
    • Access Token
    • Validations
      • Document Validation
      • Bank Account Validation
      • Validate BIN
    • Holidays
    • Search Payment Method
    • Search Bank Codes
    • Cash Agents Geolocalization
    • Installments Plan Quote
    • Currency Exchange Quote
    • Billing Service
      • Create
        • Mexico
      • Check Billing status
      • Download Billing
  • REQUEST A PAYMENT
    • Payins
      • Bank Transfer
        • Direct debit
          • DEBIN (Argentina)
          • Transfiya (Colombia)
          • Wallet Fri (Guatemala)
        • Virtual Account
          • Mexico
            • Request Individual
            • Request Batch
            • Check Virtual account
            • Delete Virtual account
            • Enable or Disable Virtual Account
          • Brazil
            • Request Individual
            • Check Virtual account
            • Alias ​​configuration
          • Argentina
            • Request Individual
            • Request Batch
            • Check virtual account
            • Delete Virtual account
          • Refund Virtual Account
        • Online Reference Code Payments
          • Mexico
        • Refund Bank Transfer
        • Cancel
        • APMs
          • CODI (Mexico)
          • ETPAY (Chile)
          • Fintoc (Chile)
          • Boleto (Brazil)
          • PIX (Brazil)
            • Refund Pix
          • PSE (Colombia)
          • QR (Bolivia)
          • QR (Guatemala)
          • QR (Argentina)
          • QR (Perú)
      • Cash
        • Cash
          • APMs
            • Boleto (Brazil)
        • Cancel
        • Refund Cash
      • Debit Card
        • Capture
        • Refund Capture
      • Credit Card
        • Capture
        • Create Authorization
        • Capture Authorization
        • Cancel Authorization
        • Refund Capture
        • Installments
        • Save Cards
          • Save Card
          • Get Card
          • Delete Card
        • 3D-Secure
        • Validate card
        • Chargebacks
          • Notification
          • Send documentation
          • Close Chargeback
    • Payin Subscriptions
      • Create a subscription
      • Update subscription
      • Cancel
    • Payin Subscriptions Plan
      • Create subscription plan
      • Update subscription plan
      • Get subscription plan
    • Payouts
      • Search available banks
      • Create
        • Argentina
        • Bolivia
        • Brazil
        • Chile
        • Colombia
          • Colombia ACH
          • Colombia Transfiya
        • Costa Rica
        • Dominic Republic
        • Guatemala
        • Honduras
        • Mexico
        • Panama
        • Peru
        • Kenya
      • Manual Upload
        • Create Batch Upload
        • Batch Pending Authorization
        • Cancel Batch Pending Authorization
        • Batch Activity
      • Proof of Payment (POP)
      • Cancel
      • Commit payout
      • Attach documents
      • Ripplenet getway
    • Payouts Double Signature
      • Authorize
    • Checkout
      • Webcheckout
        • Credit Card
        • Debit Card
        • Cash
        • Bank Transfer
      • Link Payment
      • Frequent Items
      • Iframe
      • Smart Checkout/ iframe
      • Virtual Pos
      • Plugins
        • Magento
        • Shopify
        • Google Pay
        • WooCommerce
  • AFTER A PAYMENT
    • Check Status
    • Check Payment
    • Check Payment list
    • Check Subscription
    • Account Balance
      • Balance Reconciliation
      • Current Balance Amount
    • Withholding Certificates
    • Proof of Payment
    • RFI - Documentation
  • SETTLEMENT & EXCHANGE
    • Wire In
    • Wire Out
    • Currency Exchange Bulk
      • Quote
      • Bulk
      • Currency exchange - Front end
    • Internal Transfers
      • Internal Domestic Transfer
      • Internal Foreign Transfer
  • NOTIFICATIONS
    • Callbacks - Webhooks
      • Configurations
      • Payins
        • Payin Bank Transfer
        • PSE Colombia
        • Payin Virtual Account
        • Payin Cash
        • Payin Credit Card
        • Payin Debit Card
      • Payouts
    • SFTP- Email Reports
  • API REFERENCE GUIDE
    • Validation Error Codes
    • Transaction Type & Status
      • Payin
      • Subscriptions
      • Payout
      • Chargeback
      • Credit
      • Currency Exchange
      • Debit
      • Expenses
      • Internal Transfer
      • Recall
      • Refund
      • Return
      • Recurring Fee
      • Wire in
      • Wire out
    • Payout Methods + SLA
      • Latam
    • Payin Methods + SLA
      • Argentina
      • Bolivia
      • Brazil
      • Chile
      • Colombia
      • Dominican Republic
      • Guatemala
      • Mexico
      • Panama
      • Peru
    • Currency Codes
      • Latam
    • Country Codes
      • Latam
    • Bank codes
      • Latam
        • Argentina
        • Bolivia
        • Brazil
        • Chile
        • Colombia
        • Costa Rica
        • Dominican Republic
        • Guatemala
        • Honduras
        • Mexico
        • Panamá
        • Peru
    • Bank account validations
      • Latam
        • Argentina
        • Bolivia
        • Brazil
        • Chile
        • Colombia
        • Costa Rica
        • Dominican Republic
        • Guatemala
        • Mexico
        • Panama
        • Peru
    • Document Validations
      • Argentina
      • Bolivia
      • Brazil
      • Chile
      • Colombia
      • Costa Rica
      • Dominican Republic
      • El Salvador
      • Guatemala
      • Honduras
      • Mexico
      • Panama
      • Peru
    • Concept Codes
  • FLOWS AND CHARACTERISTICS
    • Account Currencies
    • Involved Parties
    • Payin Status Flow
      • Payins
        • Payin Status Flow - Card
        • Payin Status Flow - Bank
        • Payin Status Flow -Cash
      • Refund - Card
      • Refund - Cash & Bank
      • Chargeback
    • Payout Status Flow
      • Payout - Bank
      • Return
      • Recall
    • Payin Subscription Flow
      • Payins Subscription Status Flow - Card
    • Virtual Account Status Flow
    • Settlement Status Flow
      • Wire In
      • Wire Out
    • Payin Methods Flow
      • Argentina
      • Bolivia
      • Brazil
      • Chile
      • Colombia
      • Dominican Republic
      • Guatemala
      • Honduras
      • Mexico
      • Panama
      • Peru
  • HOLIDAYS
    • 2021
    • 2022
    • 2023
    • 2024
    • 2025
  • COMPLIANCE
    • Values
    • Prohibited Countries
    • Prohibited Business
    • Compliance Program Docs
    • Licenses
    • Terms & Conditions
  • GLOSSARY
    • Payments Explained
    • FAQ
  • PLUGINS
    • Magento
    • Shopify
    • Google Pay
    • WooCommerce
    • Ripplenet
Powered by GitBook
On this page
  • Post a new subscription
  • Creating a subscription: Example request & response

Was this helpful?

  1. REQUEST A PAYMENT
  2. Payin Subscriptions

Create a subscription

Recurring payment collection service. This service allows you to collect payments every 30 days, from the date the payments were posted and repeated as many times as specified.

Post a new subscription

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

Headers

Name
Type
Description

Authorization*

String

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

Request Body

Name
Type
Description

paymentMethod*

OBJECT

Manatory.Payment method type. Possible values: DebitCard, CreditCard

paymentMethod.type*

String

Payment method type. Possible values: DebitCard, CreditCard.

paymentMethod.code*

String

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. It must be unique and alphanumeric, no characters allowed.

country*

String

amount*

String

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

comment

String

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

exchangeRateToken

String

payer*

OBJECT

Mandatory. Party Object. Information related to the payer.

payer.type*

String

Mandatory. Possible values: COMPANY, INDIVIDUAL

name*

String

Mandatory. Individual first name / company name

lastName

String

Mandatory for individuals / Ignored for companies.

document*

OBJECT

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

Optional. Individual first name / company name

merchant

OBJECT

Optional. Party Object.

merchant.type

String

Optional. Possible values: COMPANY, INDIVIDUAL

document.type

String

phone.countryCode

String

Optional.

phone

OBJECT

Optional. Party Object. Contact phone number

email

String

Optional.

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

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 deb card data.

card.name*

String

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

card.number*

number

Mandatory. Card number (PAN)

card.cvv*

String

Mandatory. Card Verification Value

card.expirationMonth*

String

Mandatory. Card expiration month. Format MM.

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

beneficiary

OBJECT

Optional

type*

String

Specifies the subscription category. Valid values: SOFTWARE, STREAMING, CONTENT, PRODUCTS, MEMBERSHIP.

autoRecurring*

OBJECT

Mandatory. Subscription properties

autoRecurring.repetitions*

number

How many times this payment will be collected. *For recurrence on demand send the parameter with value=0

autoRecurring.type*

String

Defines the recurring interval unit. Valid values: day, month. *For recurrence on demand send the parameter with value=custom

autoRecurring.trialDays

number

Number of trial days of the subscription

autoRecurring.dateToStart

date

Optional. Subscription billing start date. If no start date is sent, the current system date and time will be used as the start date for the subscription. Format: yyyy-MM-dd'T'HH:mm:ss

autoRecurring.dateToEnd

date

Optional. Subscription end date. If no end date is sent, the subscription will be charged indefinitely until the customer decides to cancel it. Format: yyyy-MM-dd'T'HH:mm:ss

retry

OBJECT

Optional. Party Object. Payin retry

retry.repetitions

number

Number of times the charge will be retried

retry.intervalUnit

String

The time unit in which retries will be executed. Allowed values: "day" and "hour"

retry.intervalValue

number

Interval at which retries will be performed. Defines the number of time units between retries.

discount

OBJECT

Optional. Apply discount to a subscription

discount.amount

String

Amount to charge to your end user

discount.period

number

Period or number of payments to which the new amount will be charged. Allowed values: >= 1<= 12 (if the subscription is in MONTH) >= 1<= 12 (if the subscription is in DAY)

planId

String

Optional. Subscription plan ID, this ID is used when it is required to associate the subscription with a plan.

{
    "subscriptionId": "133640f9-ac06-49fc-aa82-08bfe52ceb5e",
    "status": {
        "code": "105",
        "description": "INPROGRESS",
        "detail": "The subscription is in progress"
    },
    "creationDate": "2022-05-31T15:05:47.665+00:00",
    "nextPaymentDate": "2022-06-30T15:05:47.665+00:00",
    "payments": [
        {
            "externalId": "bb7d32e5-04da-4b8a-856f-8caf89d986ea",
            "internalId": "9977c353-ce00-48fd-b3ac-f685bce30895",
            "status": {
                "code": "103",
                "description": "APPROVED",
                "detail": "The payin was confirmed but not credited yet"
            }
        }
    ]
}
{
    "status": {
        "code": "501",
        "description": "REJECTED",
        "detail": "Country not found"
    },
    "errors": [
        {
            "code": "501",
            "detail": "Country not found"
        },
        {
            "code": "817",
            "detail": "Invalid concept code"
        }
    ]
}

Creating a subscription: Example request & response

Note that this request is very similar to PayIn request. Using this service is equivalent to executing an scheduled PayIn request every 30 days. The main difference between payloads is the autoRecurring party object describe in the "body" section below.

{
"paymentMethod": {
"type": "CreditCard",
"code": "1000",
"flow": "DIRECT"
},
"planId": "5bf80997-4c60-46fc-a057-408ddbc5d060",
"externalId": "1662647310",
"country": "ARG",
"amount": 100.0,
"currency": "ARS",
"accountNumber": "032.032.00000015",
"conceptCode": "0001",
"comment": "subs test 1 del 7/9 xdia",
"merchant": {
"type": "INDIVIDUAL",
"name": "Obi Wan",
"lastname": "Kenobi",
"document": {
"type": "DNI",
"id": "12345678"
},
"userReference": "abc123",
"email": "obiwankenobi@starwars.com",
"phone": {
"countryCode": "54",
"areaCode": "11",
"number": "98789632"
},
"birthdate": "2000-01-01",
"nationality": "Argentinian",
"address": {
"street": "Charruas",
"number": "938",
"city": "Hurlingham",
"state": "state",
"country": "Argentina",
"zipCode": "1688",
"comment": "portero 801"
}
},
"payer": {
"type": "INDIVIDUAL",
"name": "Luke",
"lastname": "Skywalker",
"document": {
"id": "37993830",
"type": "DNI"
},
"email": "nic-midd@localpayment.com",
"phone": {
"countryCode": "1",
"areaCode": "11",
"number": "98789632"
},
"birthdate": "01/01/1990",
"nationality": "American",
"address": {
"street": "Siempre viva",
"number": "1234",
"city": "Springfield",
"state": "Ohio",
"country": "USA",
"zipCode": "1686",
"comment": "May the force be with you, always!"
}
},
"card": {
"name": "APRO",
"number": "4509953566233704",
"cvv": "123",
"expirationMonth": "11",
"expirationYear": "2025",
"installments": 1
},
"type": "SOFTWARE",
"autoRecurring": {
"repetitions": 1,
"type": "day"
}
}'
curl --location --request POST 'https://api.stage.localpayment.com/api/payin/subscriptions/' 
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjYyNTU4NDcxLCJqdGkiOiI5MjQ3NTlhNzU1YmM0NjNlYjk5YjUwYzQzZTMwMDNjYSIsInVzZXJfaWQiOjMwLCJzdXBlcnVzZXIiOnRydWUsImlzX3N0YWZmIjpmYWxzZSwicm9sZXMiOlsiQUxMIl0sImNvdW50cmllcyI6WyJBTEwiXSwiY29tcGFueSI6IjAwMDEiLCJjbGllbnRfY29kZSI6IjAwMDEifQ.8q-yJPdJggkhcusYdo7uo17VtIVFCedDRp1mVXLczBE' 
--header 'Content-Type: application/json' 
--data-raw '{
"paymentMethod": {
"type": "CreditCard",
"code": "1000",
"flow": "DIRECT"
},
"externalId": "1662647310",
"country": "ARG",
"amount": 100.0,
"currency": "ARS",
"accountNumber": "032.032.00000015",
"conceptCode": "0001",
"comment": "subs test 1 del 7/9 xdia",
"merchant": {
"type": "INDIVIDUAL",
"name": "Obi Wan",
"lastname": "Kenobi",
"document": {
"type": "DNI",
"id": "12345678"
},
"userReference": "abc123",
"email": "obiwankenobi@starwars.com",
"phone": {
"countryCode": "54",
"areaCode": "11",
"number": "98789632"
},
"birthdate": "2000-01-01",
"nationality": "Argentinian",
"address": {
"street": "Charruas",
"number": "938",
"city": "Hurlingham",
"state": "state",
"country": "Argentina",
"zipCode": "1688",
"comment": "portero 801"
}
},
"payer": {
"type": "INDIVIDUAL",
"name": "Luke",
"lastname": "Skywalker",
"document": {
"id": "37993830",
"type": "DNI"
},
"email": "nic-midd@localpayment.com",
"phone": {
"countryCode": "1",
"areaCode": "11",
"number": "98789632"
},
"birthdate": "01/01/1990",
"nationality": "American",
"address": {
"street": "Siempre viva",
"number": "1234",
"city": "Springfield",
"state": "Ohio",
"country": "USA",
"zipCode": "1686",
"comment": "May the force be with you, always!"
}
},
"card": {
"name": "APRO",
"number": "4509953566233704",
"cvv": "123",
"expirationMonth": "11",
"expirationYear": "2025",
"installments": 1
},
"type": "SOFTWARE",
"autoRecurring": {
"repetitions": 1,
"type": "day"
}
}'
   
Repetitions one per month:
"autoRecurring": { 
    "repetitions": 1, 
    "type": "month"
 }
 
Repetitions three per day:
"autoRecurring": { 
   "repetitions": 3, 
    "type": "day"
 }
{
    "type": "INDIVIDUAL",
    "externalId": "1662558201",
    "internalId": "38a16a07-6616-4a90-82b9-0d7c8e2a2b76",
    "country": "ARG",
    "currency": "ARS",
    "accountNumber": "032.032.00000015",
    "status": {
        "code": "105",
        "description": "INPROGRESS",
        "detail": "The subscription is in progress"
    },
    "date": {
        "creationDate": "2022-09-07T13:43:52.932",
        "nextPaymentDate": "2022-09-07T14:43:52.76"
    }
    "payments": [
        {
            "externalId": "a9e66093-5fa0-40b4-b88d-11babee0a742",
            "internalId": "349a2953-6240-48a4-9dd3-7990aa70e3f4",
            "status": {
                "code": "103",
                "description": "APPROVED",
                "detail": "The payin was confirmed but not credited yet"
            },
            "redirectUrl": ""
        }
    ],
    "errors": []
}

PreviousPayin SubscriptionsNextUpdate subscription

Last updated 1 month ago

Was this helpful?

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

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

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

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

Mandatory.Party Object.

Mandatory. Document types.

Optional. Document types.

Optional. Party Object.

Country Codes
Concept Code List
Foreign Exchange service
Valid identity document.
Check the regonized document type list per country
Check the regonized document type list per country
Valid identity document.
payin BankTransfer payment type