Set up customer profiles. You will need these profiles to store credit cards and use those credit cards for different payment types.
BASE URI
https://apigateway.payfirma.com/customer-service
Create a new customer profile using provided information
HTTPS POST
/customer
Example Request:
Example Response Body:
Get all the attributes of a specific customer profile by using their lookup_id.
HTTPS GET
/customer/{customer_lookup_id}
Example Request:
Example Response Body:
Requests a list of all customers according to the parameters you specify.
HTTPS GET
/customer{?limit,before,after,email_address,first_name,last_name,company,with_subscription}
Example Request:
Example Response Body:
Query all customers who subscribed to a given plan lookup Id
HTTPS GET
/customer/plan/{plan_lookup_id}/{?limit,before,after,email_address,first_name,last_name,company}
Example Request:
Example Response Body:
Change the attributes of a customer profile using their customer lookup_id.
HTTPS PUT
/customer/{customer_lookup_id}
Example Request:
Example Request Body:
Example Response Body:
Store a credit card with a customer profile and update the card object as needed.
BASE URI
https://apigateway.payfirma.com/customer-service
Store a new credit card to a customer profile.
HTTPS POST
/customer/{customer_lookup_id}/card
Example Request:
Example Request Body:
Example Response Body:
Update an existing credit card object.
HTTPS PATCH
/customer/{customer_lookup_id}/card/{card_lookup_id}
Example Request:
Example Request Body:
Example Response Body:
Remove a credit card from a customer’s profile.
HTTPS DELETE
/customer/{customer_lookup_id}/card/{card_lookup_id}
Example Request:
Example Response Body:
Use stored customer profiles and cards to set up subscription payments based off your recurring plans
BASE URI
https://apigateway.payfirma.com/customer-service
Subscribe a given customer to a plan
HTTPS POST
/customer/subscription
Example Request:
Example Request Body:
Example Response Body:
Update a subscription: Update the details of a subscription for a given customer lookup_id and a subscription lookup_id.
HTTPS PATCH
/customer/customerLookupId/subscription/subscriptionLookupId
Example Request:
Example Request Body:
Example Response Body:
Cancel a subscription: Cancel all future payments scheduled on a subscription plan by changing the status of the subscription
HTTPS PATCH
/customer/customerLookupId/subscription/subscriptionLookupId
Example Request:
Example Request Body:
Example Response Body:
Request Arguments
REQUIRED
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
The first name of the customer.
last_name
The customers last name.
company
Business name associated with customer.
bcc_emails
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
Customer’s telephone number.
address1
First line of the customer address.
address2
Second line of the customer address.
city
The city where the customer is.
province
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
A description field to record any general customer identifying information.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
URI Parameters
customer_lookup_id
A hashed version of the customer_id used to identify the customer in the customer service.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
URI Parameters
limit
The number of transactions to be displayed within each page.
before
The begginning of the page cursor. One can use this cursor with a query parameter to get the page before this page.
after
The end of the page cursor. One can use this cursor with an after query parameter to get the page after this page.
email_address
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
The first name of the customer.
last_name
The customers last name.
company
Business name associated with customer.
with_subscription
A boolean identity for whether customers have subscriptions.
Response Attributes
entities
array
The stored customer information that was associated with each transaction.
paging
object
Parameter to view multiple pages on large queries.
cursors
object
Set the boundaries for displayed results.
before
string
The begginning of the page cursor. One can use this cursor with a query parameter to get the page before this page.
after
string
The end of the page cursor. One can use this cursor with an after query parameter to get the page after this page.
URI Parameters
limit
The number of transactions to be displayed within each page.
before
The begginning of the page cursor. One can use this cursor with a query parameter to get the page before this page.
after
The end of the page cursor. One can use this cursor with an after query parameter to get the page after this page.
email_address
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
The first name of the customer.
last_name
The customers last name.
company
Business name associated with customer.
with_subscription
A boolean identity for whether customers have subscriptions.
Response Attributes
entities
array
The stored customer information that was associated with each transaction.
paging
object
Parameter to view multiple pages on large queries.
cursors
object
Set the boundaries for displayed results.
before
string
The begginning of the page cursor. One can use this cursor with a query parameter to get the page before this page.
after
string
The end of the page cursor. One can use this cursor with an after query parameter to get the page after this page.
URI Parameters
customer_lookup_id
REQUIRED
A hashed version of the customer_id used to identify the customer in the customer service.
Request Arguments
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
The first name of the customer.
last_name
The customers last name.
company
Business name associated with customer.
bcc_emails
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
Customer’s telephone number.
address1
First line of the customer address.
address2
Second line of the customer address.
city
The city where the customer is.
province
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
A description field to record any general customer identifying information.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
URI Parameters
customer_lookup_id
REQUIRED
A hashed version of the customer_id used to identify the customer in the customer service.
Request Arguments
card_expiry_month
REQUIRED
The double-digit month the card expires, e.g. for August, use 08.
card_expiry_year
REQUIRED
Expiry year - in double digits - of the associated credit card number, e.g. for 2017, use 17.
card_number
REQUIRED
The credit card number (16 digits for most card brands and 15 digits for American Express).
cvv2
REQUIRED
A credit card’s verification code, otherwise known as CVC or CVV; the three or four-digit number on the back of most major cards, and the four digit number found on the front of American Express cards. We strongly recommend that you utilize the cvv2 field to help protect against fraud and charge-backs.
currency
DEFAULT is true for first card and false for the rest.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
URI Parameters
customer_lookup_id
REQUIRED
A hashed version of the customer_id used to identify the customer in the customer service.
card_lookup_id
REQUIRED
Credit card Lookup ID from Customer Vault.
Request Arguments
is_default
DEFAULT is true for first card and false for the rest.
card_description
A description you can define for each card to help with card management and tracking.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
URI Parameters
customer_lookup_id
REQUIRED
A hashed version of the customer_id used to identify the customer in the customer service.
card_lookup_id
REQUIRED
Credit card Lookup ID from Customer Vault.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
Request Arguments
plan_lookup_id
REQUIRED
A hashed version of the plan_id used to identify the plan in the customer & plan service.
card_lookup_id
REQUIRED
Credit card Lookup ID from Customer Vault.
amount
Transaction amount, in dollars, e.g. 10.99 = 10 dollars and 99 cents.
start_date
REQUIRED
UNIX time representation of the start date for a subscription, represented in milliseconds. It should be in future.
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
bcc_emails
Additional email the receipt should be sent to for expense tracking or accounting needs.
description
An open field to record any information about the payment you want to appear in the customer’s receipt.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
Request Arguments
status
ACTIVE, CANCELED, PAUSED
card_lookup_id
Credit card Lookup ID from Customer Vault.
amount
Transaction amount, in dollars, e.g. 10.99 = 10 dollars and 99 cents.
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
bcc_emails
Additional email the receipt should be sent to for expense tracking or accounting needs.
description
An open field to record any information about the payment you want to appear in the customer’s receipt.
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.
Request Arguments
status
CANCELLED
Response Attributes
id
number
Internal ID representation.
lookup_id
string
A hashed identifier used to identify and access saved customers, cards, plans and subscriptions.
string
The email address associated with the customer that will receive the receipt, if that attribute is set to true.
first_name
string
The first name of the customer.
last_name
string
The customers last name.
company
string
Business name associated with customer.
bcc_emails
string
Additional email the receipt should be sent to for expense tracking or accounting needs.
telephone
string
Customer’s telephone number.
address1
string
First line of the customer address.
address2
string
Second line of the customer address.
city
string
The city where the customer is.
province
string
The province where Canadian customer reside. For US Customers, this would be the State of residence.
country
string
The country where the customer is. All country codes should be in ISO 3166 Alpha 2. For Canada, use CA. For United States, use US.
postal_code
string
The 6 digit address code for Canadian customer. US customers will use a 5-9 digit Zip Code.
custom_id
string
A description field to record any general customer identifying information.
cards
array
All the non-PCI card details stored with a customer profile.
subscriptions
array
All the subscription info for the subscriptions stored with a customer profile.