LogoLogo
  • Welcome to Akinon Documentation
  • Products
    • ACC
    • Omnitron
    • Commerce
    • Order Management System (OMS)
    • Instore
    • Integrator
    • Marketplace Dashboard (MPD)
    • Project Zero (PZ)
    • Seller Center
    • Akifast
    • App Maker
  • API Reference
    • Welcome to Akinon API Reference
  • Omnitron
    • Getting Started
    • Integration
      • Product
        • Product
        • Pre-Product
        • Attribute
        • Attribute Value
        • Attribute Set
        • Product Image
      • Price
        • Price List
        • Product Price
        • Currency Unit Table
      • Stock
        • Stock List
        • Product Stock
      • Order
        • Get Orders
        • Search Order
        • Get Order Detail by Order Number
        • Get Order Item Detail
        • Orders ID Detail Integration
        • Orders Waiting to Send to ERP
        • Update Order and Order Item
        • Stock Reservation Release
        • Order Cancellation
        • Cancellation & Refund Pending Orders
        • Order Discount Items
        • Order Status Codes & Cancellation Statuses
      • Migration
        • Getting Started
        • User Migration
        • Address Migration
        • Old Order Migration
        • Old Order Item Migration
        • View Migration Progress
        • Currency Options
    • PIM
      • Attributes & Sets
      • Mapping
      • Localization
      • Media
    • Catalogue
      • Introduction
      • Price List
      • Stock List
      • Catalogue Item
      • Category Trees
      • Product Collection
      • Product Sorting
    • Channels
      • Introduction
      • Payments
      • Customers
    • Order
      • Getting Started
      • Fulfillment
      • Cancellations & Refunds
    • Retail Stores
      • Retail Stores
    • User Management
      • Roles & Permissions
      • Add & Remove
    • Whippy Ware
      • Introduction
      • Stock
      • Stock Lists
      • Stock List Rules
      • Stock Providers
      • Stock Locations
  • Omnitron OpenAPIs
    • Without Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Content Types
      • Mappings
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • SalesChannelRetailStore
      • IntegrationActions
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelCategoryNodes
      • SalesChannelDistricts
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelOrders
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProduct
      • SalesChannelAttributeSchemas
      • SalesChannelProductCategories
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelCountries
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
    • With Server
      • Customers
      • Reporting
      • Deleted Items
      • Pos
      • AttributeValues
      • Attribute Values
      • Providers
      • LDAPProviders
      • Healthcheck
      • LoyaltyTransactions
      • Policies
      • Exports
      • Dashboard
      • AuthTOTP
      • Price Lists
      • ProductPrices
      • Districts
      • Cities
      • Countries
      • Townships
      • PrometheusMetrics
      • Language
      • Mappings
      • Content Types
      • Applications
      • ApplicationPermissions
      • Error Reports
      • MailTemplates
      • UploadLogo
      • SalesChannelMarketPlaceAttributeSetConfig
      • SalesChannelCancellationRequestImage
      • SalesChannelCities
      • SalesChannelCancellationReasons
      • SalesChannelCargoCompany
      • SalesChannelProductImage
      • SalesChannelAttributeConfig
      • SalesChannelAttributeValueConfig
      • SalesChannelTownships
      • SalesChannelCustomers
      • SalesChannelFailedIntegrations
      • SalesChannelGetStockList
      • IntegrationActions
      • SalesChannelRetailStore
      • SalesChannelOrderShippingInfo
      • SalesChannelBatchRequests
      • SalesChannelAddresses
      • SalesChannelMarketPlaceAttributeSet
      • SalesChannelErrorReports
      • SalesChannelDistricts
      • SalesChannelCategoryNodes
      • SalesChannelProductStock
      • SalesChannelExtraProductStock
      • SalesChannelCountries
      • SalesChannelOrders
      • SalesChannelProduct
      • SalesChannelCancellationPlans
      • SalesChannelExtraProductPrices
      • SalesChannelProductCategories
      • SalesChannelAttributeSchemas
      • SalesChannelCancellationRequests
      • SalesChannelMarketPlaceAttributeValue
      • SalesChannelMappedProduct
      • SalesChannelMarketPlaceAttribute
      • SalesChannelOrderItem
      • SalesChannelProductPrice
      • SalesChannelCreateOrder
      • GetPriceList
      • SalesChannelGetPriceList
      • SalesChannelCategoryTree
  • Commerce
    • Users
      • Getting Started
      • User Management & Authentication
      • Password & OTP Operations
      • User Profile & Segment Management
      • User Payment & Card Management
      • User Orders & Cancellations
      • Anonymous User Orders & Cancellations
      • User Support & Conversation
      • Captcha Validation
      • Currency & Akifast Operations
    • Checkout
      • Payment Related
      • Payment Strategy Related
      • Shipping Related
      • Independent Pages
    • Product
    • User Collections
    • Basket
    • Discount
    • Autocomplete
    • Breadcrumb
    • Pretty URLs
    • Menu
    • Widgets
    • Loyalty Accounts
    • Address Migration
    • Index Configuration
    • Favourite Products
    • User Address
    • Data Warehouse
    • Introduction
      • Filtering Parameters
    • Data Warehouse
    • Default
  • OMS
    • Package Services
    • Package Item Services
    • Package Denial Reason Services
    • Order Services
    • Order Item Services
    • Transfer Order Services
    • Transfer Item Services
    • Channel Services
    • Cancellation Plan Services
    • Cancellation Reason Services
    • Address Setup Services
    • City Services
    • District Services
    • Township Services
    • Stock Location Address Services
    • Webhook Setup Services
    • Webhook Event Services
    • Omnitron Order Webhooks
    • Undelivered Webhook Event Services
    • Inventory Discrepancy Services
    • OMS Setup Services
    • UI Settings Services
    • OMS Audit Events Service
    • Customer Address Services
    • Application Settings Services
    • Content Type Services
    • Customer Services
    • Channel Setup Services
    • Demo Data Service
    • Order Execution Plan Services
    • Invoice Services
    • Localization Services
    • Action Log Services
    • Order Log Services
    • Celery Metrics Service
    • Stock Location Services
    • Stock Location Address Services
    • Stock Location Sender Address Services
    • Stock Location Sender Address Setup Services
    • Cargo Company Condition Services
    • Permission Group Services
  • OMS OpenAPIs
    • Package Services
      • Default
    • Transfer Order Services
      • Default
  • Instore
    • Password Reset Services
  • Integrator
    • Projects
    • Flows
    • Logs
  • Seller Center
    • Languages
    • Categories
    • Introduction
    • Products
    • Packages
    • Orders
    • Claims
    • Shipping Methods
  • Akifast
    • Authentication
  • B2B
    • Quotation
    • Basket
    • Division
    • User
    • Staff User
    • Groups
    • Notification
    • Notification Template
  • Flows
    • Shipment Flows
    • Payment Flows
    • SMS Flows
    • Basket Offer Flows
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page

