Investor Payment Methods

Add payment methods to a party, these payment methods will be used to place orders and distributions

# Add payment method to individual party we created earlier
payment_method_creation_url = f"{base_url}/payment-methods"

headers = {
    "accept": "application/json",
    "caliber-api-key": caliber_api_key,
    "caliber-idempotency-key": str(uuid.uuid4()),
    "caliber-individual-id": party_id
}

payment_method_creation_obj =   {
        "party_id": party_id,
        "name": "John Doe Checking",
        "bank_name": "JP Morgan Chase",
        "account_type": "checking",
        "account_number": "00011345678",
        "bank_identification_codes": {
          "routing_number": "071000013",
          "iban": "",
          "swift_bic": "",
          "sort_code": ""
        },
        "payment_type": "wire",
        "account_holder_address_id": address_id
}

payment_method_response = requests.post(payment_method_creation_url, headers=headers, json = payment_method_creation_obj)
payment_method_id = payment_method_response.json()['id']

print(f"Add payment to the individual we created earlier:\n{json.dumps(payment_method_response.json(), indent = 2)}")

# To retrieve all payment methods on a party pass party_id query param
# Additionally you can query payment methods by account_id, more on this later
payment_method_retrieve_url = f"{base_url}/payment-methods?party_id={party_id}"

headers = {
    "accept": "application/json",
    "caliber-api-key": caliber_api_key,
    "caliber-individual-id": party_id
}
payment_method_retrieve_response = requests.get(payment_method_retrieve_url, headers=headers)

print(f"Payment methods for the individual party:\n{json.dumps(payment_method_retrieve_response.json(), indent = 2)}")
Add payment to the individual we created earlier:
{
  "id": "c21eb16e-f886-485f-b2e3-878c78201988",
  "party_id": "783cb646-87bb-4866-a0e3-99aeb1cedf6e",
  "account_type": "checking",
  "address": {
    "id": "c227a904-e93f-4ea3-bea6-5845b61ca3b1",
    "address_type": "legal",
    "address_line_1": "112 NE 2nd Ave",
    "address_line_2": null,
    "address_line_3": null,
    "city": "Miami",
    "region": "FL",
    "postal_code": "33132",
    "country": "US",
    "created_at": "2023-06-22T16:03:03.666385Z",
    "updated_at": "2023-06-22T16:03:03.667096Z",
    "metadata": {}
  },
  "name": "John Doe Checking",
  "bank_name": "JP Morgan Chase",
  "account_number": "00011345678",
  "bank_identification_codes": {
    "iban": "",
    "swift_bic": "",
    "routing_number": "071000013",
    "sort_code": ""
  },
  "payment_type": "wire",
  "metadata": {}
}
Payment methods for the individual party:
{
  "limit": 20,
  "offset": 0,
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "1c22cbc9-cc47-481c-8f2e-006117ab7368",
      "party_id": "783cb646-87bb-4866-a0e3-99aeb1cedf6e",
      "account_type": "checking",
      "address": {
        "id": "c227a904-e93f-4ea3-bea6-5845b61ca3b1",
        "address_type": "legal",
        "address_line_1": "112 NE 2nd Ave",
        "address_line_2": null,
        "address_line_3": null,
        "city": "Miami",
        "region": "FL",
        "postal_code": "33132",
        "country": "US",
        "created_at": "2023-06-22T16:03:03.666385Z",
        "updated_at": "2023-06-22T16:03:03.667096Z",
        "metadata": {}
      },
      "name": "John Doe Checking",
      "bank_name": "JP Morgan Chase",
      "account_number": "00011345678",
      "bank_identification_codes": {
        "iban": "",
        "swift_bic": "",
        "routing_number": "071000013",
        "sort_code": ""
      },
      "payment_type": "wire",
      "metadata": {}
    },
    {
      "id": "c21eb16e-f886-485f-b2e3-878c78201988",
      "party_id": "783cb646-87bb-4866-a0e3-99aeb1cedf6e",
      "account_type": "checking",
      "address": {
        "id": "c227a904-e93f-4ea3-bea6-5845b61ca3b1",
        "address_type": "legal",
        "address_line_1": "112 NE 2nd Ave",
        "address_line_2": null,
        "address_line_3": null,
        "city": "Miami",
        "region": "FL",
        "postal_code": "33132",
        "country": "US",
        "created_at": "2023-06-22T16:03:03.666385Z",
        "updated_at": "2023-06-22T16:03:03.667096Z",
        "metadata": {}
      },
      "name": "John Doe Checking",
      "bank_name": "JP Morgan Chase",
      "account_number": "00011345678",
      "bank_identification_codes": {
        "iban": "",
        "swift_bic": "",
        "routing_number": "071000013",
        "sort_code": ""
      },
      "payment_type": "wire",
      "metadata": {}
    }
  ]
}