Create subscription plan

This service allows you to create subscription plans and then associate the plan ID with the creation of the subscriptions required by the customer.

Post a new subscription plan

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

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

name*

String

Mandatory. Plan name

description

String

Optional. Plan description

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*

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.

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

{
    "internalId": "38a16a07-6616-4a90-82b9-0d7c8e2a2b76",
    "name": "Plan Básico Mensual",
    "description": "Acceso básico a contenido exclusivo",
    "amount": 100.0,
    "country": "ARG",
    "currency": "ARS",
    "accountNumber": "032.032.00000023",
    "autoRecurring": {
    "repetitions": 1,
    "type": "month"
 },
    "status": {
        "code": "100",
        "description": "ACTIVE",
        "detail": "Subscription plan is active"
    },
}

Creating a subscription plan: 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.

{
"name": "Plan Básico Mensual",
"description": "Acceso básico a contenido exclusivo",
"country": "ARG",
"amount": 100.0,
"currency": "ARS",
"accountNumber": "032.032.00000023",
"autoRecurring": {
    "repetitions": 1,
    "type": "month"
 }
}

Last updated

Was this helpful?