> ## 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.

# 生成分期付款计划报价

此接口会生成分期付款计划的报价。

> \**注意*
>
> 分期付款仅适用于信用卡付款。

**货币因素：**

分期付款计划可使用的货币为：

* **当地货币：**所选国家/地区的货币。在这种情况下，客户将以其当地货币支付费用。
* **账户货币：**您的 Localpayment 账户的货币。如果此货币与当地货币不同，Localpayment 将进行外汇兑换，以获得等值的当地货币金额。此兑换结果将显示在您的账户对账单中。

> **注意**
>
> 对于拥有多种官方货币的国家/地区，`paymentMethod.code` 参数用于指定交易的货币。这可确保付款以所选付款方式对应的正确货币处理。

> **令牌过期**
>
> 响应中提供的令牌自生成之时起 **10 分钟**内有效。超过此期限后，该令牌将过期，无法再用于处理分期付款计划。

## 货币因素：

分期付款计划可使用的货币为：

* **当地货币**：所选国家/地区的货币。在这种情况下，客户将以其当地货币支付费用。\_
* **账户货币：**您的 Localpayment 账户的货币。如果此货币与当地货币不同，Localpayment 将进行外汇兑换，以获得等值的当地货币金额。此兑换结果将显示在您的账户对账单中。

> [!NOTE]
>
> **注意**
>
> 对于拥有多种官方货币的国家/地区，`paymentMethod.code` 参数用于指定交易的货币。这可确保付款以所选付款方式对应的正确货币处理。


## OpenAPI

````yaml openapi/zh/localpayment.json POST /api/installments-plans
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/installments-plans:
    post:
      summary: 生成分期付款计划报价
      operationId: installments-plan-quote
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                paymentMethod:
                  type: object
                  description: 指定交易中使用的或请求的支付方式。
                  properties:
                    code:
                      type: string
                      description: >-
                        [支付方式代码](/zh/reference/get-available-payment-methods)。仅限
                        `paymentMethodType = CreditCard`。
                  required:
                    - code
                country:
                  type: string
                  enum:
                    - ARG
                    - BOL
                    - BRA
                    - CHL
                    - COL
                    - CRI
                    - DOM
                    - GTM
                    - HND
                    - MEX
                    - PAN
                    - PRY
                    - PER
                  description: >-
                    [付款处理所在国家/地区](/zh/reference/country-codes)。ISO 3166-1
                    alpha-3。
                currency:
                  type: string
                  enum:
                    - ARS
                    - BOB
                    - BRL
                    - CLP
                    - COP
                    - CRC
                    - DOP
                    - USD
                    - GTQ
                    - MXN
                    - PYG
                    - PEN
                  description: 金额所使用的[货币](/zh/reference/currency-codes)。
                amount:
                  type: number
                  description: 需分期付款的金额。
                accountNumber:
                  type: string
                  description: 将入账该金额的 Localpayment 账号。
              required:
                - paymentMethod
                - country
                - currency
                - amount
                - accountNumber
              x-examples:
                Example 1:
                  paymentMethod:
                    code: '1000'
                  country: ARG
                  currency: ARS
                  amount: 1000
                  accountNumber: '{{accountNumber}}'
            examples:
              Installments Plan Quote:
                value:
                  paymentMethod:
                    code: '1000'
                  country: ARG
                  currency: ARS
                  amount: 1000
                  accountNumber: '{{accountNumber}}'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  installmentsToken:
                    type: string
                    description: 分期付款计划的唯一标识符。此令牌用于引用为交易生成的特定分期付款选项。
                  creationDate:
                    type: string
                    description: 分期付款计划的创建日期和时间。时间戳遵循 ISO 8601 格式。
                  expirationDate:
                    type: string
                    description: 分期付款计划到期的日期和时间。到期后，该计划将无法继续使用。时间戳采用 ISO 8601 格式。
                  currency:
                    type: string
                    description: 交易金额的货币代码。
                  amount:
                    type: number
                    description: 分期付款计划所依据的交易总金额。
                  installments:
                    type: array
                    items:
                      type: object
                      properties:
                        installments:
                          type: integer
                          description: 此选项可分期付款的期数。
                        installmentAmount:
                          type: number
                          description: 每期应付金额。
                        totalPaymentAmount:
                          type: number
                          description: 所有分期付款的总金额，包括任何融资费用。
                        financingFee:
                          type: number
                          description: 在所选分期期数内为该交易提供融资所收取的额外费用。
                x-examples:
                  Example 1:
                    installmentsToken: b71a6973-ffdc-427b-b014-e03eb4462e82
                    creationDate: '2022-03-29T23:53:52.7150456+00:00'
                    expirationDate: '2022-03-30T00:03:52.71509+00:00'
                    currency: ARS
                    amount: 2000
                    installments:
                      - installments: 2
                        installmentAmount: 1100
                        totalPaymentAmount: 2200
                        financingFee: 200
                      - installments: 3
                        installmentAmount: 941.7187
                        totalPaymentAmount: 2825.156
                        financingFee: 825.156
                      - installments: 6
                        installmentAmount: 633.17334
                        totalPaymentAmount: 3799.04
                        financingFee: 1799.04
              examples:
                200 - Installment Plan Quote:
                  value:
                    installmentsToken: bc1a1973-fadc-427b-b014-e43eb4462e82
                    creationDate: '2025-01-29T23:53:52.7150456+00:00'
                    expirationDate: '2025-01-30T00:03:52.71509+00:00'
                    currency: ARS
                    amount: 2000
                    installments:
                      - installments: 2
                        installmentAmount: 1100
                        totalPaymentAmount: 2200
                        financingFee: 200
                      - installments: 3
                        installmentAmount: 941.7187
                        totalPaymentAmount: 2825.156
                        financingFee: 825.156
                      - installments: 6
                        installmentAmount: 633.17334
                        totalPaymentAmount: 3799.04
                        financingFee: 1799.04
        '201':
          description: 创建
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      detail:
                        type: string
                        description: 更多回复详情。
                    required:
                      - code
                      - detail
                required:
                  - status
              examples:
                829 - System error to generate Installment Plan.:
                  value:
                    status:
                      code: '829'
                      detail: System error to generate Installment Plan
        '400':
          description: 错误的请求。
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      detail:
                        type: string
                        description: 更多回复详情。
                    required:
                      - code
                      - detail
                required:
                  - status
              examples:
                300 - Invalid param.:
                  value:
                    status:
                      code: '300'
                      detail: Invalid param + [paymentMethod] + [Is mandatory]
        '401':
          description: 未经授权。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '403':
          description: 禁止
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                required:
                  - detail
                x-examples:
                  Example 1:
                    detail: You do not have permission to perform this action.
              examples:
                403 - You do not have permission to perform this action.:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: 未找到
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: 状态码。
                      detail:
                        type: string
                        description: 更多回复详情。
                    required:
                      - code
                      - detail
                required:
                  - status
              examples:
                300 - Instalment Payment Plan is only for types of Credit Card methods:
                  value:
                    status:
                      code: '300'
                      detail: >-
                        Instalment Payment Plan is only for types of Credit Card
                        methods
      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.