Was this helpful?

  1. OMS

Cancellation Plan Services

In Omnitron, a cancellation plan is initiated when either an order item or the entire order is canceled or refunded. When this cancellation plan is generated, it triggers a cancellation webhook, which is then transmitted to OMS.

The CancellationPlanViewSet is responsible for handling the data received through this webhook. Its role is to assess whether the package containing the product marked for cancellation or refund can indeed be canceled or refunded.

POST Run Cancellation Plan Service

Path: /api/v1/oms/cancellation_plan/

Request Body

Property
Data Type
Required
In
Descriptions

event

json

true

body

Details of the event (webhook type and uuid)

payload

json

true

body

Details of the cancellation plan created for cancelled / refunded order item or order

Example Request Body

The data transmitted from Omnitron maintains a consistent format for both cancellation and refund operations. The only distinction lies in the plan_type field, which must be set to cancel when it pertains to cancellation and refund when it pertains to refund operations.

{
  "event": {
    "type": "cancellation_plan.created",
    "uuid": "4e7ab2024a3e4e8ba400c2470b84f976"
  },
  "payload": {
    "pk": 2839,
    "order": {
      "pk": 1883,
      "notes": null,
      "amount": "13.49",
      "number": "1472672233418128",
      "status": "50",
      "channel": 1,
      "is_send": true,
      "segment": null,
      "currency": "try",
      "customer": 232,
      "bin_number": null,
      "client_type": "default",
      "date_placed": "2020-10-12T07:54:06.714184Z",
      "extra_field": {},
      "installment": 69,
      "remote_addr": "212.115.28.8",
      "has_gift_box": false,
      "invoice_date": null,
      "cargo_company": 1,
      "delivery_type": null,
      "e_archive_url": null,
      "gift_box_note": null,
      "language_code": "tr-tr",
      "modified_date": "2023-02-08T14:40:25.643841Z",
      "refund_amount": "0.00",
      "delivery_range": null,
      "invoice_number": null,
      "payment_option": 67,
      "billing_address": 298,
      "discount_amount": "220.01",
      "external_status": null,
      "shipping_amount": "9.00",
      "tracking_number": null,
      "shipping_address": 298,
      "installment_count": 1,
      "shipping_tax_rate": null,
      "net_shipping_amount": "9.00",
      "payment_option_slug": "credit_card",
      "checkout_provider_id": null,
      "shipping_option_slug": null,
      "carrier_shipping_code": null,
      "discount_refund_amount": "0.00",
      "shipping_refund_amount": "0.00",
      "shipping_interest_amount": "0.00",
      "installment_interest_amount": "0.00",
      "fundstransfertransaction_set": []
    },
    "status": "completed",
    "plan_type": "cancel",
    "created_by": {
      "pk": 1387,
      "email": "test@akinon.com",
      "groups": [
        1,
        2
      ],
      "is_staff": true,
      "username": "test",
      "is_active": true,
      "last_name": "Doe",
      "first_name": "John",
      "last_login": "2023-02-08T12:52:49.880154Z",
      "date_joined": "2022-04-04T21:10:20.324120Z",
      "is_superuser": true
    },
    "created_date": "2023-02-08T14:40:25.692898Z",
    "modified_date": "2023-02-08T14:40:25.692930Z",
    "refund_amount": "13.49",
    "invoice_number": null,
    "last_updated_by": {
      "pk": 1387,
      "email": "test@akinon.com",
      "groups": [
        1,
        2
      ],
      "is_staff": true,
      "username": "test",
      "is_active": true,
      "last_name": "Doe",
      "first_name": "John",
      "last_login": "2023-02-08T12:52:49.880154Z",
      "date_joined": "2022-04-04T21:10:20.324120Z",
      "is_superuser": true
    },
    "staff_remote_id": null,
    "order_previous_status": "400",
    "discount_refund_amount": "220.01",
    "retail_store_remote_id": null,
    "shipping_refund_amount": "9.00",
    "cancellationplanorderitem_set": [
      {
        "pk": 2872,
        "reason": {
          "pk": 2,
          "order": 100,
          "subject": "Ürünü satın almaktan vazgeçtim.",
          "is_active": true,
          "modified_date": "2020-04-07T14:13:34.807272Z",
          "send_to_remote": true,
          "cancellation_type": "cancel",
          "extra_information_needed": false
        },
        "status": "100",
        "order_item": {
          "pk": 1883,
          "image": null,
          "order": {
            "pk": 1883,
            "notes": null,
            "amount": "13.49",
            "number": "1472672233418128",
            "status": "50",
            "channel": 1,
            "is_send": true,
            "segment": null,
            "currency": "try",
            "customer": 232,
            "bin_number": null,
            "client_type": "default",
            "date_placed": "2020-10-12T07:54:06.714184Z",
            "extra_field": {},
            "installment": 69,
            "remote_addr": "212.115.28.8",
            "has_gift_box": false,
            "invoice_date": null,
            "cargo_company": 1,
            "delivery_type": null,
            "e_archive_url": null,
            "gift_box_note": null,
            "language_code": "tr-tr",
            "modified_date": "2023-02-08T14:40:25.643841Z",
            "refund_amount": "0.00",
            "delivery_range": null,
            "invoice_number": null,
            "payment_option": 67,
            "billing_address": 298,
            "discount_amount": "220.01",
            "external_status": null,
            "shipping_amount": "9.00",
            "tracking_number": null,
            "shipping_address": 298,
            "installment_count": 1,
            "shipping_tax_rate": null,
            "net_shipping_amount": "9.00",
            "payment_option_slug": "credit_card",
            "checkout_provider_id": null,
            "shipping_option_slug": null,
            "carrier_shipping_code": null,
            "discount_refund_amount": "0.00",
            "shipping_refund_amount": "0.00",
            "shipping_interest_amount": "0.00",
            "installment_interest_amount": "0.00",
            "fundstransfertransaction_set": []
          },
          "price": "224.50",
          "parent": null,
          "status": "50",
          "product": {
            "pk": 5076,
            "sku": "868206122521",
            "name": "GOMLEK .V33 .39",
            "uuid": "73f4c35a-33fe-4a73-ad66-58d2b7adc7e0",
            "parent": null,
            "base_code": "M868206122521",
            "is_active": true,
            "attributes": {
              "erp_size": "39",
              "erp_color": "33",
              "erp_drying": "4",
              "erp_gender": "E",
              "erp_weight": "0",
              "erp_ironing": "+",
              "erp_washing": "a",
              "erp_resource": "10",
              "erp_vat_rate": "8",
              "erp_bleaching": "9",
              "erp_is_outlet": "True",
              "erp_materials": "KUMAŞ: %100.0 Pamuk",
              "erp_dimensions": "0",
              "erp_sale_rules": "10",
              "erp_config_attr": "SIZE",
              "erp_resource_id": "1",
              "erp_season_name": "K",
              "erp_season_year": "2020",
              "filterable_size": "39",
              "erp_date_updated": "2021-04-04T08:41:19+0300",
              "erp_dry_cleaning": "W",
              "filtrable_season": "2020",
              "integration_size": "39",
              "erp_attribute_set": "120",
              "erp_barcode_color": "868206122521",
              "erp_barcode_ean13": "8682061225213",
              "erp_barcode_model": "868206122521",
              "filterable_gender": "Erkek",
              "filtrable_color_1": "Mavi",
              "integration_color": "33",
              "integration_drying": "4",
              "integration_gender": "E",
              "integration_ironing": "+",
              "integration_washing": "a",
              "integration_resource": "10",
              "integration_vat_rate": "8",
              "filterable_dimensions": "Standart",
              "integration_bleaching": "9",
              "integration_is_outlet": "False",
              "integration_materials": "KUMAŞ: %100.0 Pamuk",
              "integration_dimensions": "0",
              "integration_sale_rules": "13",
              "erp_discount_prohibited": "0",
              "integration_config_attr": "SİZE",
              "integration_resource_id": "1",
              "integration_season_name": "K",
              "integration_season_year": "2020",
              "filterable_attribute_set": "GÖMLEK",
              "integration_date_updated": "2019-11-06T10:30:13+0300",
              "integration_dry_cleaning": "W",
              "integration_attribute_set": "290",
              "integration_barcode_color": "868206122521",
              "integration_barcode_ean13": "8682061225213",
              "integration_barcode_model": "868206122521",
              "integration_discount_prohibited": "0"
            },
            "data_source": null,
            "listing_code": "33",
            "product_type": "0",
            "attribute_set": 1,
            "modified_date": "2022-04-04T09:41:30.700264Z",
            "group_products": [],
            "extra_attributes": {},
            "productimage_set": [],
            "attributes_kwargs": {
              "erp_size": {
                "label": "39",
                "value": "39",
                "data_type": "dropdown"
              },
              "erp_color": {
                "label": "MAVI",
                "value": "33",
                "data_type": "dropdown"
              },
              "erp_gender": {
                "label": "E",
                "value": "E",
                "data_type": "dropdown"
              },
              "erp_is_outlet": {
                "label": "True",
                "value": "True",
                "data_type": "dropdown"
              },
              "erp_dimensions": {
                "label": "0",
                "value": "0",
                "data_type": "dropdown"
              },
              "erp_config_attr": {
                "label": "SIZE",
                "value": "SIZE",
                "data_type": "dropdown"
              },
              "erp_season_year": {
                "label": "2020",
                "value": "2020",
                "data_type": "dropdown"
              },
              "filterable_size": {
                "label": "39",
                "value": "39",
                "data_type": "dropdown"
              },
              "filtrable_season": {
                "label": "2020",
                "value": "2020",
                "data_type": "dropdown"
              },
              "integration_size": {
                "label": "39",
                "value": "39",
                "data_type": "dropdown"
              },
              "erp_attribute_set": {
                "label": "GOMLEK",
                "value": "120",
                "data_type": "dropdown"
              },
              "filterable_gender": {
                "label": "Erkek",
                "value": "Erkek",
                "data_type": "dropdown"
              },
              "filtrable_color_1": {
                "label": "Mavi",
                "value": "Mavi",
                "data_type": "dropdown"
              },
              "integration_color": {
                "label": "MAVI",
                "value": "33",
                "data_type": "dropdown"
              },
              "integration_gender": {
                "label": "E",
                "value": "E",
                "data_type": "dropdown"
              },
              "filterable_dimensions": {
                "label": "Standart",
                "value": "Standart",
                "data_type": "dropdown"
              },
              "integration_is_outlet": {
                "label": "False",
                "value": "False",
                "data_type": "dropdown"
              },
              "integration_dimensions": {
                "label": "0",
                "value": "0",
                "data_type": "dropdown"
              },
              "erp_discount_prohibited": {
                "label": "0",
                "value": "0",
                "data_type": "dropdown"
              },
              "integration_config_attr": {
                "label": "SIZE",
                "value": "SİZE",
                "data_type": "dropdown"
              },
              "integration_season_year": {
                "label": "2020",
                "value": "2020",
                "data_type": "dropdown"
              },
              "filterable_attribute_set": {
                "label": "GÖMLEK",
                "value": "GÖMLEK",
                "data_type": "dropdown"
              },
              "integration_attribute_set": {
                "label": "AYAKKABI",
                "value": "290",
                "data_type": "dropdown"
              },
              "integration_discount_prohibited": {
                "label": "0",
                "value": "0",
                "data_type": "dropdown"
              }
            },
            "productization_date": "2020-02-14T11:23:09.556066Z",
            "custom_attribute_set": null
          },
          "tax_rate": "8.00",
          "attributes": {},
          "net_amount": "224.50",
          "price_list": {
            "pk": 1,
            "code": "shop_price_list",
            "name": "shop_price_list",
            "currency": "try",
            "created_date": "2020-02-10T14:29:48.674885Z",
            "is_auto_sync": true,
            "modified_date": "2020-02-10T14:29:48.674915Z"
          },
          "stock_list": {
            "pk": 1,
            "code": "shop_stock_list",
            "name": "shop_stock_list",
            "created_date": "2020-02-10T14:30:00.218712Z",
            "is_auto_sync": true,
            "modified_date": "2020-02-10T14:30:00.218745Z"
          },
          "data_source": null,
          "extra_field": {},
          "invoice_date": null,
          "retail_price": "449.00",
          "tracking_url": null,
          "cancel_status": "waiting",
          "e_archive_url": null,
          "shipment_code": null,
          "invoice_number": null,
          "price_currency": "try",
          "status_display": "cancellation waiting",
          "discount_amount": "220.01",
          "external_status": null,
          "tracking_number": null,
          "shipping_company": null,
          "attributes_kwargs": {},
          "benefitapplicant_set": [
            {
              "id": 431,
              "order_item": 1883,
              "created_date": "2020-10-12T08:14:08.972369Z",
              "discount_item": 431,
              "modified_date": "2020-10-12T08:14:09.032379Z",
              "discount_share": "220.01"
            }
          ],
          "estimated_delivery_date": null,
          "installment_interest_amount": "0.00"
        },
        "modified_date": "2023-02-08T14:40:25.699842Z",
        "order_item_previous_status": "400"
      }
    ]
  }
}

