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
Request Body
{
"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"
},
"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
},
"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
},
"autoRecurring": {
"repetitions": 1,
"type": "day"
}
}'
Repetitions one per month:
"autoRecurring": {
"repetitions": 1,
"type": "month"
}
Repetitions three per day:
"autoRecurring": {
"repetitions": 3,
"type": "day"
}
{
"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": [],
"errors": []
}
Last updated