# Shippings

## Retrieve shipping options for a data source

> Returns a list of active shipping options available for the specified\
> data source. Only shipping options that are currently active and\
> associated with the given data source are returned.\
> \
> If the data source does not exist or has no active shipping options\
> associated with it, this endpoint returns an empty array \`\[]\` rather\
> than an error response.\
> \
> This endpoint is publicly accessible and does not require authentication.\
> Results are cached for optimal performance.<br>

```json
{"openapi":"3.0.0","info":{"title":"Shippings API","version":"1.0.0"},"servers":[{"description":"Server base URL for shipping operations","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce server URL"}}}],"paths":{"/shippings/data-source-shipping-options/{data_source_id}":{"get":{"summary":"Retrieve shipping options for a data source","description":"Returns a list of active shipping options available for the specified\ndata source. Only shipping options that are currently active and\nassociated with the given data source are returned.\n\nIf the data source does not exist or has no active shipping options\nassociated with it, this endpoint returns an empty array `[]` rather\nthan an error response.\n\nThis endpoint is publicly accessible and does not require authentication.\nResults are cached for optimal performance.\n","operationId":"getDataSourceShippingOptions","tags":["Shippings"],"parameters":[{"name":"data_source_id","in":"path","required":true,"description":"Unique identifier of the data source","schema":{"type":"integer"}}],"responses":{"200":{"description":"Successfully retrieved shipping options. Returns an empty array if the data source does not exist or has no active shipping options.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataSourceShippingOptionResponse"}}}}}}}}},"components":{"schemas":{"DataSourceShippingOptionResponse":{"type":"object","description":"Shipping option available for a specific data source","properties":{"pk":{"type":"integer","description":"Unique identifier for the shipping option"},"name":{"type":"string","description":"Display name of the shipping option"},"data_source":{"type":"integer","description":"Unique identifier of the associated data source"},"description":{"type":"string","nullable":true,"description":"Optional description providing additional details about the shipping option"}}}}}}
```

## Retrieve available appointment dates for easy return

> Returns a list of available appointment dates and time slots for\
> scheduling an easy return pickup. The response includes dates within\
> the specified range along with available hour ranges for each date.\
> \
> \*\*Dynamic Configuration Requirement:\*\*\
> \
> This endpoint requires authentication and is only available when the\
> \`EASY\_RETURN\_PACKAGE\_STRATEGY\` dynamic setting is configured to allow\
> user selection. The setting must be set to:\
> \`omnishop.orders.strategies.SelectionBasedEasyReturnPackageStrategy\`\
> \
> This is a dynamic configuration that can be updated through the\
> administration interface and takes effect immediately without requiring\
> code deployment. When the strategy is set to rule-based mode, this\
> endpoint will return a 400 Bad Request response.\
> \
> \*\*Available Strategy Options:\*\*\
> \- \*\*Rule-based\*\* (default): Shipping company is chosen automatically\
> &#x20; by product rules. This endpoint is not available in this mode.\
> \- \*\*Selection-based\*\*: User chooses shipping company. This endpoint is\
> &#x20; available in this mode.\
> \
> \*\*Request Requirements:\*\*\
> \
> The pickup address must belong to the authenticated user and must be\
> an active customer address. The start date must be today or later,\
> and the end date must be after the start date.\
> \
> Rate limiting applies to prevent abuse of this endpoint.<br>

```json
{"openapi":"3.0.0","info":{"title":"Shippings API","version":"1.0.0"},"servers":[{"description":"Server base URL for shipping operations","url":"https://{commerce_url}","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Commerce server URL"}}}],"paths":{"/shippings/easy-return-appointment-dates":{"post":{"summary":"Retrieve available appointment dates for easy return","description":"Returns a list of available appointment dates and time slots for\nscheduling an easy return pickup. The response includes dates within\nthe specified range along with available hour ranges for each date.\n\n**Dynamic Configuration Requirement:**\n\nThis endpoint requires authentication and is only available when the\n`EASY_RETURN_PACKAGE_STRATEGY` dynamic setting is configured to allow\nuser selection. The setting must be set to:\n`omnishop.orders.strategies.SelectionBasedEasyReturnPackageStrategy`\n\nThis is a dynamic configuration that can be updated through the\nadministration interface and takes effect immediately without requiring\ncode deployment. When the strategy is set to rule-based mode, this\nendpoint will return a 400 Bad Request response.\n\n**Available Strategy Options:**\n- **Rule-based** (default): Shipping company is chosen automatically\n  by product rules. This endpoint is not available in this mode.\n- **Selection-based**: User chooses shipping company. This endpoint is\n  available in this mode.\n\n**Request Requirements:**\n\nThe pickup address must belong to the authenticated user and must be\nan active customer address. The start date must be today or later,\nand the end date must be after the start date.\n\nRate limiting applies to prevent abuse of this endpoint.\n","operationId":"getEasyReturnAppointmentDates","tags":["Shippings"],"parameters":[{"$ref":"#/components/parameters/CookieHeader"},{"$ref":"#/components/parameters/CSRFTokenHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EasyReturnAppointmentDateRequest"}}}},"responses":{"200":{"description":"Successfully retrieved appointment dates","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppointmentDateResponse"}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"parameters":{"CookieHeader":{"name":"Cookie","in":"header","required":true,"description":"Session cookie header (e.g. `sessionid=abc123` or `osessionid=abc123`)","schema":{"type":"string"}},"CSRFTokenHeader":{"name":"X-CSRFToken","in":"header","required":true,"description":"CSRF token for request validation","schema":{"type":"string"}}},"schemas":{"EasyReturnAppointmentDateRequest":{"type":"object","description":"Request payload for retrieving available appointment dates","required":["shipping_company","pickup_address","start_datetime","end_datetime"],"properties":{"shipping_company":{"type":"integer","description":"Unique identifier of the shipping company to use for the return.\nMust be an active easy return shipping company configured for\nuser-selected appointments.\n"},"pickup_address":{"type":"integer","description":"Unique identifier of the pickup address. Must be an active customer\naddress belonging to the authenticated user.\n"},"start_datetime":{"type":"string","format":"date","description":"Start date of the date range to search for available appointments.\nMust be today or a future date.\n"},"end_datetime":{"type":"string","format":"date","description":"End date of the date range to search for available appointments.\nMust be after the start date and must be today or a future date.\n"}}},"AppointmentDateResponse":{"type":"object","description":"Available appointment date with time slots","properties":{"date":{"type":"string","format":"date","description":"The appointment date"},"hour_ranges":{"type":"array","description":"Available time slots for this date","items":{"$ref":"#/components/schemas/HourRange"}}}},"HourRange":{"type":"object","description":"Time range available for appointment scheduling","properties":{"start":{"type":"string","description":"Start time in HH:MM format (24-hour)"},"end":{"type":"string","description":"End time in HH:MM format (24-hour)"}}},"ValidationError":{"type":"object","description":"Validation error response","properties":{"detail":{"type":"string","description":"General validation error message"}},"additionalProperties":{"type":"array","items":{"type":"string"},"description":"Field-specific validation errors"}},"Error":{"type":"object","description":"Standard error response","properties":{"detail":{"type":"string","description":"Error message describing what went wrong"}}}}}}
```
