Get installment options

GET/orders/installment-options

Retrieves available installment options based on the business and the amount to be paid. This is an authenticated route.

Each option brings the fees that the buyer pays and the interest of that number of installments. A fee paid by the buyer is a fixed value in cents plus a percentage of the amount, and the fixed value is added to the total: a fee of 99 cents plus 2% on 5000 adds 199 to totalBuyerPaymentTaxValueInCents. The interest is calculated on orderValueInCents, which already includes these fees.

The values of the example are illustrative. They assume an amountToBePaidInCents of 5000 and a business with a fee paid by the buyer of 99 cents plus 2% in every option, so orderValueInCents is 5199.

Headers

  • x-api-keystringrequired

    Api key provided on integrations tab in Easyflow platform.

  • x-api-secretstringrequired

    Api Secret provided on integrations tab in Easyflow platform.

  • business-idstringrequired

    Identifier of the business the request refers to. The user of your API key must be linked to this business, as explained in The business identifier. A value that is not a business identifier returns 400 with Invalid param: [businessId], a business that the user is not linked to returns 403, and a request that also sends x-business-id with a different value returns 401.

Query parameters

  • amountToBePaidInCentsintegerrequired

    Amount to be paid in cents, without interest and without the fees paid by the buyer. It must be greater than zero.

    Example:5000

    >= 1

  • itemsarray of objects

    Optional cart items, sent as items[0][offerItemId]=...&items[0][valueInCents]=.... When sent, the list cannot be empty and every item needs offerItemId (a valid id) and valueInCents (greater than zero).

Responses

200Installment options successfully retrieved.

Installment options successfully retrieved.

Content typeapplication/jsonobject

  • statusCodeinteger

    Example:200

  • dataobject
    Show child attributesHide child attributes
    • optionsarray of objects
      Show child attributesHide child attributes
      • installmentsinteger

        Number of installments of the option.

      • parcelValueInCentsinteger

        Value of each installment, in cents. It is totalValueInCents divided by installments, rounded to the nearest cent.

      • totalInterestInCentsinteger

        Interest that the buyer pays with this number of installments, in cents.

      • totalValueInCentsinteger

        Total that the buyer pays with this number of installments, in cents. It is orderValueInCents plus totalInterestInCents and, when the business passes part of its own fees on to the buyer, that part.

      • orderValueInCentsinteger

        Value on which the interest is calculated, in cents. It is amountToBePaidInCents plus the fees of the order that the buyer pays, totalBuyerPaymentTaxValueInCents included.

      • totalBuyerPaymentTaxValueInCentsinteger

        Sum of the fees of the business that the buyer pays with this number of installments, in cents. Each fee is a fixed value in cents plus a percentage of the amount, and the fixed value is added to the total. It is 0 when the buyer pays no fee.

400If the provided parameter is invalid, the API will return the following error response:

If the provided parameter is invalid, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid param: []

    Example:Invalid param: []

  • errorstring

    Bad Request

    Example:Bad Request

  • statusCodeinteger

    400

    Example:400

  • errorCodestring

    Code that identifies the error. Present only on some errors.

401If the request is unauthorized, the API will return the following error response:

If the request is unauthorized, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid field

    Example:Unauthorized

  • errorstring

    Unauthorized

    Example:Unauthorized

  • statusCodeinteger

    401

    Example:401

403If the request is forbidden, the API will return the following error response:

If the request is forbidden, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Forbidden resource

    Example:Forbidden resource

  • errorstring

    Forbidden

    Example:Forbidden

  • statusCodeinteger

    403

    Example:403

500If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

Content typeapplication/jsonobject

  • statusCodeinteger

    HTTP status code.

    Example:500

  • messagestring

    Explanation of the error.

    Example:Internal Server Error