fattmerchant.controllers.customers.CustomersController(request)¶Class to interface with the customer resource in the Core API
create(payload)¶Creates a new customer for a merchant through the API
| Parameters: | payload (dict) – A dictionary with all data necessary to create a customer Note firstname, lastname, company, and email are required {
"firstname": "John",
"lastname": "Smith",
"company": "ABC INC",
"email": "daniel@fattmerchant.com",
"files": [],
"phone": "1234567898",
"merchant_id": "12345678",
"address_1": "123 Rite Way",
"address_2": "Unit 12",
"address_city": "Orlando",
"address_state": "FL",
"address_zip": "32801",
"address_country": "USA",
"reference": "",
"cc_emails": [],
"cc_sms": [],
"notes": "",
"options": {},
"allow_invoice_credit_card_payments": true
}
|
|---|---|
| Returns: | A single customer object |
| Return type: | Customer |
| Raises: | InvalidRequestDataException – Raised if firstname, lastname, company, and email are not provided |
list()¶Gets a list of customers from the API
| Param: | None |
|---|---|
| Returns: | A list of customer objects |
| Return type: | Customer |
get(id=None)¶Gets a single customer’s details from the API
| Parameters: | id (string) – A customer ID |
|---|---|
| Returns: | A single customer object |
| Return type: | Customer |
| Raises: | InvalidRequestDataException – Raised if id is not provided |
payment_methods(id=None)¶Gets a list of payment methods for a customer from the API
| Parameters: | id (string) – A customer’s ID |
|---|---|
| Returns: | A list of payment method objects |
| Return type: | Payment Method |
| Raises: | InvalidRequestDataException – Raised if id is not provided |