Order

POST {{host}}/api/partner/orders/condensed

Create an order from a previously given quote. You will still need to provide details of the order and details in the order will override those on the quote, when you have received an order response you can use the order id to process the payment in a later step.

Request

Details

Details are how you customize your product allowing you to select exactly what you need. We have a few different types of details each one will affect your product and its price.

deductible

Applies a deductible to the order, available in a few pre-defined values, 0, 100, 200, 250

        {
            "type": "deductible",
            "detail": "excess_fee",
            "amount": 100
        },

package

Applies the package of benefits you want on your order, to find out what is available check out the previous step Packages - Optional to see how these can be fetched. You are able to hardcode the alias part of this to allow you not to call our endpoint, the aliases are set when we create a package and should not change over the lifetime of the product. The productpackageid can either be the true integer id returned on the API or an alias as a string, keep in mind the id (integer) changes over time and the alias does not.

        {
            "type": "package",
            "product_package_id": "travel_medical_package"
        },

Flags

We have flags that can control certain settings on the order.

    "flags": {
        "disable_discounts_in_docs": true,
        "send_policy_emails": true,
        "generate_policy_document": true,
    }

disablediscountsin_docs

This hides the discount value for the customer, a use case for this is if you want to modify the price by a few percent it might be more confusing from a customer's perspective to show them that discount.

sendpolicyemails

In certain cases you might want to send your own policy email, we provide this flag that will stop our system from sending emails and instead leave that to you to handle, there are a few options on how to retrieve files based on webhook, speak to integration contact for more info.

generatepolicydocument

If you require to generate your own documents and send your own emails this option allows you to disable the policy file generation completely.

Discounts

The API enables you to apply commission discounts as required, granting you the flexibility to determine whether your orders should consider commission discounts or not (based on the affiliate_discount detail). It's noteworthy that the maximum discount allowable for your customers is pre-defined by Battleface's team according to partnership terms. Please keep in mind that the API will trigger an error if the discount surpasses the established limit. Additionally, the email sent to the customer will include discount details by default, but you can opt to disable this feature using the disable_discounts_in_docs order flag if desired.

        {
            "type": "affiliate_discount",
            "detail": "percentage",
            "value": "5"
        },

Response

Important Keys

KeyDescription
totalThis is the final value we charge the customer, important to use this in UI that are shown to customer
taxThis is the amount of tax included in the total, i.e if you take total - tax it will equal the premium
statusThe state of the order, it will be Approved if its been payed

Request Body

{"quote_id"=>"optional_quote_id", "currency_id"=>"USD", "sanction_search_id"=>0, "product_id"=>"12106ae7-05f3-4b57-8827-373f58242c6b", "start_at"=>"2023-12-01", "end_at"=>"2023-12-15", "deposit_at"=>"2023-10-01", "details"=>[{"product_package_id"=>"trip_interruption", "type"=>"package"}, {"product_package_id"=>"trip_cancellation_package", "type"=>"package"}, {"product_package_id"=>"cancel_for_any_reason", "type"=>"package"}, {"product_package_id"=>"rental_vehicle_damage", "type"=>"package"}, {"product_package_id"=>"pet_travel_package", "type"=>"package"}, {"product_package_id"=>"travel_medical_package", "type"=>"package"}, {"product_package_id"=>"baggage_package", "type"=>"package"}, {"product_package_id"=>"delay_package", "type"=>"package"}, {"product_package_id"=>"vacation_rental_damage", "type"=>"package"}, {"product_package_id"=>"vacation_rental_damage", "type"=>"reservations", "amount"=>3}, {"product_package_id"=>"vacation_rental_damage", "type"=>"limit", "detail"=>"benefit_limit", "for"=>"vacation_rental_damage", "value"=>"1000"}, {"product_package_id"=>"accidental_death_and_dismemberment", "type"=>"package"}, {"product_package_id"=>"accidental_death_and_dismemberment", "type"=>"limit", "detail"=>"benefit_limit", "for"=>"non_flight_accidental_death_and_dismemberment", "value"=>"100000"}], "applicants"=>[{"first_name"=>"First", "middle_name"=>"M", "last_name"=>"Last", "email"=>"test@battleface.com", "dob"=>"1996-01-01", "age_at_travel"=>27, "contact_number"=>"1234567890", "address"=>"123 Tester Street", "city"=>"Columbus", "post_code"=>"43201", "country_code"=>"US", "state_code"=>"OH", "is_main"=>true, "trip_cost"=>10000}], "destinations"=>[{"country_code"=>"US"}], "affiliate"=>{"id"=>1}}