Create a loan for a specific account

POST /accounts/{account_id}/line_items/loans

Path parameters

Body Required

Body of request to create a loan

  • The ID associated to be with the line item for future requests. If not provided on line item creation, Canopy will generate this field.

    Format should match the following pattern: ^(?!can_).*$.

  • The status of a line item.

    Values are VALID, INVALID, OFFSET, PENDING, AUTHORIZED, DECLINED, VOID, or POSTED. Default value is VALID.

  • original_amount_cents integer Required

    The amount charged (in cents).

    Default value is 0.

  • interest_policies object | null

    Policies for interest on this specific line item.

    • Annual interest in percentage.

      Default value is 0.

    • If true, loan interest will only accrue for the expected duration of the loan. Otherwise, interest will accrue as long as there is an outstanding balance.

      Default value is false.

  • effective_at string(date-time)

    The Date-Time that the charge is made applicable to the account. Note that loans always follow the statement cycle of the related account, meaning the first cycle will become due at the time of the statement most closely following this effective_at.

  • am_len integer

    For amortizing line items (loans), the number of cycles over which the line item amortizes.

  • A description for the Loan

  • fee_policies object | null

    Policies for an origination fee related to this loan

    • The fee charged at the time of loan origination

      Default value is 0.

    • The fee as a percent of initial_principal_cents charged at the time of loan origination

      Default value is 0.

    • If this flag is false, the default, the origination fee will be assessed as the greater value of origination_fee_cents and origination_fee_percent / 100 * initial_principal_cents. If this flag is true, not the default, the origination fee will be assessed as the lesser value of origination_fee_cents and origination_fee_percent / 100 * initial_principal_cents.

      Default value is false.

    • If this flag is false, the default, then the origination fee will come due with the first statement. If the flag is true, not the default, the origination fee will amortize as a part of the loan creation process and the fee will be split into equal payments across the life of the loan.

      Default value is false.

  • merchant_data object | null
    • lithic object
      • Last four digits of the card against which the spend was made.

  • external_fields array[object] | null

    External fields can be used to associate this record to entities in external systems.

    Not more than 100 elements.

    • key string

      Key - i.e. Name of the External Party

    • value string

      Value - i.e. External Account ID

Responses

POST /accounts/{account_id}/line_items/loans
curl \
 -X POST https://<your_environment_name>-uat-api.canopyservicing.com/accounts/can_52322/line_items/loans \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"line_item_id":"0x1234","line_item_status":"VALID","original_amount_cents":200,"interest_policies":{"interest_percent":2.34,"is_limited_to_loan_duration":true},"effective_at":"2020-07-20T09:11:28+00:00","am_len":4,"description":"Personal LOC Draw","fee_policies":{"origination_fee_cents":2000,"origination_fee_percent":2.34,"is_origination_fee_lesser_value":false,"is_origination_fee_amortized":false},"merchant_data":{"name":"string","id":"string","mcc_code":"string","phone_number":"string"},"issuer_processor_metadata":{"lithic":{"last_four":"string"}},"external_fields":[{"key":"Globex Card Processing Account ID","value":"22445702-a389-431f-927d-07b8d0750787"}]}'
Request example
{
  "line_item_id": "0x1234",
  "line_item_status": "VALID",
  "original_amount_cents": 200,
  "interest_policies": {
    "interest_percent": 2.34,
    "is_limited_to_loan_duration": true
  },
  "effective_at": "2020-07-20T09:11:28+00:00",
  "am_len": 4,
  "description": "Personal LOC Draw",
  "fee_policies": {
    "origination_fee_cents": 2000,
    "origination_fee_percent": 2.34,
    "is_origination_fee_lesser_value": false,
    "is_origination_fee_amortized": false
  },
  "merchant_data": {
    "name": "string",
    "id": "string",
    "mcc_code": "string",
    "phone_number": "string"
  },
  "issuer_processor_metadata": {
    "lithic": {
      "last_four": "string"
    }
  },
  "external_fields": [
    {
      "key": "Globex Card Processing Account ID",
      "value": "22445702-a389-431f-927d-07b8d0750787"
    }
  ]
}
Response example (200)
{
  "account_id": 4,
  "line_item_id": 2,
  "effective_at": "2018-07-20T09:12:30+00:00",
  "created_at": "2018-06-20T09:12:30+00:00",
  "product_id": 1,
  "line_item_summary": {
    "original_amount_cents": 2484,
    "balance_cents": 3600,
    "principal_cents": 2400,
    "interest_balance_cents": 1100,
    "am_interest_balance_cents": 0,
    "deferred_interest_balance_cents": 200,
    "am_deferred_interest_balance_cents": 0,
    "total_interest_paid_to_date_cents": -16
  },
  "merchant_data": {
    "name": "string",
    "id": "string",
    "mcc_code": 42.0,
    "phone_number": "string"
  },
  "issuer_processor_details": {
    "lithic": {
      "last_four": 3324,
      "transaction_token": "33xd08bc-d100-488y-bb93-f8a1f081ff0e",
      "card_token": "c6cd08bc-c524-48f5-b64d-f79ec0810df4"
    }
  },
  "external_fields": [
    {
      "key": "Globex Card Processing Account ID",
      "value": "22445702-a389-431f-927d-07b8d0750787"
    }
  ],
  "line_item_overview": {
    "line_item_status": "VALID",
    "line_item_type": "LOAN",
    "description": "Loan against the account",
    "am_len": 4
  }
}