Jetpay Developer Guide
Manage payment methods
Create a contact
8 min
every payment in jetpay starts with a contact creating a contact is a foundational part of using the platform it’s how you organize your customers and associate their payment methods, making all subsequent flows possible prerequisites docid zgmim7qkrraox9jjaqrl flow adding a contact is done via a single call to the https //extapi jetpay baselinepayments com/docs#tag/contacts (v0)/operation/create contact contact put this will respond back with the new contact information including it's uuid sequencediagram participant partner as platform participant api as jetpay partner >>+api create new contact note right of api put /contact api >> partner r contact created note right of api 200 ok implementation details create a contact endpoint put /contact https //extapi jetpay baselinepayments com/docs#tag/contacts (v0)/operation/create contact contact put curl https //extapi demo jetpay baselinepayments com/contact \\ x put \\ h "authorization bearer \<your api token>" \\ h "content type application/json" \\ d '{ "email" "johnsmith\@mail com", "name" "john smith", "tags" \[], "language" "en" }'import requests url = "https //extapi demo jetpay baselinepayments com/contact" headers = { "authorization" "bearer \<your api token>", "content type" "application/json" } payload = { "email" "johnsmith\@mail com", "name" "john smith", "tags" \[], "language" "en" } response = requests put(url, json=payload, headers=headers) print("status code ", response status code) print("response body ", response text)const url = "https //extapi demo jetpay baselinepayments com/contact"; const payload = { email "johnsmith\@mail com", name "john smith", tags \[], language "en" }; fetch(url, { method "put", headers { "authorization" "bearer \<your api token>", "content type" "application/json" }, body json stringify(payload) }) then(response => { console log("status code ", response status); return response text(); }) then(data => { console log("response body ", data); }) catch(error => { console error("error ", error); }); the tags field is for you to use to help you sort your contacts into certain categories the default tags that jetpay supports are customer and supplier , however, you can create any custom tag for example, you can use a tag to specify what region your contact is created for, like north america the language field determines what language we will send communication emails to the customer in for most api integrations, you will likely want emails disabled, and handle your own communications with customers the options are en for english or fr for french if no language is specified, the default value will be en handle the response if a contact is successfully created, a response will be returned with an http status code of 200, and a response body of { "identifier" "contact 123", "email" "johnsmith\@mail com", "name" "john smith", "tags" \[], "contact type" "customer", "language" "en" } the default contact type is customer it is only if you specify the supplier tag in the tags list that the type will be set to supplier functionally, contact type will not affect api behaviour common errors if you try to create a contact with the same email as an existing contact, we will return an http status code of 409, and a response body of {"message" "a contact with the same email address has already been created "}