### Mondial Relay get_label example Source: https://github.com/akretion/roulier/blob/master/roulier/carriers/mondialrelay/README.md Example of using roulier.get with the 'mondialrelay' carrier and 'get_label' action. The payload includes authentication credentials, service configuration (product LCC, pickupMode REL), parcel weight, and address details. The response is printed to the console. ```python from roulier import roulier payload = { "auth": { "login": "BDTEST13", "password": "PrivateK", }, "service": { "product": "LCC", "pickupMode": "REL", "pickupSite": "AUTO", "pickupCountry": "FR", }, "parcels": [ { "weight": 3.4, } ], "to_address": { "name": "Hparfr", "street1": "35 b Rue Montgolfier", "city": "Villeurbanne", "country": "FR", "zip": "69100", "phone": "+33612121212", "lang": "FR", }, "from_address": { "name": "Akretion France", "street1": "35 b Rue Montgolfier", "city": "Villeurbanne", "country": "FR", "zip": "69100", "phone": "+33612121212", "lang": "FR", }, } response = roulier.get("mondialrelay", "get_label", payload) print(response) ``` -------------------------------- ### Send a parcel and get label with roulier.get() Source: https://github.com/akretion/roulier/blob/master/README.md Constructs a payload with authentication, service, parcel, and address details, then calls roulier.get('laposte_fr', 'get_label', payload) to retrieve a label and tracking number. The payload includes required fields like 'auth', 'service', 'parcels', 'to_address', and 'from_address'. Note the source contains missing commas after some string values in the address dictionaries. ```python from roulier import roulier payload= { "auth": { "login": "12345", "password": "password", }, "service": { "productCode": "COL" }, "parcels": [{ "weight": 3.4, }], "to_address": { "firstName": "Hparfr" "street1": "35 b Rue Montgolfier" "city": "Villeurbanne" "country": "FR", "zip": "69100" }, "from_address": { "fristName": "Akretion France" "street1": "35 b Rue Montgolfier" "city": "Villeurbanne" "country": "FR", "zip": "69100" }, } # first parameter is the carrier type. # second is the action and then the parameters needed by the action response = roulier.get('laposte_fr', 'get_label', payload) print(response) ``` -------------------------------- ### List supported carriers and actions with roulier.get_carriers_action_available() Source: https://github.com/akretion/roulier/blob/master/README.md Prints the available carriers and their supported actions by calling roulier.get_carriers_action_available(). Use this to discover which carriers and actions are supported by the library. ```python from roulier import roulier print(roulier.get_carriers_action_available()) ```