# Create a next period for this subscription

Create a next period for this subscription

Endpoint: POST /subscriptions/{id}/subscription_periods
Version: v1
Security: apiKey

## Path parameters:

  - `id` (string, required)
    ID of the subscription

## Request fields (application/json):

  - `amount` (integer, required)
    The amount that the customer will have to pay in the next period.
    Example: 1000

  - `description` (string)
    Description of the subscription. This will be shown to customers and in the PayPro dashboard

## Response 201 fields (application/json):

  - `id` (string, required)
    Example: "SPD344S1PDY8XX"

  - `type` (string, required)
    Enum: "subscription_period"

  - `amount` (integer, required)
    Example: 1500

  - `period_number` (integer, required)
    Example: 1

  - `subscription` (string, required)
    Example: "PSUJDW4VCMG9JS"

  - `state` (string, required)
    Enum: "open", "pending", "paid", "canceled", "reversed", "refunded"

  - `payments` (object, required)
    Example: {"type":"list","data":[{"id":"PPH25H07JYWLR7PA82","type":"payment","amount":1000,"description":"Test Payment","currency":"EUR","state":"paid","refunded_amount":0,"return_url":"https://example.com/thank-you","cancel_url":"https://example.com/cancel","paid_at":"2023-06-30T12:44:35Z","created_at":"2023-06-30T12:40:10Z","_links":{"self":"https://api.paypro.nl/payments/PPH25H07JYWLR7PA82"}}],"count":1,"_links":{"self":"https://api.paypro.nl/subscription_periods/SPD344S1PDY8XX/payments"}}

  - `payments.type` (string, required)
    Enum: "list"

  - `payments.data` (array, required)
    Example: [{"id":"PPH25H07JYWLR7PA82","type":"payment","amount":1000,"description":"Test Payment","currency":"EUR","state":"paid","refunded_amount":0,"return_url":"https://example.com/thank-you","cancel_url":"https://example.com/cancel","paid_at":"2023-06-30T12:44:35Z","created_at":"2023-06-30T12:40:10Z","_links":{"self":"https://api.paypro.nl/payments/PPH25H07JYWLR7PA82"}}]

  - `payments.data.id` (string, required)
    Example: "PPH25H07JYWLR7PA82"

  - `payments.data.type` (string, required)
    Enum: "payment"

  - `payments.data.amount` (integer, required)
    Example: 1000

  - `payments.data.description` (string, required)
    Example: "Test Payment"

  - `payments.data.currency` (string, required)
    Enum: "EUR"

  - `payments.data.pay_method` (any, required)
    Example: {"id":"ideal","type":"pay_method","name":"iDEAL | Wero","currencies":["EUR"],"minimum_amount":10,"maximum_amount":5000000,"details":{}}
    - `id` (string, required)
      Example: "ideal"
    - `type` (string, required)
      Enum: "pay_method"
    - `name` (string, required)
      Example: "iDEAL | Wero"
    - `currencies` (array)
      Enum: same as `payments.data.currency` (1 values)
    - `minimum_amount` (integer)
      Example: 10
    - `maximum_amount` (integer)
      Example: 5000000
    - `details` (object)
      Example: {}
    - `details.issuers` (array,null)
    - `details.issuers.code` (string)
    - `details.issuers.name` (string)
    - `details.iban` (string,null)
    - `details.bic` (string,null)
    - `details.account_name` (string,null)
    - `details.routing_number` (string,null)
    - `details.account_number` (string,null)

  - `payments.data.state` (string, required)
    Example: "paid"

  - `payments.data.refunded_amount` (integer, required)

  - `payments.data.return_url` (string,null, required)
    Example: "https://example.com/thank-you"

  - `payments.data.cancel_url` (string,null, required)
    Example: "https://example.com/cancel"

  - `payments.data.metadata` (object, required)
    Example: {}

  - `payments.data.customer` (string,null, required)
    Example: "CU7JRN6W6K3DA9"

  - `payments.data.mandate` (string,null, required)
    Example: "MD6ULYXJ4HP9RJ"

  - `payments.data.subscription` (string,null, required)

  - `payments.data.installment_plan` (string,null, required)

  - `payments.data.locale` (string,null, required)
    Enum: "de", "en", "fr", "nl"

  - `payments.data.paid_at` (string,null, required)
    Example: "2023-06-30T12:44:35Z"

  - `payments.data.fail_reason` (string,null)
    Enum: "The transaction amount or count exceeds the permitted frequency for this card or account.", "The card holder lacks sufficient funds to complete the transaction.", "The transaction could not be processed with the provided card number.", "The issuer has declined the transaction for authentication reasons.", "The transaction is suspected to be fraudulent.", "The issuer did not allow this transaction against this card based on internal reasons, such as the transaction originated from a specifically restricted industry or country.", "The payment is declined."

  - `payments.data.created_at` (string,null, required)
    Example: "2023-06-30T12:40:10Z"

  - `payments.data._links` (object, required)
    Example: {"self":"https://api.paypro.nl/payments/PPH25H07JYWLR7PA82","customer":"https://api.paypro.nl/customers/CU7JRN6W6K3DA9","mandate":"https://api.paypro.nl/mandates/MD6ULYXJ4HP9RJ"}

  - `payments.data._links.self` (string, required)
    Example: "https://api.paypro.nl/payments/PPH25H07JYWLR7PA82"

  - `payments.data._links.customer` (string)
    Example: "https://api.paypro.nl/customers/CU7JRN6W6K3DA9"

  - `payments.data._links.mandate` (string)
    Example: "https://api.paypro.nl/mandates/MD6ULYXJ4HP9RJ"

  - `payments.data._links.subscription` (string)

  - `payments.data._links.installment_plan` (string)

  - `payments.data._links.checkout` (string)

  - `payments.count` (integer, required)
    Example: 1

  - `payments._links` (object, required)
    Example: {"self":"https://api.paypro.nl/subscription_periods/SPD344S1PDY8XX/payments"}

  - `payments._links.self` (string, required)
    Example: "https://api.paypro.nl/subscription_periods/SPD344S1PDY8XX/payments"

  - `created_at` (string, required)
    Example: "2023-06-30T12:40:10Z"

  - `_links` (object, required)
    Example: {"self":"https://api.paypro.nl/subscription_periods/SPD344S1PDY8XX","subscription":"https://api.paypro.nl/subscriptions/PSUJDW4VCMG9JS"}

  - `_links.self` (string, required)
    Example: "https://api.paypro.nl/subscription_periods/SPD344S1PDY8XX"

  - `_links.subscription` (string, required)
    Example: "https://api.paypro.nl/subscriptions/PSUJDW4VCMG9JS"

## Response 404 fields (application/json):

  - `error` (object, required)

  - `error.message` (string, required)
    The error message

  - `error.type` (string, required)
    Type of error
    Enum: "invalid_request"


