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.expirationMonth*

String

Mandatory. Card expiration month. Format MM.

card.ccvv*

Mandatory. Card Verification Value

card.number*

String

Mandatory. Card number (BAN)

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.

autoRecurring.type*

String

Defines the recurring interval unit. Valid values: day, month.

{
    "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"
            }
        }
    ]
}

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"
},
"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"
}
}'

Last updated