Example Request

To run this service, a POST request should be sent to the /api/v1/oms/cancellation_plan/endpoint. In the headers, set theAuthorization header to include the api token for authentication.

Here's an example of how to make the request in python:

import requests
import json

url = "https://{domain_url}/api/v1/oms/cancellation_plan/"
token = "11111XXXXXXXXXXXXXXXXX201XXXXX9332d"

payload = json.dumps({
    "event": {
        "type": "cancellation_plan.created",
        "uuid": "4e7ab2024a3e4e8ba400c2470b84f976"
    },
    "payload": {
        "pk": 2839,
        "order": {
            "pk": 1883,
            "notes": null,
            "amount": "13.49",
            "number": "1472672233418128",
            "status": "50",
            "channel": 1,
            "is_send": true,
            "segment": null,
            "currency": "try",
            "customer": 232,
            "bin_number": null,
            "client_type": "default",
            "date_placed": "2020-10-12T07:54:06.714184Z",
            "extra_field": {},
            "installment": 69,
            "remote_addr": "212.115.28.8",
            "has_gift_box": false,
            "invoice_date": null,
            "cargo_company": 1,
            "delivery_type": null,
            "e_archive_url": null,
            "gift_box_note": null,
            "language_code": "tr-tr",
            "modified_date": "2023-02-08T14:40:25.643841Z",
            "refund_amount": "0.00",
            "delivery_range": null,
            "invoice_number": null,
            "payment_option": 67,
            "billing_address": 298,
            "discount_amount": "220.01",
            "external_status": null,
            "shipping_amount": "9.00",
            "tracking_number": null,
            "shipping_address": 298,
            "installment_count": 1,
            "shipping_tax_rate": null,
            "net_shipping_amount": "9.00",
            "payment_option_slug": "credit_card",
            "checkout_provider_id": null,
            "shipping_option_slug": null,
            "carrier_shipping_code": null,
            "discount_refund_amount": "0.00",
            "shipping_refund_amount": "0.00",
            "shipping_interest_amount": "0.00",
            "installment_interest_amount": "0.00",
            "fundstransfertransaction_set": []
        },
        "status": "completed",
        "plan_type": "cancel",
        "created_by": {
            "pk": 1387,
            "email": "test@akinon.com",
            "groups": [
                1,
                2
            ],
            "is_staff": true,
            "username": "test",
            "is_active": true,
            "last_name": "Doe",
            "first_name": "John",
            "last_login": "2023-02-08T12:52:49.880154Z",
            "date_joined": "2022-04-04T21:10:20.324120Z",
            "is_superuser": true
        },
        "created_date": "2023-02-08T14:40:25.692898Z",
        "modified_date": "2023-02-08T14:40:25.692930Z",
        "refund_amount": "13.49",
        "invoice_number": null,
        "last_updated_by": {
            "pk": 1387,
            "email": "test@akinon.com",
            "groups": [
                1,
                2
            ],
            "is_staff": true,
            "username": "test",
            "is_active": true,
            "last_name": "Doe",
            "first_name": "John",
            "last_login": "2023-02-08T12:52:49.880154Z",
            "date_joined": "2022-04-04T21:10:20.324120Z",
            "is_superuser": true
        },
        "staff_remote_id": null,
        "order_previous_status": "400",
        "discount_refund_amount": "220.01",
        "retail_store_remote_id": null,
        "shipping_refund_amount": "9.00",
        "cancellationplanorderitem_set": [
            {
                "pk": 2872,
                "reason": {
                    "pk": 2,
                    "order": 100,
                    "subject": "Ürünü satın almaktan vazgeçtim.",
                    "is_active": true,
                    "modified_date": "2020-04-07T14:13:34.807272Z",
                    "send_to_remote": true,
                    "cancellation_type": "cancel",
                    "extra_information_needed": false
                },
                "status": "100",
                "order_item": {
                    "pk": 1883,
                    "image": null,
                    "order": {
                        "pk": 1883,
                        "notes": null,
                        "amount": "13.49",
                        "number": "1472672233418128",
                        "status": "50",
                        "channel": 1,
                        "is_send": true,
                        "segment": null,
                        "currency": "try",
                        "customer": 232,
                        "bin_number": null,
                        "client_type": "default",
                        "date_placed": "2020-10-12T07:54:06.714184Z",
                        "extra_field": {},
                        "installment": 69,
                        "remote_addr": "212.115.28.8",
                        "has_gift_box": false,
                        "invoice_date": null,
                        "cargo_company": 1,
                        "delivery_type": null,
                        "e_archive_url": null,
                        "gift_box_note": null,
                        "language_code": "tr-tr",
                        "modified_date": "2023-02-08T14:40:25.643841Z",
                        "refund_amount": "0.00",
                        "delivery_range": null,
                        "invoice_number": null,
                        "payment_option": 67,
                        "billing_address": 298,
                        "discount_amount": "220.01",
                        "external_status": null,
                        "shipping_amount": "9.00",
                        "tracking_number": null,
                        "shipping_address": 298,
                        "installment_count": 1,
                        "shipping_tax_rate": null,
                        "net_shipping_amount": "9.00",
                        "payment_option_slug": "credit_card",
                        "checkout_provider_id": null,
                        "shipping_option_slug": null,
                        "carrier_shipping_code": null,
                        "discount_refund_amount": "0.00",
                        "shipping_refund_amount": "0.00",
                        "shipping_interest_amount": "0.00",
                        "installment_interest_amount": "0.00",
                        "fundstransfertransaction_set": []
                    },
                    "price": "224.50",
                    "parent": null,
                    "status": "50",
                    "product": {
                        "pk": 5076,
                        "sku": "868206122521",
                        "name": "GOMLEK .V33 .39",
                        "uuid": "73f4c35a-33fe-4a73-ad66-58d2b7adc7e0",
                        "parent": null,
                        "base_code": "M868206122521",
                        "is_active": true,
                        "attributes": {
                            "erp_size": "39",
                            "erp_color": "33",
                            "erp_drying": "4",
                            "erp_gender": "E",
                            "erp_weight": "0",
                            "erp_ironing": "+",
                            "erp_washing": "a",
                            "erp_resource": "10",
                            "erp_vat_rate": "8",
                            "erp_bleaching": "9",
                            "erp_is_outlet": "True",
                            "erp_materials": "KUMAŞ: %100.0 Pamuk",
                            "erp_dimensions": "0",
                            "erp_sale_rules": "10",
                            "erp_config_attr": "SIZE",
                            "erp_resource_id": "1",
                            "erp_season_name": "K",
                            "erp_season_year": "2020",
                            "filterable_size": "39",
                            "erp_date_updated": "2021-04-04T08:41:19+0300",
                            "erp_dry_cleaning": "W",
                            "filtrable_season": "2020",
                            "integration_size": "39",
                            "erp_attribute_set": "120",
                            "erp_barcode_color": "868206122521",
                            "erp_barcode_ean13": "8682061225213",
                            "erp_barcode_model": "868206122521",
                            "filterable_gender": "Erkek",
                            "filtrable_color_1": "Mavi",
                            "integration_color": "33",
                            "integration_drying": "4",
                            "integration_gender": "E",
                            "integration_ironing": "+",
                            "integration_washing": "a",
                            "integration_resource": "10",
                            "integration_vat_rate": "8",
                            "filterable_dimensions": "Standart",
                            "integration_bleaching": "9",
                            "integration_is_outlet": "False",
                            "integration_materials": "KUMAŞ: %100.0 Pamuk",
                            "integration_dimensions": "0",
                            "integration_sale_rules": "13",
                            "erp_discount_prohibited": "0",
                            "integration_config_attr": "SİZE",
                            "integration_resource_id": "1",
                            "integration_season_name": "K",
                            "integration_season_year": "2020",
                            "filterable_attribute_set": "GÖMLEK",
                            "integration_date_updated": "2019-11-06T10:30:13+0300",
                            "integration_dry_cleaning": "W",
                            "integration_attribute_set": "290",
                            "integration_barcode_color": "868206122521",
                            "integration_barcode_ean13": "8682061225213",
                            "integration_barcode_model": "868206122521",
                            "integration_discount_prohibited": "0"
                        },
                        "data_source": null,
                        "listing_code": "33",
                        "product_type": "0",
                        "attribute_set": 1,
                        "modified_date": "2022-04-04T09:41:30.700264Z",
                        "group_products": [],
                        "extra_attributes": {},
                        "productimage_set": [],
                        "attributes_kwargs": {
                            "erp_size": {
                                "label": "39",
                                "value": "39",
                                "data_type": "dropdown"
                            },
                            "erp_color": {
                                "label": "MAVI",
                                "value": "33",
                                "data_type": "dropdown"
                            },
                            "erp_gender": {
                                "label": "E",
                                "value": "E",
                                "data_type": "dropdown"
                            },
                            "erp_is_outlet": {
                                "label": "True",
                                "value": "True",
                                "data_type": "dropdown"
                            },
                            "erp_dimensions": {
                                "label": "0",
                                "value": "0",
                                "data_type": "dropdown"
                            },
                            "erp_config_attr": {
                                "label": "SIZE",
                                "value": "SIZE",
                                "data_type": "dropdown"
                            },
                            "erp_season_year": {
                                "label": "2020",
                                "value": "2020",
                                "data_type": "dropdown"
                            },
                            "filterable_size": {
                                "label": "39",
                                "value": "39",
                                "data_type": "dropdown"
                            },
                            "filtrable_season": {
                                "label": "2020",
                                "value": "2020",
                                "data_type": "dropdown"
                            },
                            "integration_size": {
                                "label": "39",
                                "value": "39",
                                "data_type": "dropdown"
                            },
                            "erp_attribute_set": {
                                "label": "GOMLEK",
                                "value": "120",
                                "data_type": "dropdown"
                            },
                            "filterable_gender": {
                                "label": "Erkek",
                                "value": "Erkek",
                                "data_type": "dropdown"
                            },
                            "filtrable_color_1": {
                                "label": "Mavi",
                                "value": "Mavi",
                                "data_type": "dropdown"
                            },
                            "integration_color": {
                                "label": "MAVI",
                                "value": "33",
                                "data_type": "dropdown"
                            },
                            "integration_gender": {
                                "label": "E",
                                "value": "E",
                                "data_type": "dropdown"
                            },
                            "filterable_dimensions": {
                                "label": "Standart",
                                "value": "Standart",
                                "data_type": "dropdown"
                            },
                            "integration_is_outlet": {
                                "label": "False",
                                "value": "False",
                                "data_type": "dropdown"
                            },
                            "integration_dimensions": {
                                "label": "0",
                                "value": "0",
                                "data_type": "dropdown"
                            },
                            "erp_discount_prohibited": {
                                "label": "0",
                                "value": "0",
                                "data_type": "dropdown"
                            },
                            "integration_config_attr": {
                                "label": "SIZE",
                                "value": "SİZE",
                                "data_type": "dropdown"
                            },
                            "integration_season_year": {
                                "label": "2020",
                                "value": "2020",
                                "data_type": "dropdown"
                            },
                            "filterable_attribute_set": {
                                "label": "GÖMLEK",
                                "value": "GÖMLEK",
                                "data_type": "dropdown"
                            },
                            "integration_attribute_set": {
                                "label": "AYAKKABI",
                                "value": "290",
                                "data_type": "dropdown"
                            },
                            "integration_discount_prohibited": {
                                "label": "0",
                                "value": "0",
                                "data_type": "dropdown"
                            }
                        },
                        "productization_date": "2020-02-14T11:23:09.556066Z",
                        "custom_attribute_set": null
                    },
                    "tax_rate": "8.00",
                    "attributes": {},
                    "net_amount": "224.50",
                    "price_list": {
                        "pk": 1,
                        "code": "shop_price_list",
                        "name": "shop_price_list",
                        "currency": "try",
                        "created_date": "2020-02-10T14:29:48.674885Z",
                        "is_auto_sync": true,
                        "modified_date": "2020-02-10T14:29:48.674915Z"
                    },
                    "stock_list": {
                        "pk": 1,
                        "code": "shop_stock_list",
                        "name": "shop_stock_list",
                        "created_date": "2020-02-10T14:30:00.218712Z",
                        "is_auto_sync": true,
                        "modified_date": "2020-02-10T14:30:00.218745Z"
                    },
                    "data_source": null,
                    "extra_field": {},
                    "invoice_date": null,
                    "retail_price": "449.00",
                    "tracking_url": null,
                    "cancel_status": "waiting",
                    "e_archive_url": null,
                    "shipment_code": null,
                    "invoice_number": null,
                    "price_currency": "try",
                    "status_display": "cancellation waiting",
                    "discount_amount": "220.01",
                    "external_status": null,
                    "tracking_number": null,
                    "shipping_company": null,
                    "attributes_kwargs": {},
                    "benefitapplicant_set": [
                        {
                            "id": 431,
                            "order_item": 1883,
                            "created_date": "2020-10-12T08:14:08.972369Z",
                            "discount_item": 431,
                            "modified_date": "2020-10-12T08:14:09.032379Z",
                            "discount_share": "220.01"
                        }
                    ],
                    "estimated_delivery_date": null,
                    "installment_interest_amount": "0.00"
                },
                "modified_date": "2023-02-08T14:40:25.699842Z",
                "order_item_previous_status": "400"
            }
        ]
    }
})

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers, data=payload)

print(response.json())

Example Response (200 OK)

OMS adheres to its own set of rules when processing package cancellations or refunds. If a package meets the criteria for either cancellation or refund, OMS will proceed with the operation and issue a successful response, a status code of 200 OK.

The response body will not contain any additional objects or messages.

Example Response (202 ACCEPTED)

In specific scenarios, OMS does not cancel or refund a package, yet it also avoids generating an error. In such cases, OMS will provide a response with a status code of 202 ACCEPTED.

The response body will not include any additional objects or messages.

These situations include:

  • When the order item does not exist.

  • When a refund is disallowed due to the order being in an invalid state.

  • When partial cancellation is not allowed for the package.

Example Response (406 NOT ACCEPTABLE)

If the package does not meet the criteria for cancellation or refund, OMS will respond with a status code of 406 NOT ACCEPTABLE.

The response body will include a message similar to the following:

{
  "error": {
    "non_field_errors": "Cancellation is not allowed for this order item",
    "error_code": "order_100_123"
  },
  "status_code": 406
}
PreviousChannel ServicesNextCancellation Reason Services

Last updated 26 days ago

Was this helpful?