const request = require('request');
const options = {
method: 'POST',
url: 'https://api.betterez.com/sales/cart',
headers: {
authorization: 'Bearer {{jwtToken}}',
'Content-Type': 'application/json;charset=UTF-8',
Accept: 'application/json, text/plain, */*',
'x-api-key': '{{x-api-key}}'
},
body: '{"operationId": "{{uuid.v4}}","channel": "{{use-proper-channel-here}}","ignoreCutoffs": false,"ignoreOmitByAvailability": true,"providerId": "{{providerID}}","items": {"reservation": [{"channel": "backoffice","productId": "{{productId}}","fromId": "{{fromId}}","from": {"_id": "{{fromId}}","name": "{{origin-station-name}}","province": "{{province}}"},"toId": "{{toId}}","to": {"_id": "{{toId}}","name": "{{destination-station-name}}","province": "{{province}}"},"selectedTrips": {"departureTripId": "{{trip-id}}","returnTripId": null},"roundTrip": false,"dateFrom": "{{departure-date}}","promo": null,"manualFees": [],"passengers": [{"firstName": "{{first-name}}","lastName": "{{last-name}}","email": "{{email}}","comments": "","fare": "{{fare-name}}","fareId": "{{fareId}}","ssrs": [],"seats": [{"tripId": "{{tripId}}","seatMapId": "{{seatmapId-if-needed}}","sectionId": "{{section-id-if-needed}}","rowLabel": "{{row}}","seatNumber": "{{seat-number}}","seatId": "{{seatId}}","scheduleId": "{{scheduleId}}","sectionName": "{{section-name}}","origin": "{{origin-station-name}}"}],"syncEntryId": "d1dc3278-6380-4eff-a025-f0b2a5af660c","redeemableItemId": "{{redeemableItem-ID}}","fareClassIds": {"outbound": "{{fare-class}}"}}]}]},"currency": {"isocode": "USD","symbol": "$","buy": 1,"sell": 1},"language": "en"}}'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});