> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Aggiornare un abbonamento

Questo servizio ti permette di aggiornare i dettagli del tuo abbonamento, garantendo la continuità senza interruzioni dei tuoi pagamenti ricorrenti.


## OpenAPI

````yaml openapi/it/localpayment.json POST /api/payin/subscriptions/{externalId}
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/payin/subscriptions/{externalId}:
    post:
      summary: Aggiornare un abbonamento
      operationId: update-subscription
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token di accesso Bearer per l'autenticazione. Questo token si
            ottiene dagli endpoint [Ottenere il token di
            accesso](/it/reference/get-token) o [Rinnovare il token di
            accesso](/it/reference/refresh-token).
          required: true
          schema:
            type: string
        - name: externalId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  description: Importo della transazione.
                card:
                  type: object
                  description: Dati della carta del pagatore.
                  properties:
                    name:
                      type: string
                      description: ' Nome del titolare della carta, come stampato sul fronte della carta di debito.'
                    number:
                      type: string
                      description: Numero della carta (PAN).
                    cvv:
                      type: string
                      description: Codice di verifica della carta
                    expirationMonth:
                      type: string
                      description: Mese di scadenza della carta. Formato `MM`.
                      examples:
                        - '01'
                    expirationYear:
                      type: string
                      description: Anno di scadenza della carta. Formato `YYYY`.
                      examples:
                        - '2025'
                    token:
                      type: string
                      description: >-
                        Usa una carta tokenizzata in precedenza inviando il
                        token.
                  required:
                    - name
                    - number
                    - cvv
                    - expirationMonth
                    - expirationYear
                autoRecurring:
                  type: object
                  description: Proprietà dell'abbonamento
                  properties:
                    repetitions:
                      type: integer
                      description: >-
                        Quante volte verrà riscosso questo pagamento. Per la
                        ricorrenza su richiesta, invia il parametro con
                        `value=0`.
                    type:
                      type: string
                      enum:
                        - day
                        - month
                        - custom
                      description: >-
                        Definisce l'unità dell'intervallo ricorrente. Per la
                        ricorrenza su richiesta, invia il parametro con
                        `value=custom`.
                    trialDays:
                      type: number
                      description: Numero di giorni di prova dell'abbonamento.
                  required:
                    - repetitions
                    - type
                retry:
                  type: object
                  description: Opzioni per i nuovi tentativi del payin.
                  properties:
                    repetitions:
                      type: number
                      description: Numero di volte in cui l'addebito verrà ritentato.
                    intervalUnit:
                      type: string
                      enum:
                        - day
                        - hour
                      description: >-
                        Unità di tempo in cui verranno eseguiti i tentativi.
                        Valori consentiti: `day` e `hour`.
                    intervalValue:
                      type: string
                      description: >-
                        Intervallo con cui verranno eseguiti i tentativi.
                        Definisce il numero di unità di tempo tra un tentativo e
                        l'altro.
                discount:
                  type: object
                  description: Opzioni di sconto.
                  properties:
                    amount:
                      type: string
                      description: Importo da addebitare al tuo utente finale.
                    period:
                      type: number
                      description: Periodo di sconto.
                  required:
                    - amount
                    - period
                dateToUpdate:
                  type: string
                  description: >-
                    Si applica solo quando l'aggiornamento richiesto deve essere
                    applicato a una data futura. Formato: `YYYY-MM-DD`.
              required:
                - amount
                - card
                - autoRecurring
              x-examples:
                Example 1:
                  paymentMethod:
                    type: CreditCard
                    code: '1000'
                    flow: DIRECT
                  externalId: '1662647310'
                  country: ARG
                  amount: 100
                  currency: ARS
                  accountNumber: '{{accountNumber}}'
                  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: ARG
                      zipCode: '1688'
                      comment: portero 801
                  payer:
                    type: INDIVIDUAL
                    name: Luke
                    lastname: Skywalker
                    document:
                      id: '37993830'
                      type: DNI
                    email: jane.doe@example.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
            examples:
              200 - Suscription:
                value:
                  dateToUpdate: '2025-01-30'
                  amount: 16000
                  autoRecurring:
                    repetitions: '3'
                    type: month
                    trialDays: '0'
                  retry:
                    repetitions: 2
                    intervalUnit: day
                    intervalValue: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  externalId:
                    type: string
                    description: >-
                      Identificatore univoco generato dal tuo sistema per
                      tracciare la transazione (caratteri alfanumerici e
                      trattini). Consigliamo di usare UUID4 per garantirne
                      l'univocità.
                  internalId:
                    type: string
                    description: Identificatore della transazione Localpayment.
                  status:
                    type: object
                    description: Stato dell'operazione.
                    properties:
                      code:
                        type: string
                        description: Codice di stato.
                      description:
                        type: string
                        description: Descrizione dello stato.
                      detail:
                        type: string
                        description: Dettagli dello stato.
                  errors:
                    type: array
                    description: Elenco degli errori verificatisi durante la transazione.
                    items:
                      type: object
                x-examples:
                  Example 1:
                    externalId: 564b161a-76ba-4a84-b5cf-583f2df8c377
                    internalId: 52425bbd-b68b-4abc-9480-5ae88d53adb3
                    status:
                      code: '107'
                      description: APPROVED
                      detail: Update subscription success
                    errors: []
              examples:
                107 - Update subscription success:
                  value:
                    externalId: 564b161a-76ba-4a84-b5cf-583f2df8c377
                    internalId: 52425bbd-b68b-4abc-9480-5ae88d53adb3
                    status:
                      code: '107'
                      description: APPROVED
                      detail: Update subscription success
                    errors: []
        '400':
          description: Richiesta non valida
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    description: Stato dell'operazione.
                    properties:
                      code:
                        type: string
                        description: Codice di stato.
                      description:
                        type: string
                        description: Descrizione dello stato.
                      detail:
                        type: string
                        description: Dettagli dello stato.
                x-examples:
                  Example 1:
                    status:
                      code: '400'
                      description: ERROR
                      detail: Invalid operation
              examples:
                400 - Invalid operation:
                  value:
                    status:
                      code: '400'
                      description: ERROR
                      detail: Invalid operation
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.