Update subscription

Update service subscription and recurring payments. This service allows you to update your subscription data so that it does not lose continuity.

Post a update subscription

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

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

amount

String

Mandatory. Amount to charge to your end user.

card

OBJECT

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

String

Mandatory. Card Verification Value

card.number

number

Mandatory. Card number (PAN)

card.expirationYear

String

Mandatory. Card expiration year. Format YYYY

autoRecurring

OBJECT

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

discount

OBJECT

Apply discount to a subscription

discount.amount*

String

Amount to charge to your end user.

discount.period*

number

= 1<= 12 period during which the new amount will be charged

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.

dateToUpdate

String

Optional field, applies only when the requested update is required to apply to a future date. Format: YYYY-MM-DD

{
    "externalId": "564b161a-76ba-4a84-b5cf-583f2df8c377",
    "internalId": "52425bbd-b68b-4abc-9480-5ae88d53adb3",
    "status": {
        "code": "107",
        "description": "APPROVED",
        "detail": "Update subscription success"
    },
    "errors": []
}

Update a subscription: Example request & response

Note that this request contains optional parameters and objects that can be updated in the subscription.


{
   "dateToUpdate": "2025-01-30",
   "amount": 16000.0,

   "autoRecurring": {
        "repetitions": "3",
        "type": "month",
        "trialDays": "0"
    },

   "retry": {
    "repetitions": 2,
    "intervalUnit": "day",
    "intervalValue": 1
  }
}

Last updated

Was this helpful?