PUT: ADD PAYMENT

Type:PUT

Method:payment

Parameters: n/a

URL Example:https://www.bizstim.com/api/payment

Input Variables:
ELEMENT TYPE DESCRIPTION
client_id integer required if new client information not provided
revenue_amount float required *** IMPORTANT: this field must be in the format: 1052.45. Do NOT use commas or depict currencies. This number will be converted to pence if a token is provided ***
send_email integer required (0=no, 1=yes)
service_id integer optional (required if discount code is service specific OR a service package is purchased)
revenue_note string optional
discount string optional
token string optional (If you would like us to initiate a payment via Stripe for the customer use stripe.js tokenization process within the browser. Get a secure, one-time use token from Stripe and pass it on via this API endpoint. A more secure process would be to charge the customer's account via your website and the customers browser. ***Creating a token uses Stripe v2 that is deprecated***
qb_customer_id integer optional
timezone string optional
first_name string required if no client id present
last_name string required if no client id present
state string required if no client id present
country string required if no client id present
status string required if no client id present
city string optional
text_phone string optional
email string optional
address1 string optional
address2 string optional
zipcode string optional
p_phone string optional
s_phone string optional
password string optional
password2 string optional (confirm password)
username string optional (must be unique)
inactive_date string optional (YYYY-MM-DD)
notes string optional
mAvailf string optional (Monday Start Time - HH:MM)
mAvailt string optional (Monday End Time - HH:MM)
tAvailf string optional (Tuesday Start Time - HH:MM)
tAvailt string optional (Tuesday End Time - HH:MM)
wAvailf string optional (Wednesday Start Time - HH:MM)
wAvailt string optional (Wednesday End Time - HH:MM)
rAvailf string optional (Thursday Start Time - HH:MM)
rAvailt string optional (Thursday End Time - HH:MM)
fAvailf string optional (Friday Start Time - HH:MM)
fAvailt string optional (Friday End Time - HH:MM)
satAvailf string optional (Saturday Start Time - HH:MM)
satAvailt string optional (Saturday End Time - HH:MM)
sunAvailf string optional (Sunday Start Time - HH:MM)
sunAvailt string optional (Sunday End Time - HH:MM)

  • * For the timezone field use the Timezone get method and select an appropriate value from the TimeZone field.
  • * If the timezone is unrecognized or empty, America/New_York will be applied as default.
  • * When a service_id is present and the service is part of a group of tiered services (service package), a package payment will be recorded as long as the service has a group_num greater than 1 (the service is a lower cost service in a service package).

Response Example:
{
    "status": "success",
    "code": 12,
    "response": "Payment added successfully."
}

Element Properties:
ELEMENT TYPE DESCRIPTION
status string success or failure
code integer
0 failure: validation errors
1 failure: required fields missing
2 failure: client already exists
3 failure: passwords do not match
4 failure: username is not unique
5 failure: unable to create client
6 failure: client id not found
7 failure: discount errors
8 failure: payment error
9 failure: payment package error
10 failure: unknown service id
11 failure: Payment gateway errors
12 success
response string

Possible responses are:

  • An unordered list (ul) of validation errors
  • Client id or client information missing.
  • There is already a client with that name.
  • Passwords do not match.
  • That username is already taken.
  • Unable to create the client.
  • Client id could not be found.
  • Discount errors:
    • That discount code is not available.
    • That discount code is service restricted.
    • That discount code can only be used x time(s).
    • You may not apply a discount amount that results in a 0 or less than 0 payment amount.
    • That discount code is not available.
  • There was an error adding the payment.
  • The payment was recorded but there was an error adding the payment package.
  • The payment was recorded but the Service id could not be found.
  • Payment gateway errors:
    • Code 1: The account does not have Stripe credentials.
    • Code 2: Unable to charge card using Payment Intents API.
    • Code 3: Unable to charge card using Charge API.
  • Payment added successfully.