{
  "components": {
    "parameters": {
      "DateRange": {
        "description": "Inclusive date range formatted as `YYYY-MM-DD|YYYY-MM-DD`.",
        "in": "query",
        "name": "dateRange",
        "schema": {
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}\\|[0-9]{4}-[0-9]{2}-[0-9]{2}$",
          "type": "string"
        }
      },
      "Id": {
        "description": "Resource identifier.",
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "$ref": "#/components/schemas/Uuid"
        }
      },
      "Page": {
        "description": "Page number to return.",
        "in": "query",
        "name": "page",
        "schema": {
          "default": 1,
          "minimum": 1,
          "type": "integer"
        }
      },
      "PerPage": {
        "description": "Number of results per page.",
        "in": "query",
        "name": "per_page",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      }
    },
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The request was invalid, unauthorized, or the resource was not found."
      },
      "Message": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Message"
            }
          }
        },
        "description": "Operation completed."
      }
    },
    "schemas": {
      "PlanAmendmentInput": {
        "properties": {
          "expires_at": {
            "description": "When the preview can no longer be confirmed. Defaults to 14 days from now.",
            "format": "date-time",
            "type": "string"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/PlanAmendmentLineItemChange"
            },
            "minItems": 1,
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "require_signature": {
            "default": false,
            "description": "Require the customer's signature even when the plan total doesn't increase.",
            "type": "boolean"
          }
        },
        "required": [
          "payment_plan_id",
          "line_items"
        ],
        "type": "object"
      },
      "RefundInput": {
        "properties": {
          "amount": {
            "exclusiveMinimum": 0,
            "type": "number"
          },
          "notes": {
            "type": "string"
          },
          "payment_id": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "payment_id",
          "amount"
        ],
        "type": "object"
      },
      "OpenPaymentPlanInput": {
        "properties": {
          "payment_method": {
            "properties": {
              "id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "token_id": {
                "type": "string"
              },
              "type": {
                "example": "card",
                "type": "string"
              }
            },
            "type": "object"
          },
          "payment_schedule": {
            "properties": {
              "contract_signature": {
                "type": "string"
              }
            },
            "required": [
              "contract_signature"
            ],
            "type": "object"
          },
          "return_url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "payment_schedule",
          "payment_method"
        ],
        "type": "object"
      },
      "Webhook": {
        "additionalProperties": true,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "event": {
            "description": "Event name, or `*` for every event.",
            "example": "payment_succeeded",
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "event",
          "active"
        ],
        "type": "object"
      },
      "PaymentList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "properties": {
              "payments": {
                "items": {
                  "$ref": "#/components/schemas/Payment"
                },
                "type": "array"
              }
            },
            "required": [
              "payments"
            ],
            "type": "object"
          }
        ]
      },
      "PlanAmendmentLineItemChange": {
        "description": "A line item change. `add` takes the line item fields (or a `catalog_product_id`), `update` takes the `id` of a line item on the plan plus the fields to change, and `remove` takes only the `id`.",
        "example": {
          "action": "add",
          "amount": 2.0e3,
          "description": "Photo package",
          "quantity": 1
        },
        "properties": {
          "action": {
            "enum": [
              "add",
              "update",
              "remove"
            ],
            "type": "string"
          },
          "amount": {
            "description": "Unit price as a decimal in the plan's currency (not cents).",
            "type": "number"
          },
          "catalog_product_id": {
            "$ref": "#/components/schemas/Uuid",
            "description": "For `add`, a product from the merchant's imported catalog. Its name, price, image and integration ids fill the line; any fields given alongside override them. The product must belong to the plan's integration and currency."
          },
          "description": {
            "type": "string"
          },
          "dynamic": {
            "type": "boolean"
          },
          "dynamic_type": {
            "example": "tax",
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid",
            "description": "Line item to update or remove. Required for `update` and `remove`."
          },
          "image": {
            "format": "uri",
            "type": "string"
          },
          "integration": {
            "type": "string"
          },
          "integration_id": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "quantity": {
            "minimum": 1,
            "type": "integer"
          },
          "weight": {
            "type": "number"
          },
          "weight_units": {
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "type": "string"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "PaymentCreateInput": {
        "properties": {
          "amount": {
            "type": "number"
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "return_url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "payment_plan_id",
          "amount"
        ],
        "type": "object"
      },
      "PaymentPlanUpdateInput": {
        "additionalProperties": true,
        "properties": {
          "customer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "merchant_notes": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "shipto_address": {
            "type": "string"
          },
          "shipto_address2": {
            "type": "string"
          },
          "shipto_city": {
            "type": "string"
          },
          "shipto_country": {
            "type": "string"
          },
          "shipto_name": {
            "type": "string"
          },
          "shipto_postal_code": {
            "type": "string"
          },
          "shipto_state": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Refund": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "payment_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "processor_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "payment_id",
          "amount"
        ],
        "type": "object"
      },
      "CustomerInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CustomerUpdateInput"
          },
          {
            "required": [
              "email"
            ],
            "type": "object"
          }
        ]
      },
      "WebhookCreateInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookInput"
          },
          {
            "required": [
              "url"
            ],
            "type": "object"
          }
        ]
      },
      "PlanAmendment": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "balance": {
            "type": "number"
          },
          "canceled_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "changes": {
            "description": "Requested line item changes, each with `before` and `after` line item snapshots.",
            "items": {
              "additionalProperties": true,
              "properties": {
                "action": {
                  "enum": [
                    "add",
                    "update",
                    "remove"
                  ],
                  "type": "string"
                },
                "after": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/LineItem"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "attrs": {
                  "$ref": "#/components/schemas/JsonObject"
                },
                "before": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/LineItem"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Uuid"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "confirmed_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "contract_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "contract_signature": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "installments": {
            "description": "Remaining installments with their amended amounts.",
            "items": {
              "additionalProperties": true,
              "properties": {
                "amount": {
                  "type": "number"
                },
                "previous_amount": {
                  "type": "number"
                },
                "scheduled": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "line_items": {
            "description": "The plan's line items after the amendment.",
            "items": {
              "$ref": "#/components/schemas/LineItem"
            },
            "type": "array"
          },
          "meta": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/JsonObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "offer_send_count": {
            "description": "How many times the offer was sent to the customer, by email or text.",
            "type": "integer"
          },
          "offer_sent_at": {
            "description": "When the offer was last sent to the customer, or null if it was never sent.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "payment_schedule_id": {
            "description": "The new payment schedule, once confirmed.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "previous_amount": {
            "type": "number"
          },
          "previous_balance": {
            "type": "number"
          },
          "previous_subtotal": {
            "type": [
              "number",
              "null"
            ]
          },
          "require_signature": {
            "type": "boolean"
          },
          "requires_customer_signature": {
            "description": "Whether confirming needs the customer's signature: the total increases or `require_signature` was set.",
            "type": "boolean"
          },
          "status": {
            "enum": [
              "pending",
              "confirmed",
              "canceled",
              "expired"
            ],
            "type": "string"
          },
          "subtotal": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "payment_plan_id",
          "status",
          "amount",
          "balance",
          "currency",
          "expires_at"
        ],
        "type": "object"
      },
      "PaymentSchedule": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "auto_process": {
            "type": "boolean"
          },
          "balance": {
            "type": "number"
          },
          "contract_body": {
            "type": [
              "string",
              "null"
            ]
          },
          "contract_signature": {
            "type": [
              "string",
              "null"
            ]
          },
          "contract_signed_date": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "down_payment_amount": {
            "type": "number"
          },
          "frequency": {
            "type": "integer"
          },
          "frequency_units": {
            "type": "string"
          },
          "id": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "inserted_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "num_payments": {
            "type": [
              "integer",
              "null"
            ]
          },
          "payment_amount": {
            "type": [
              "number",
              "null"
            ]
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "repay_by_date": {
            "format": "date",
            "type": [
              "string",
              "null"
            ]
          },
          "starts_auto": {
            "type": "boolean"
          },
          "starts_date": {
            "format": "date",
            "type": [
              "string",
              "null"
            ]
          },
          "term": {
            "type": "integer"
          },
          "term_units": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "balance",
          "auto_process"
        ],
        "type": "object"
      },
      "RefundList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "properties": {
              "refunds": {
                "items": {
                  "$ref": "#/components/schemas/Refund"
                },
                "type": "array"
              }
            },
            "required": [
              "refunds"
            ],
            "type": "object"
          }
        ]
      },
      "Error": {
        "example": {
          "errors": [
            "Name: can't be blank"
          ],
          "message": "Could not create offer"
        },
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "PaymentMethodInput": {
        "additionalProperties": true,
        "properties": {
          "customer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "token_id": {
            "description": "Tokenized payment source or processor payment-method identifier.",
            "type": "string"
          },
          "type": {
            "example": "card",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "type"
        ],
        "type": "object"
      },
      "Installment": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "id": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "inserted_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "retry_number": {
            "type": "integer"
          },
          "scheduled": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "scheduled",
          "retry_number"
        ],
        "type": "object"
      },
      "PlanAmendmentResult": {
        "properties": {
          "payment_plan": {
            "$ref": "#/components/schemas/PaymentPlan"
          },
          "plan_amendment": {
            "$ref": "#/components/schemas/PlanAmendment"
          }
        },
        "required": [
          "plan_amendment",
          "payment_plan"
        ],
        "type": "object"
      },
      "Offer": {
        "additionalProperties": true,
        "properties": {
          "auto_process": {
            "type": "boolean"
          },
          "currency": {
            "example": "USD",
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "down_payment": {
            "type": "number"
          },
          "down_payment_flexible": {
            "type": "boolean"
          },
          "down_payment_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "down_payment_min": {
            "type": [
              "number",
              "null"
            ]
          },
          "down_payment_type": {
            "enum": [
              "percent",
              "fixed"
            ],
            "type": "string"
          },
          "frequency": {
            "type": "integer"
          },
          "frequency_days": {
            "items": {
              "maximum": 31,
              "minimum": 1,
              "type": "integer"
            },
            "type": "array"
          },
          "frequency_flexible": {
            "type": "boolean"
          },
          "frequency_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "frequency_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "frequency_units": {
            "enum": [
              "days",
              "weeks",
              "months",
              "days_month"
            ],
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "merchant_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "payment_schedule_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "require_ship_to": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "starts_auto": {
            "type": "boolean"
          },
          "starts_date": {
            "format": "date",
            "type": [
              "string",
              "null"
            ]
          },
          "starts_date_flexible": {
            "type": "boolean"
          },
          "starts_date_max_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "term": {
            "type": "integer"
          },
          "term_date": {
            "format": "date",
            "type": [
              "string",
              "null"
            ]
          },
          "term_flexible": {
            "type": "boolean"
          },
          "term_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "term_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "term_units": {
            "enum": [
              "weeks",
              "months",
              "years",
              "payments",
              "date"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "currency",
          "auto_process"
        ],
        "type": "object"
      },
      "Customer": {
        "additionalProperties": true,
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "language": {
            "default": "en",
            "type": "string"
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_address2": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_city": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "shipto_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "example": "America/New_York",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email"
        ],
        "type": "object"
      },
      "PaymentScheduleInput": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "auto_process": {
            "type": "boolean"
          },
          "contract_body": {
            "type": "string"
          },
          "contract_signature": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "down_payment_amount": {
            "type": "number"
          },
          "frequency": {
            "type": "integer"
          },
          "frequency_days": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "frequency_units": {
            "enum": [
              "days",
              "weeks",
              "months",
              "days_month"
            ],
            "type": "string"
          },
          "payment_amount": {
            "type": "number"
          },
          "repay_by_date": {
            "format": "date",
            "type": "string"
          },
          "starts_auto": {
            "type": "boolean"
          },
          "starts_date": {
            "format": "date",
            "type": "string"
          },
          "term": {
            "type": "integer"
          },
          "term_units": {
            "enum": [
              "days",
              "weeks",
              "months",
              "years",
              "payments",
              "date"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Payment": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "currency": {
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "paid_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "processor": {
            "type": [
              "string",
              "null"
            ]
          },
          "processor_destination_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "processor_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "redirect_url": {
            "format": "uri",
            "type": [
              "string",
              "null"
            ]
          },
          "retry_number": {
            "type": "integer"
          },
          "status": {
            "example": "paid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_plan_id",
          "amount",
          "currency",
          "status"
        ],
        "type": "object"
      },
      "PaymentPlanCreateInput": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "create_stripe_payment_intent": {
            "type": "boolean"
          },
          "currency": {
            "default": "USD",
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerInput"
          },
          "customer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "integration": {
            "enum": [
              "shopify",
              "woocommerce",
              "bigcommerce",
              "opencart",
              "prestashop"
            ],
            "type": "string"
          },
          "ip_address": {
            "type": "string"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/EmbeddedLineItemInput"
            },
            "type": "array"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "offer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "payment_schedule": {
            "$ref": "#/components/schemas/PaymentScheduleInput"
          },
          "send_plan_request": {
            "type": "boolean"
          },
          "shipto_address": {
            "type": "string"
          },
          "shipto_address2": {
            "type": "string"
          },
          "shipto_city": {
            "type": "string"
          },
          "shipto_country": {
            "type": "string"
          },
          "shipto_name": {
            "type": "string"
          },
          "shipto_postal_code": {
            "type": "string"
          },
          "shipto_state": {
            "type": "string"
          },
          "status": {
            "default": "checkout",
            "enum": [
              "checkout",
              "pending"
            ],
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        },
        "required": [
          "amount"
        ],
        "type": "object"
      },
      "EmbeddedLineItemInput": {
        "additionalProperties": true,
        "properties": {
          "image": {
            "format": "uri",
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "quantity": {
            "minimum": 1,
            "type": "integer"
          },
          "weight": {
            "type": "number"
          },
          "weight_units": {
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "price",
          "quantity"
        ],
        "type": "object"
      },
      "WebhookInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "event": {
            "default": "*",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerUpdateInput": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "language": {
            "default": "en",
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "password": {
            "format": "password",
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "shipto_address": {
            "type": "string"
          },
          "shipto_address2": {
            "type": "string"
          },
          "shipto_city": {
            "type": "string"
          },
          "shipto_country": {
            "default": "US",
            "type": "string"
          },
          "shipto_name": {
            "type": "string"
          },
          "shipto_postal_code": {
            "type": "string"
          },
          "shipto_state": {
            "type": "string"
          },
          "timezone": {
            "default": "America/New_York",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LineItem": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "description": {
            "type": "string"
          },
          "dynamic": {
            "type": "boolean"
          },
          "dynamic_type": {
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "image": {
            "format": "uri",
            "type": [
              "string",
              "null"
            ]
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "integration": {
            "type": [
              "string",
              "null"
            ]
          },
          "integration_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/JsonObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "quantity": {
            "default": 1,
            "type": "integer"
          },
          "weight": {
            "type": [
              "number",
              "null"
            ]
          },
          "weight_units": {
            "enum": [
              "g",
              "kg",
              "oz",
              "lb",
              "null"
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "amount",
          "description",
          "quantity"
        ],
        "type": "object"
      },
      "Dispute": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "payment_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "payment_id",
          "amount",
          "status",
          "reason"
        ],
        "type": "object"
      },
      "OfferInput": {
        "additionalProperties": false,
        "properties": {
          "auto_process": {
            "default": true,
            "type": "boolean"
          },
          "currency": {
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "down_payment": {
            "default": 0,
            "type": "number"
          },
          "down_payment_flexible": {
            "default": false,
            "type": "boolean"
          },
          "down_payment_max": {
            "type": "number"
          },
          "down_payment_min": {
            "type": "number"
          },
          "down_payment_type": {
            "default": "percent",
            "enum": [
              "percent",
              "fixed"
            ],
            "type": "string"
          },
          "frequency": {
            "default": 1,
            "type": "integer"
          },
          "frequency_days": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "frequency_flexible": {
            "default": false,
            "type": "boolean"
          },
          "frequency_max": {
            "type": "integer"
          },
          "frequency_min": {
            "type": "integer"
          },
          "frequency_units": {
            "default": "months",
            "enum": [
              "days",
              "weeks",
              "months",
              "days_month"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "payment_schedule_description": {
            "type": "string"
          },
          "starts_auto": {
            "default": false,
            "type": "boolean"
          },
          "starts_date": {
            "format": "date",
            "type": "string"
          },
          "starts_date_flexible": {
            "default": false,
            "type": "boolean"
          },
          "starts_date_max_days": {
            "type": "integer"
          },
          "term": {
            "default": 3,
            "type": "integer"
          },
          "term_date": {
            "format": "date",
            "type": "string"
          },
          "term_flexible": {
            "default": false,
            "type": "boolean"
          },
          "term_max": {
            "type": "integer"
          },
          "term_min": {
            "type": "integer"
          },
          "term_units": {
            "default": "months",
            "enum": [
              "weeks",
              "months",
              "years",
              "payments",
              "date"
            ],
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "PaymentPlan": {
        "additionalProperties": true,
        "properties": {
          "amount": {
            "type": "number"
          },
          "amount_paid": {
            "type": "number"
          },
          "currency": {
            "maxLength": 3,
            "minLength": 3,
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "customer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "integration": {
            "type": [
              "string",
              "null"
            ]
          },
          "integration_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ip_address": {
            "type": [
              "string",
              "null"
            ]
          },
          "merchant_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/JsonObject"
              },
              {
                "type": "null"
              }
            ]
          },
          "number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "redirect_url": {
            "format": "uri",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "example": "open",
            "type": "string"
          },
          "subtotal": {
            "type": "number"
          },
          "user_agent": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "customer_id",
          "amount",
          "currency",
          "status"
        ],
        "type": "object"
      },
      "PaymentMethod": {
        "additionalProperties": true,
        "properties": {
          "active": {
            "type": "boolean"
          },
          "brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "exp_month": {
            "type": [
              "integer",
              "null"
            ]
          },
          "exp_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "last4": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "example": "card",
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "type"
        ],
        "type": "object"
      },
      "OfferItem": {
        "properties": {
          "amount": {
            "type": "number"
          },
          "amount_type": {
            "enum": [
              "percent",
              "fixed"
            ],
            "type": "string"
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "inserted_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "offer_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "offer_id",
          "name",
          "amount",
          "amount_type"
        ],
        "type": "object"
      },
      "PaymentPlanCreateResult": {
        "properties": {
          "installments": {
            "items": {
              "$ref": "#/components/schemas/Installment"
            },
            "type": "array"
          },
          "line_items": {
            "items": {
              "$ref": "#/components/schemas/LineItem"
            },
            "type": "array"
          },
          "payment_intent": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "payment_plan": {
            "$ref": "#/components/schemas/PaymentPlan"
          },
          "payment_schedule": {
            "$ref": "#/components/schemas/PaymentSchedule"
          }
        },
        "required": [
          "payment_plan",
          "payment_schedule",
          "line_items",
          "installments"
        ],
        "type": "object"
      },
      "PaymentConfirmInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaymentCreateInput"
          },
          {
            "properties": {
              "contract_signature": {
                "type": "string"
              }
            },
            "required": [
              "contract_signature"
            ],
            "type": "object"
          }
        ]
      },
      "OfferItemInput": {
        "properties": {
          "amount": {
            "type": "number"
          },
          "amount_type": {
            "enum": [
              "percent",
              "fixed"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "offer_id": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "name",
          "offer_id",
          "amount",
          "amount_type"
        ],
        "type": "object"
      },
      "PaymentPlanList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "properties": {
              "payment_plans": {
                "items": {
                  "$ref": "#/components/schemas/PaymentPlan"
                },
                "type": "array"
              }
            },
            "required": [
              "payment_plans"
            ],
            "type": "object"
          }
        ]
      },
      "Message": {
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "type": "object"
      },
      "PlanAmendmentConfirmInput": {
        "properties": {
          "contract_signature": {
            "description": "The customer's signature. Required when the amendment's `requires_customer_signature` is true.",
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "JsonObject": {
        "additionalProperties": true,
        "type": "object"
      },
      "LineItemInput": {
        "properties": {
          "amount": {
            "type": "number"
          },
          "description": {
            "type": "string"
          },
          "image": {
            "format": "uri",
            "type": "string"
          },
          "integration": {
            "type": "string"
          },
          "integration_id": {
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/JsonObject"
          },
          "payment_plan_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "quantity": {
            "default": 1,
            "type": "integer"
          },
          "weight": {
            "type": "number"
          },
          "weight_units": {
            "default": "lb",
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "type": "string"
          }
        },
        "required": [
          "payment_plan_id",
          "amount",
          "description"
        ],
        "type": "object"
      },
      "Uuid": {
        "format": "uuid",
        "type": "string"
      },
      "CustomerList": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "properties": {
              "customers": {
                "items": {
                  "$ref": "#/components/schemas/Customer"
                },
                "type": "array"
              }
            },
            "required": [
              "customers"
            ],
            "type": "object"
          }
        ]
      },
      "Pagination": {
        "properties": {
          "page_number": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total_entries": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        },
        "required": [
          "page_number",
          "page_size",
          "total_entries",
          "total_pages"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "Merchant API key from the Partial.ly merchant portal.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "Partial.ly API reference",
    "url": "https://developer.partial.ly/"
  },
  "info": {
    "contact": {
      "email": "support@partial.ly",
      "name": "Partial.ly Support"
    },
    "description": "The Partial.ly REST API provides merchant-scoped access to offers, customers,\npayment plans, payments, refunds, disputes, and webhooks. Requests and responses\nuse JSON unless otherwise noted. All authenticated requests use the merchant API\nkey as a Bearer token.\n",
    "license": {
      "name": "Proprietary"
    },
    "summary": "Create and manage flexible payment plans for a Partial.ly merchant account.",
    "termsOfService": "https://partial.ly/terms/merchant",
    "title": "Partial.ly API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/plan_amendment/{id}": {
      "get": {
        "operationId": "getPlanAmendment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanAmendmentResult"
                }
              }
            },
            "description": "Plan amendment and the plan it applies to."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Retrieve a plan amendment",
        "tags": [
          "Plan Amendments"
        ]
      }
    },
    "/payment_plan/open/{id}": {
      "put": {
        "description": "Signs the contract, attaches a payment method, and processes any down payment.",
        "operationId": "openPaymentPlan",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenPaymentPlanInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlan"
                }
              }
            },
            "description": "Opened plan, or a plan requiring additional customer action."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Open a payment plan",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/checkout_link": {
      "post": {
        "description": "Builds a checkout link without creating anything. With `offer_id`, a shareable offer link: every visit starts a new checkout from the offer, so one link can be shared with many customers. The link is checked as checkout itself would check it, and `preview` shows the schedule a customer checking out today would get. Fields the offer doesn't let customers choose (`down_payment_amount`, `term`, `frequency`, `starts_date`) are left off the link and listed in `ignored`. With `payment_plan_id`, the link for a plan in checkout or pending status. Customers can see, and could edit, an offer link's amount and items.",
        "operationId": "buildCheckoutLink",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "amount": {
                    "description": "Plan amount before the offer's own fees, as a decimal in the currency (not cents). Defaults to the line items' total.",
                    "type": "number"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "customer_email": {
                    "description": "Prefills the customer's email at checkout.",
                    "type": "string"
                  },
                  "description": {
                    "description": "What the customer is paying for, shown at checkout.",
                    "type": "string"
                  },
                  "down_payment_amount": {
                    "type": "number"
                  },
                  "frequency": {
                    "type": "integer"
                  },
                  "language": {
                    "type": "string"
                  },
                  "line_items": {
                    "items": {
                      "properties": {
                        "image": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "price": {
                          "type": "number"
                        },
                        "quantity": {
                          "minimum": 1,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "name",
                        "price"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "meta": {
                    "additionalProperties": {
                      "type": [
                        "string",
                        "number"
                      ]
                    },
                    "type": "object"
                  },
                  "offer_id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "payment_plan_id": {
                    "$ref": "#/components/schemas/Uuid"
                  },
                  "referral_source": {
                    "type": "string"
                  },
                  "return_confirmed_url": {
                    "type": "string"
                  },
                  "return_url": {
                    "type": "string"
                  },
                  "starts_date": {
                    "format": "date",
                    "type": "string"
                  },
                  "term": {
                    "type": "integer"
                  },
                  "term_date": {
                    "format": "date",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "ignored": {
                      "description": "Fields left off the link, and why.",
                      "items": {
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "kind": {
                      "enum": [
                        "offer",
                        "plan"
                      ],
                      "type": "string"
                    },
                    "preview": {
                      "description": "For an offer link, the schedule a customer checking out today would get: total, down payment, number and amount of payments, frequency, first and last payment dates, and the offer's fees.",
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "warnings": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "url",
                    "kind",
                    "ignored",
                    "warnings"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The checkout link."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Build a checkout link",
        "tags": [
          "Checkout Links"
        ]
      }
    },
    "/payment_schedule/{id}": {
      "put": {
        "operationId": "updatePaymentSchedule",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentScheduleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSchedule"
                }
              }
            },
            "description": "Payment schedule updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update a payment schedule",
        "tags": [
          "Payment Schedules"
        ]
      }
    },
    "/payment_schedule": {
      "post": {
        "operationId": "createPaymentSchedule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/PaymentScheduleInput"
                  },
                  {
                    "properties": {
                      "payment_plan_id": {
                        "$ref": "#/components/schemas/Uuid"
                      }
                    },
                    "required": [
                      "payment_plan_id"
                    ],
                    "type": "object"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSchedule"
                }
              }
            },
            "description": "Payment schedule created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a payment schedule",
        "tags": [
          "Payment Schedules"
        ]
      }
    },
    "/payment": {
      "get": {
        "operationId": "listPayments",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "in": "query",
            "name": "payment_plan_id",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentList"
                }
              }
            },
            "description": "Paginated payments."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List payments",
        "tags": [
          "Payments"
        ]
      }
    },
    "/payment_plan/cancel/{id}": {
      "put": {
        "operationId": "cancelPaymentPlan",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlan"
                }
              }
            },
            "description": "Canceled payment plan."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Cancel a payment plan",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/payment_plan/{id}": {
      "delete": {
        "description": "Deletes a plan the customer never completed checkout for, e.g. when the order was completed, canceled, or deleted outside of Partial.ly. Only plans in `checkout` status can be deleted; use the cancel endpoint for plans that were opened. Plans with a payment that is paid or still in progress can't be deleted. Sends a `checkout_plan_deleted` webhook.",
        "operationId": "deletePaymentPlan",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete a payment plan in checkout status",
        "tags": [
          "Payment Plans"
        ]
      },
      "get": {
        "operationId": "getPaymentPlan",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlan"
                }
              }
            },
            "description": "Payment plan details."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Retrieve a payment plan",
        "tags": [
          "Payment Plans"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "put": {
        "operationId": "updatePaymentPlan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentPlanUpdateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlan"
                }
              }
            },
            "description": "Payment plan updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update a payment plan",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/payment_schedule/contract_pdf/{id}": {
      "get": {
        "operationId": "getPaymentScheduleContractPdf",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "contentEncoding": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Contract PDF."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Download a payment schedule contract PDF",
        "tags": [
          "Payment Schedules"
        ]
      }
    },
    "/customer/login_token": {
      "post": {
        "operationId": "loginCustomerWithToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "token"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            },
            "description": "Customer login result."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Log a customer in with an emailed token",
        "tags": [
          "Customers"
        ]
      }
    },
    "/installment": {
      "get": {
        "operationId": "listInstallments",
        "parameters": [
          {
            "description": "Return installments belonging to this payment schedule.",
            "in": "query",
            "name": "payment_schedule_id",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "description": "Return upcoming installments belonging to this customer.",
            "in": "query",
            "name": "customer_id",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Installment"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Installments."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List installments",
        "tags": [
          "Installments"
        ]
      }
    },
    "/customer/login_email": {
      "post": {
        "operationId": "emailCustomerLoginToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Email a customer login token",
        "tags": [
          "Customers"
        ]
      }
    },
    "/payment_plan/send_plan_request/{id}": {
      "post": {
        "operationId": "sendPaymentPlanRequest",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Send a customer an email to complete a pending plan",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/payment_method": {
      "get": {
        "operationId": "listPaymentMethods",
        "parameters": [
          {
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PaymentMethod"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Payment methods."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List a customer's payment methods",
        "tags": [
          "Payment Methods"
        ]
      },
      "post": {
        "operationId": "createPaymentMethod",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentMethodInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentMethod"
                }
              }
            },
            "description": "Payment method created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a payment method",
        "tags": [
          "Payment Methods"
        ]
      }
    },
    "/plan_amendment/{id}/confirm": {
      "post": {
        "description": "Applies a pending amendment: the plan's line items and totals are updated, a new signed payment schedule with the amended installments replaces the active one, and a `plan_amended` webhook is sent. `contract_signature` is required when `requires_customer_signature` is true; otherwise it can be left out to reuse the signature on the plan's current schedule. If the plan changed since the preview (an installment was charged, a payment or refund landed, another amendment was confirmed, a line item was edited) the request fails with a `409` and a new preview is needed.",
        "operationId": "confirmPlanAmendment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanAmendmentConfirmInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanAmendmentResult"
                }
              }
            },
            "description": "Confirmed plan amendment and the amended plan."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The payment plan changed since the amendment was previewed."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Confirm a pending plan amendment",
        "tags": [
          "Plan Amendments"
        ]
      }
    },
    "/payment_schedule/sign/{id}": {
      "put": {
        "operationId": "signPaymentSchedule",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "contract_signature": {
                    "type": "string"
                  }
                },
                "required": [
                  "contract_signature"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSchedule"
                }
              }
            },
            "description": "Signed payment schedule."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Add a contract signature",
        "tags": [
          "Payment Schedules"
        ]
      }
    },
    "/plan_amendment": {
      "post": {
        "description": "Validates a set of line item changes (add, update, remove) against an open payment plan and creates a `pending` plan amendment previewing the plan's new totals, the remaining installments (same dates, amounts re-proportioned to the new balance) and the contract text for the customer to sign. Nothing on the plan changes until the amendment is confirmed. Tax is not recalculated: add or update a tax line (`dynamic: true`, `dynamic_type: tax`) alongside the item it applies to. Amendments that increase the plan total must be signed by the customer, either by sending them the offer or by confirming with their `contract_signature`.",
        "operationId": "previewPlanAmendment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanAmendmentInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanAmendmentResult"
                }
              }
            },
            "description": "Pending plan amendment and the plan it applies to."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Preview an amendment to an open plan's line items",
        "tags": [
          "Plan Amendments"
        ]
      }
    },
    "/dispute": {
      "get": {
        "operationId": "listDisputes",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "reason",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/DateRange"
          },
          {
            "in": "query",
            "name": "customer",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Dispute"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Disputes."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List disputes",
        "tags": [
          "Disputes"
        ]
      }
    },
    "/refund": {
      "get": {
        "operationId": "listRefunds",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "in": "query",
            "name": "reason",
            "schema": {
              "enum": [
                "requested_by_customer",
                "duplicate",
                "fraudulent"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "date",
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/DateRange"
          },
          {
            "in": "query",
            "name": "customer",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundList"
                }
              }
            },
            "description": "Paginated refunds."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List refunds",
        "tags": [
          "Refunds"
        ]
      },
      "post": {
        "operationId": "createRefund",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                }
              }
            },
            "description": "Refund created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Refund a payment",
        "tags": [
          "Refunds"
        ]
      }
    },
    "/plan_amendment/{id}/cancel": {
      "post": {
        "operationId": "cancelPlanAmendment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanAmendmentResult"
                }
              }
            },
            "description": "Canceled plan amendment and the plan it applies to."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Cancel a pending plan amendment",
        "tags": [
          "Plan Amendments"
        ]
      }
    },
    "/payment_method/{id}": {
      "delete": {
        "operationId": "deletePaymentMethod",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete a payment method",
        "tags": [
          "Payment Methods"
        ]
      }
    },
    "/payment/create": {
      "post": {
        "operationId": "createPayment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            },
            "description": "Payment created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a payment",
        "tags": [
          "Payments"
        ]
      }
    },
    "/offer_item/{id}": {
      "delete": {
        "operationId": "deleteOfferItem",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete an offer item",
        "tags": [
          "Offer Items"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "put": {
        "operationId": "updateOfferItem",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferItemInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfferItem"
                }
              }
            },
            "description": "Offer item updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update an offer item",
        "tags": [
          "Offer Items"
        ]
      }
    },
    "/customer/{id}": {
      "get": {
        "operationId": "getCustomer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer details."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Retrieve a customer",
        "tags": [
          "Customers"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "put": {
        "operationId": "updateCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update a customer",
        "tags": [
          "Customers"
        ]
      }
    },
    "/payment/confirm": {
      "post": {
        "operationId": "confirmPayment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentConfirmInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            },
            "description": "Confirmed payment."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Confirm a payment that changes the payment schedule",
        "tags": [
          "Payments"
        ]
      }
    },
    "/plan_amendment/{id}/send": {
      "post": {
        "description": "Emails the customer a link to review, sign and accept (or decline) a pending amendment. This is how amendments that increase the plan total get signed by the customer. Each call sends the email again; check the amendment's `offer_sent_at` and `offer_send_count` first to avoid a duplicate.",
        "operationId": "sendPlanAmendment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "message": {
                    "description": "Optional note from the merchant, plain text (no HTML, up to 2000 characters), shown above the offer in place of the default opening line. Blank lines separate paragraphs.",
                    "maxLength": 2000,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanAmendmentResult"
                }
              }
            },
            "description": "Sent plan amendment and the plan it applies to."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Email the customer a pending plan amendment to review",
        "tags": [
          "Plan Amendments"
        ]
      }
    },
    "/payment/{id}": {
      "get": {
        "operationId": "getPayment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            },
            "description": "Payment details."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Retrieve a payment",
        "tags": [
          "Payments"
        ]
      }
    },
    "/offer": {
      "get": {
        "operationId": "listOffers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Offer"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Offers available to the merchant."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List offers",
        "tags": [
          "Offers"
        ]
      },
      "post": {
        "operationId": "createOffer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Offer"
                }
              }
            },
            "description": "Offer created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create an offer",
        "tags": [
          "Offers"
        ]
      }
    },
    "/webhook/{id}": {
      "delete": {
        "operationId": "deleteWebhook",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete a webhook listener",
        "tags": [
          "Webhooks"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "put": {
        "operationId": "updateWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "Webhook listener updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update a webhook listener",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/customer/login_password": {
      "post": {
        "operationId": "loginCustomerWithPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            },
            "description": "Customer login result."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Log a customer in with a password",
        "tags": [
          "Customers"
        ]
      }
    },
    "/line_item/{id}": {
      "delete": {
        "operationId": "deleteLineItem",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete a line item",
        "tags": [
          "Line Items"
        ]
      }
    },
    "/payment_plan/reopen_schedule/{id}": {
      "post": {
        "operationId": "generateReopenPaymentSchedule",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentScheduleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSchedule"
                }
              }
            },
            "description": "Proposed replacement payment schedule."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate a schedule for reopening a defaulted plan",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/payment_plan": {
      "get": {
        "operationId": "listPaymentPlans",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "description": "Search query.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlanList"
                }
              }
            },
            "description": "Paginated payment plans."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List payment plans",
        "tags": [
          "Payment Plans"
        ]
      },
      "post": {
        "description": "Provide either `customer_id` or `customer`, and either `offer_id` or\n`payment_schedule`. Scheduled installments are returned but are not stored\nuntil the plan is opened.\n",
        "operationId": "createPaymentPlan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentPlanCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPlanCreateResult"
                }
              }
            },
            "description": "Payment plan and generated schedule."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a payment plan in checkout or pending status",
        "tags": [
          "Payment Plans"
        ]
      }
    },
    "/webhook": {
      "get": {
        "operationId": "listWebhooks",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Webhook listeners."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List webhook listeners",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "operationId": "createWebhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "Webhook listener created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a webhook listener",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/offer_item": {
      "get": {
        "operationId": "listOfferItems",
        "parameters": [
          {
            "description": "Offer whose items should be returned.",
            "in": "query",
            "name": "offer_id",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "offer_items": {
                      "items": {
                        "$ref": "#/components/schemas/OfferItem"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "offer_items"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Offer items."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List offer items",
        "tags": [
          "Offer Items"
        ]
      },
      "post": {
        "operationId": "createOfferItem",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferItemInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OfferItem"
                }
              }
            },
            "description": "Offer item created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create an offer item",
        "tags": [
          "Offer Items"
        ]
      }
    },
    "/installment/pay/{id}": {
      "put": {
        "operationId": "payInstallment",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "return_url": {
                    "format": "uri",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payment"
                }
              }
            },
            "description": "Payment created for the installment."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Pay a scheduled installment",
        "tags": [
          "Installments"
        ]
      }
    },
    "/customer": {
      "get": {
        "operationId": "listCustomers",
        "parameters": [
          {
            "$ref": "#/components/parameters/Page"
          },
          {
            "$ref": "#/components/parameters/PerPage"
          },
          {
            "description": "Search email, first name, or last name.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerList"
                }
              }
            },
            "description": "Paginated customers."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List customers",
        "tags": [
          "Customers"
        ]
      },
      "post": {
        "operationId": "createCustomer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create a customer",
        "tags": [
          "Customers"
        ]
      }
    },
    "/offer/{id}": {
      "get": {
        "operationId": "getOffer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Offer"
                }
              }
            },
            "description": "Offer details."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Retrieve an offer",
        "tags": [
          "Offers"
        ]
      },
      "parameters": [
        {
          "$ref": "#/components/parameters/Id"
        }
      ],
      "put": {
        "operationId": "updateOffer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Offer"
                }
              }
            },
            "description": "Offer updated."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Update an offer",
        "tags": [
          "Offers"
        ]
      }
    },
    "/line_item": {
      "post": {
        "operationId": "createLineItem",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LineItemInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LineItem"
                }
              }
            },
            "description": "Line item created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Add a line item to a payment plan",
        "tags": [
          "Line Items"
        ]
      }
    },
    "/customer/gdpr_remove/{id}": {
      "put": {
        "operationId": "gdprRemoveCustomer",
        "parameters": [
          {
            "$ref": "#/components/parameters/Id"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Message"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Remove a customer's identifying data",
        "tags": [
          "Customers"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production",
      "url": "https://partial.ly/api"
    },
    {
      "description": "Demo and integration testing",
      "url": "https://demo.partial.ly/api"
    }
  ],
  "tags": [
    {
      "description": "Reusable payment-plan terms offered to customers.",
      "name": "Offers"
    },
    {
      "description": "Fees and adjustments automatically attached to offers.",
      "name": "Offer Items"
    },
    {
      "description": "Merchant customers and customer authentication.",
      "name": "Customers"
    },
    {
      "description": "Saved customer payment methods.",
      "name": "Payment Methods"
    },
    {
      "description": "Payment-plan creation, lifecycle, and retrieval.",
      "name": "Payment Plans"
    },
    {
      "description": "Products, services, fees, and adjustments on payment plans.",
      "name": "Line Items"
    },
    {
      "description": "Adding, editing, and removing line items on open payment plans.",
      "name": "Plan Amendments"
    },
    {
      "description": "Shareable links that start a checkout.",
      "name": "Checkout Links"
    },
    {
      "description": "Payment creation, confirmation, and history.",
      "name": "Payments"
    },
    {
      "description": "Payment timing, installments, and contracts.",
      "name": "Payment Schedules"
    },
    {
      "description": "Scheduled future payments.",
      "name": "Installments"
    },
    {
      "description": "Refund creation and history.",
      "name": "Refunds"
    },
    {
      "description": "Processor disputes associated with merchant payments.",
      "name": "Disputes"
    },
    {
      "description": "Event listener registration and management.",
      "name": "Webhooks"
    }
  ]
}
