Order With Payment
POST {{host_gateway}}/api/partner/orders/with-payment
This endpoint facilitates the creation of an order while simultaneously passing credit card data to charge the order being created. It is specifically designed for customers who prefer to submit all necessary information in a single call, streamlining the process.
Notes:
- The order created through this endpoint does not transition to the 'approved' state until the payment processor successfully handles the payment.
Request Body
{"order"=>{"total"=>673.99, "quote_id"=>"quote-id", "currency_id"=>"USD", "sanction_search_id"=>0, "product_id"=>"12106ae7-05f3-4b57-8827-373f58242c6b", "start_at"=>"{{start_date}}", "end_at"=>"{{end_date}}", "deposit_at"=>"{{current_date}}", "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"=>"1500"}, {"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"=>"John", "middle_name"=>"Doe", "last_name"=>"Johnson", "email"=>"test@battleface.com", "dob"=>"1990-01-01", "age_at_travel"=>28, "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"}]}, "payment"=>{"type"=>"charge", "detail"=>{"card_exp_month"=>"12", "card_exp_year"=>"2024", "card_number"=>"4242424242424242", "card_cvc"=>"1234"}}}
RESPONSES
status: Created
{"data":{"order":{"schema_version":1,"site_id":1,"quote_id":"quote-id","order_number":"1-MAY93E2-A6DB1DB06780","client_referral_code":"","client_id":48702,"status":"Pending","premium":673.99,"total":673.99,"currency_id":"USD","status_updated_at":"2024-05-06T12:10:58.039000Z","ordered_at":"2024-05-06T12:10:57.571000Z","items":[{"id":"7b3e4c9f-5631-4706-a139-f3266cda3b03","product_id":1042,"program_id":23,"product_uuid":"12106ae7-05f3-4b57-8827-373f58242c6b","product_name":"Discovery","sanction_search_id":"0","product_major_id":44,"product_minor_id":1714,"policy_file_id":null,"policy_number":"BFBF DIS0506240008","start_at":"2024-05-21","end_at":"2024-06-04","deposit_at":"2024-05-06","details":[{"id":"45b5fd0b-c3f4-47e5-9e16-5282f380a504","type":"package","detail":"Trip Interruption","amount":23.67,"product_package_id":14969},{"id":"9399c920-fcc9-4cdc-adb3-e5e1cf67dded","type":"package","detail":"Trip Cancellation","amount":87.82,"product_package_id":14970},{"id":"f4006579-e86b-48ff-a3f8-ce71212dc7fc","type":"package","detail":"Cancel For Any Reason","amount":113.44,"product_package_id":14971},{"id":"e20e2f5a-f325-449b-9e9d-33828e679692","type":"package","detail":"Rental Vehicle Damage","amount":180.6,"product_package_id":14972},{"id":"59377abb-3df1-4a66-b08f-88dd8eed595d","type":"package","detail":"Pet Travel Package","amount":11.01,"product_package_id":14974},{"id":"228dc629-2d95-487b-927f-c14d7b6725ba","type":"package","detail":"Travel Medical Package","amount":21.61,"product_package_id":14975},{"id":"764d7990-2c70-45a4-a0ef-1659dae1a268","type":"package","detail":"Baggage Package","amount":18.05,"product_package_id":14976},{"id":"2e0e43ea-94d8-4509-88b0-96b44fda7446","type":"package","detail":"Delay Package","amount":17.24,"product_package_id":14977},{"id":"62e73da5-0c29-4540-81fc-47a8a3350744","type":"package","detail":"Vacation Rental Damage Package","amount":57.5,"product_package_id":14973},{"id":"6d27bafb-ca05-48b3-a428-fa47ccdc8a9a","type":"reservations","amount":3,"product_package_id":14973},{"id":"e30febca-0a0c-45da-a29d-9f5def4b0958","type":"limit","detail":"benefit_limit","for":"vacation_rental_damage","value":"1500","product_package_id":14973},{"id":"ddb27bd1-2570-41c9-8a87-16db8d01dfa9","type":"package","detail":"Accidental Death and Dismemberment Package","amount":28.05,"product_package_id":14978},{"id":"1ae4359d-2d10-42c1-8c6f-602bb141119b","type":"limit","detail":"benefit_limit","for":"non_flight_accidental_death_and_dismemberment","value":"100000","product_package_id":14978},{"id":"5fb1c6a7-e83f-4dc5-a16b-a3ffd50f4c23","type":"trip_cost","amount":10000},{"id":"2e12fae8-7c77-480b-8922-bd849708c701","type":"minimum","detail":"package","for":"package","amount":0,"value":"0","product_package_id":14978},{"id":"fff6cdc7-8d51-4c8a-b49c-544dcede65a9","type":"premium","detail":"Policy premium","amount":673.99},{"id":"d016b112-79a1-45d3-8f30-ff5d463fa2aa","type":"total","detail":"Policy total","amount":673.99}],"insured":{"first_name":"John","middle_name":"Doe","last_name":"Johnson","dob":"1990-01-01"},"is_main":true,"order":{"total":673.99,"quote_id":"quote-id","currency_id":"USD","site_id":1,"ordered_at":"2024-05-06T12:10:57.571000Z","applicant":{"first_name":"John","middle_name":"Doe","last_name":"Johnson","email":"test@battleface.com","dob":"1990-01-01","age_at_travel":28,"contact_number":"1234567890","address":"123 Tester Street","city":"Columbus","post_code":"43201","country_code":"US","state_code":"OH","ip_address":"172.31.40.219"},"flags":{"send_policy_emails":true,"generate_policy_document":true,"trigger_sanction_search":true},"order_number":"1-MAY93E2-A6DB1DB06780","premium":673.99,"fees":0,"tax":0,"refund_amount":0,"is_refunded":false,"tax_rate":0,"schema_version":1,"document_version":1,"status":"Pending","status_updated_at":"2024-05-06T12:10:58.039000Z","client_id":48702,"client_referral_code":"","referral_code":null,"updated_at":"2024-05-06T12:10:59.374000Z","created_at":"2024-05-06T12:10:59.374000Z","_id":"6638c8d38133d1a93c07da39","meta":null,"details":[]},"meta":null,"destinations":[{"country_code":"US","country_name":"United States of America"}]}],"applicant":{"first_name":"John","middle_name":"Doe","last_name":"Johnson","dob":"1990-01-01","age_at_travel":28,"email":"test@battleface.com","contact_number":"1234567890","address":"123 Tester Street","city":"Columbus","post_code":"43201","country_code":"US","state_code":"OH","ip_address":"172.31.40.219"},"affiliate":{"id":1,"commission_amount":0,"commission_percentage":0,"contact_email":"jchapelle@battleface.com"},"details":[]},"payment":{"type":"charge","detail":{"id":"ch_3PDQNkDSrWezmkkZ0JhieKqv","merchantToken":"285909f2b02007c65bf44f9e0759c72b","customerToken":"94f3991265438ba5e3ac1f12955c9f9e","name":"Stripe","status":"Approved"}}}}