1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-29 21:57:16 +02:00
OpenIntegrations/docs/en/examples/CDEK/RegisterDeliveryAppointment.txt
Vitaly the Alpaca (bot) b5433562c2 Main build (Jenkins)
2024-12-15 15:57:20 +03:00

37 lines
2.1 KiB
Plaintext

Token = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJsb2NhdGlvbjphbGwiLCJvcmRlcjphbGwiLCJwYXltZW50OmFsbCJdLCJleHAiOjE3MzM3NTAwOTEsImF1dGhvcml0aWVzIjpbInNoYXJkLWlkOnJ1LTAxIiwiY2xpZW50LWNpdHk60J3QvtCy0L7RgdC40LHQuNGA0YHQuiwg0J3QvtCy0L7RgdC40LHQuNGA0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwiLCJhY2NvdW50LWxhbmc6cnVzIiwiY29udHJhY3Q60JjQnC3QoNCkLdCT0JvQky0yMiIsImFwaS12ZXJzaW9uOjEuMSIsImFjY291bnQtdXVpZDplOTI1YmQwZi0wNWE2LTRjNTYtYjczNy00Yjk5YzE0ZjY2OWEiLCJjbGllbnQtaWQtZWM1OmVkNzVlY2Y0LTMwZWQtNDE1My1hZmU5LWViODBiYjUxMmYyMiIsImNvbnRyYWN0LWlkOmRlNDJjYjcxLTZjOGMtNGNmNS04MjIyLWNmYjY2MDQ0ZThkZiIsImNsaWVudC1pZC1lYzQ6MTQzNDgyMzEiLCJzb2xpZC1hZGRyZ...";
OrderUUID = "d7b01683-651a-4805-a7d2-d2e60a60e0a0";
Day = 60 * 60 * 24;
CurrentDate = BegOfDay(OPI_Tools.GetCurrentDate());
DeliveryDate = CurrentDate + Day * 14;
While DayOfWeek(DeliveryDate) > 5 Do
DeliveryDate = DeliveryDate + Day;
EndDo;
Appointment = New Structure;
Appointment.Insert("cdek_number", "1106207236");
Appointment.Insert("order_uuid" , OrderUUID);
Appointment.Insert("date" , Format(DeliveryDate, "DF=yyyy-MM-dd"));
Appointment.Insert("time_from" , "10:00");
Appointment.Insert("time_to" , "17:00");
Appointment.Insert("comment" , "Group office");
DeliveryLocation = New Structure;
DeliveryLocation.Insert("code" , "270");
DeliveryLocation.Insert("fias_guid" , "0c5b2444-70a0-4932-980c-b4dc0d3f02b5");
DeliveryLocation.Insert("postal_code" , "109004");
DeliveryLocation.Insert("longitude" , 37.6204);
DeliveryLocation.Insert("latitude" , 55.754);
DeliveryLocation.Insert("country_code", "RU");
DeliveryLocation.Insert("region" , "Novosibirsk");
DeliveryLocation.Insert("sub_region" , "Novosibirsk");
DeliveryLocation.Insert("city" , "Novosibirsk");
DeliveryLocation.Insert("kladr_code" , "7700000000000");
DeliveryLocation.Insert("address" , "st. Bluchera, 33");
Appointment.Insert("to_location", DeliveryLocation);
Result = OPI_CDEK.RegisterDeliveryAppointment(Token, Appointment, True);