Purchase

Since you’ve performed a new Quote and have chosen a Quote Option, you can request a purchase through the URL below, informing the selected quote_option_id received in the previous calls (see Receiving quote responses above). This is also an asynchronous process, so

Purchasing insurance

To perform a purchase you must inform mainly the selected quote_option_id and finally the purchasing info like credit card number and cardholder details. The coverage letter URL in the response will be null until the process is completely terminated with status finished. It will be available for querying in the next call. (See Showing purchases)

POST https://insurance-api.paycertify.com/api/purchases/

Parameter Type Presence Description Example
quote_option_id string required One of the quote options retured when a quote is created (see above) 2b0e8eb8-be4e-4c8e-a3d2-b2c6e95be608
name string required Cardholder name Jim Carter
address string required Street address 2378 W 12th St
city string required City name Los Angeles
country string required Country code (see ISO 3166-1 alpha-3) USA
state string required 2-digit state name CA
phone_number string required Phone number +1-202-555-0178
postal_code string required Postal code 90006
email string required Email address [email protected]
card_number string required Card Number 370000000000002
card_cvv string required Card CVV Number 9000
card_expiry_month string required Card expiration month (2-digit) 10
card_expiry_year string required Card expiration year (2-digit) 20
agreement_disclaimer boolean required The consumer’s agreement with the disclaimer for this purchase. This field must be filled with true to result in a successful response. true
Field Type Description Example
id uuid Purchase ID bd8f819e-4951-441f-83bb-56f9a88648e0
created_at timestamp Created at 2018-04-12T21:07:59.508Z
updated_at timestamp Updated at 2018-04-12T21:07:59.508Z
status string The purchase status (waiting, processing, purchased, invalid, error). This process is asynchronous, which means that immediately after this request the status returned will be ‘processing’. You can fetch the purchase details further by using the endpoint above. When the process finishes, this status shall be changed to ‘purchased’ if all data is correct. processing
quote_option_id uuid The quote options selected whento create the purchase. 2b0e8eb8-be4e-4c8e-a3d2-b2c6e95be608
coverage_letter_url string The coverage letter URL. This will be null unless the status is ‘purchased’. null
curl --request POST \
  --url https://insurance-api.paycertify.com/api/purchases \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'content-type: multipart/form-data;' \
  --form 'name=Jim Carter' \
  --form 'address=2378 W 12th St' \
  --form 'city=Los Gatos' \
  --form 'country=USA' \
  --form 'state=CA' \
  --form 'phone_number=+1-202-555-0178' \
  --form 'postal_code=90006' \
  --form '[email protected]' \
  --form 'card_number=370000000000002' \
  --form 'card_cvv=9000' \
  --form 'card_expiry_month=10' \
  --form 'card_expiry_year=20' \
  --form 'quote_option_id=ece2ff5d-3c2a-4429-a1fb-571cb946a8d1'


Responds with:

{
  "purchase": {
    "id": "bd8f819e-4951-441f-83bb-56f9a88648e0",
    "created_at": "2018-04-12T21:07:59.508Z",
    "updated_at": "2018-04-12T21:07:59.508Z",
    "status": "processing",
    "quote_option_id": "ece2ff5d-3c2a-4429-a1fb-571cb946a8d1",
    "coverage_letter_url": null
  }
}