User Orders & Cancellations
GET
List User Orders
This endpoint allows an authenticated user to retrieve a list of all their orders..
Path: /users/orders/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/orders/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.text)
Example Response (200 OK)
{
"count": 7,
"next": null,
"previous": null,
"results": [
{
"id": 6016,
"status": {},
"currency": {},
"orderitem_set": [],
"discountitem_set": [],
"is_cancelled": true,
"is_cancellable": false,
"is_refundable": false,
"shipping_address": {},
"billing_address": {},
"shipping_company": null,
"client_type": "default",
"payment_option": {},
"amount_without_discount": "109.99",
"is_payable": false,
"tracking_url": null,
"bank": {},
"loyaltytransaction_set": [],
"created_date": "2024-10-24T09:32:05.544358Z",
"modified_date": "2024-11-05T08:53:25.564365Z",
"number": "2745403029312170",
"amount": "99.99",
"discount_amount": "10.00",
"shipping_amount": "0.00",
"shipping_tax_rate": null,
"refund_amount": "99.99",
"discount_refund_amount": "0.00",
"shipping_refund_amount": "0.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"defined_tracking_url": null,
"remote_addr": "3.73.5.7",
"has_gift_box": false,
"gift_box_note": null,
"language_code": "en-us",
"notes": null,
"delivery_range": null,
"extra_field": {},
"user_email": "john.doe@akinon.com",
"shipping_option_slug": "TEST-123",
"payment_option_slug": "Credit_Card",
"bin_number": "555555",
"installment_count": 1,
"installment_interest_amount": "0.00",
"shipping_tracking_url": null,
"user": 6471,
"basket": 9901,
"shipping_option": 232,
"card": 364,
"installment": 265,
"segment": null,
"checkout_provider": null
}
]
}
GET
Retrieve User Order
This endpoint allows you to retrieve detailed information about a specific user's order using the order ID (<pk>
).
Path: /users/orders/<pk>/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/orders/<pk>/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.text)
Example Response (200 OK)
{
"id": 1,
"status": {
"value": "200",
"label": "Bekliyor"
},
"currency": {
"value": "try",
"label": "TL"
},
"orderitem_set": [
{
"id": 485,
"status": {
"value": "200",
"label": "Bekliyor"
},
"price_currency": {
"value": "try",
"label": "TL"
},
"product": {
"pk": 4283,
"sku": "2672881068196",
"base_code": "1KPARF0006",
"name": "Repertoıre Room Spray 100 Ml",
"image": "https://akinon.net/products/2017/01/23/6/fb8a31.jpg",
"absolute_url": "/repertoire-room-spray-100-ml-violet/",
"attributes": {
"integration_ProductAtt12Desc": "%50 + %50 PROMOSYON",
"uretim_yeri": "TÜRKİYE"
},
"attributes_kwargs": {
"erp_ProductHierarchyLevel01": {
"value": "KOZMETİK",
"data_type": "dropdown",
"label": "KOZMETİK"
}
},
"form_schema": null,
"data_source": null,
"extra_attributes": {}
},
"is_cancelled": false,
"is_cancellable": true,
"is_refundable": false,
"cancellationrequest_set": [],
"active_cancellation_request": null,
"shipping_company": null,
"tracking_url": null,
"is_tradable": false,
"available_easy_return_shipping_companies": [],
"datasource_detailed": null,
"extra_product_stock_detailed": null,
"extra_product_price_detailed": null,
"created_date": "2021-05-24T08:26:12.213928Z",
"modified_date": "2021-05-24T08:26:12.213957Z",
"attributes": {},
"attributes_kwargs": {},
"localized_attributes": {},
"localized_attributes_kwargs": {},
"price": "11.87",
"tax_rate": "18.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"retail_price": "47.47",
"image": null,
"extra_field": {
"price_extra_field": {},
"stock_extra_field": {}
},
"estimated_delivery_date": null,
"shipping_tracking_url": null,
"order": 388,
"parent": null,
"extra_product_price": null,
"extra_product_stock": null,
"datasource": null
}
],
"discountitem_set": [],
"is_cancelled": false,
"is_cancellable": true,
"is_refundable": false,
"shipping_address": {
"pk": 63,
"email": "testtest@test.com",
"phone_number": "05555555555",
"first_name": "Test",
"last_name": "Test",
"country": {
"pk": 1,
"is_active": true,
"name": "Türkiye",
"code": "tr",
"translations": null
},
"city": {
"pk": 13,
"is_active": true,
"name": "Adana",
"country": 1,
"translations": null,
"priority": null,
"postcode": null
},
"line": "Test test test",
"title": "Test",
"township": {
"pk": 271,
"is_active": true,
"name": "Test Name",
"city": 13,
"postcode": null
},
"district": {
"pk": 3978,
"is_active": true,
"name": "Test",
"city": 13,
"township": 271,
"postcode": null
},
"postcode": "61000",
"notes": null,
"company_name": "",
"tax_office": "",
"tax_no": "",
"e_bill_taxpayer": false,
"hash_data": "6800dd08a0d375b1d2016bbb3d6125f2",
"address_type": "customer",
"retail_store": null,
"remote_id": null,
"identity_number": null,
"extra_field": null,
"user": <user_data>,
"is_corporate": false,
"primary": false
},
"billing_address": {
"pk": 63,
"email": "testtest@test.com",
"phone_number": "05555555555",
"first_name": "Test",
"last_name": "Test",
"country": {
"pk": 1,
"is_active": true,
"name": "Türkiye",
"code": "tr",
"translations": null
},
"city": {
"pk": 13,
"is_active": true,
"name": "Adana",
"country": 1,
"translations": null,
"priority": null,
"postcode": null
},
"line": "Test test test",
"title": "Test",
"township": {
"pk": 271,
"is_active": true,
"name": "Test Name",
"city": 13,
"postcode": null
},
"district": {
"pk": 3978,
"is_active": true,
"name": "KALDIRIM",
"city": 13,
"township": 271,
"postcode": null
},
"postcode": "61000",
"notes": null,
"company_name": "",
"tax_office": "",
"tax_no": "",
"e_bill_taxpayer": false,
"hash_data": "6800dd08a0d375b1d2016bbb3d6125f2",
"address_type": "customer",
"retail_store": null,
"remote_id": null,
"identity_number": null,
"extra_field": null,
"user": <user_data>,
"is_corporate": false,
"primary": false
},
"shipping_company": null,
"client_type": "default",
"payment_option": {
"pk": 18,
"name": "Garanti Switch",
"payment_type": "saved_card",
"slug": "gswitch"
},
"amount_without_discount": "20.37",
"is_payable": false,
"tracking_url": null,
"bank": {
"pk": 5,
"name": "Garanti Bankası",
"slug": "garanti-bankas",
"logo": null
},
"created_date": "2021-05-24T08:26:12.205731Z",
"modified_date": "2021-05-24T08:26:12.205783Z",
"number": "1666226475313376",
"amount": "20.37",
"discount_amount": "0.00",
"shipping_amount": "8.50",
"shipping_tax_rate": null,
"refund_amount": "0.00",
"discount_refund_amount": "0.00",
"shipping_refund_amount": "0.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"remote_addr": "61.61.61.61",
"has_gift_box": false,
"gift_box_note": null,
"language_code": "tr-tr",
"notes": null,
"delivery_range": null,
"extra_field": null,
"user_email": "testtest@test.com",
"shipping_option_slug": "ARAS",
"payment_option_slug": "gswitch",
"bin_number": "554960",
"installment_count": 1,
"installment_interest_amount": "0.00",
"shipping_tracking_url": null,
"user": 1,
"basket": 529,
"shipping_option": 1,
"card": 5,
"installment": 5,
"segment": null,
"checkout_provider": null
}
GET
Display Return Items for Order Cancellation
This endpoint is used to list and display the return items for a specific order on the shop page, showing information about cancelled items and their details.
Path: /users/orders/<pk>/cancellation/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/orders/<order-id>/cancellation/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.text)
Example Response (200 OK)
{
"id": 940901,
"status": {
"value": "100",
"label": "İptal edildi"
},
"currency": {
"value": "try",
"label": "TL"
},
"orderitem_set": [
{
"id": 1826154,
"status": {
"value": "100",
"label": "İptal edildi"
},
"price_currency": {
"value": "try",
"label": "TL"
},
"product": {
"pk": 424106,
"sku": "4759302",
"base_code": "W35517T",
"name": "Erkek Kırmızı Classic Fit Uzun Kollu Keten Gömlek",
"image": "https://akn-occ.a-cdn/products/4-4f2ad1d7.jpg",
"absolute_url": "gomlek-w35517t",
"attributes": {
"integration_kalip": "CLASSIC FIT",
},
"attributes_kwargs": {
"integration_beden_seti": {
"value": "0",
"data_type": "dropdown",
"label": "0"
},
},
"is_cancelled": true,
"is_cancellable": false,
"is_refundable": false,
"cancellationrequest_set": [],
"active_cancellation_request": null,
"shipping_company": null,
"tracking_url": null,
"is_tradable": false,
"available_easy_return_shipping_companies": [
{
"pk": 1,
"shipping_company": {
"value": "yurtici",
"label": "Yurtiçi Kargo"
},
"name": "2"
}
],
"datasource_detailed": null,
"extra_product_stock_detailed": null,
"extra_product_price_detailed": null,
"shipping_option_group": null,
"created_date": "2024-11-14T10:39:48.610172Z",
"modified_date": "2024-11-14T11:19:16.515342Z",
"attributes": {},
"attributes_kwargs": {},
"localized_attributes": {},
"localized_attributes_kwargs": {},
"price": "999.00",
"tax_rate": "10.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"defined_tracking_url": null,
"retail_price": "2799.00",
"image": null,
"extra_field": {
"price_extra_field": {},
"stock_extra_field": {}
},
"estimated_delivery_date": null,
"shipping_tracking_url": null,
"order": 940901,
"parent": null,
"extra_product_price": null,
"extra_product_stock": null,
"datasource": null
}
],
"discountitem_set": [
{
"name": "Sepette %40 İndirim",
"amount": "399.60",
"created_date": "2024-11-14T10:39:48.616579Z",
"order_number": "2763587084514370",
"currency": {
"value": "try",
"label": "TL"
}
},
{
"name": "VIP Özel Kargo Bedava",
"amount": "0.00",
"created_date": "2024-11-14T10:39:48.624229Z",
"order_number": "2763587084514370",
"currency": {
"value": "try",
"label": "TL"
}
}
],
"is_cancelled": true,
"is_cancellable": false,
"is_refundable": false,
"shipping_address": {
"pk": 549671,
"email": "test.test@test.com",
"phone_number": "00000000000",
"first_name": "John",
"last_name": "Doe",
"country": {
"pk": 1,
"is_active": true,
"name": "Türkiye",
"code": "tr",
"translations": null
},
"city": {
"pk": 60,
"is_active": true,
"name": "İSTANBUL",
"country": 1,
"translations": null,
"priority": null,
"postcode": null
},
"line": "Bağcılar/İstanbu",
"title": "Depo",
"township": {
"pk": 451,
"is_active": true,
"name": "BAĞCILAR",
"city": 60,
"postcode": null,
"translations": null
},
"district": {
"pk": 35498,
"is_active": true,
"name": "MAH",
"city": 60,
"township": 451,
"postcode": null,
"translations": null
},
"postcode": "",
"notes": null,
"company_name": "",
"tax_office": "",
"tax_no": "",
"e_bill_taxpayer": false,
"hash_data": "86c056fb6d8b3",
"address_type": "customer",
"retail_store": null,
"remote_id": null,
"identity_number": null,
"extra_field": null,
"user": {
"pk": 558297,
"username": "61846705af4b21dd5fb7aab6b1b771cb",
"first_name": "John",
"last_name": "Doe",
"email": "test.test@test.com",
"is_active": true,
"date_joined": "2023-06-14T07:27:17.917188Z",
"last_login": "2024-11-19T13:48:39.198058Z",
"email_allowed": true,
"sms_allowed": true,
"call_allowed": true,
"gender": "female",
"attributes": {
"sap_id": "6764a455e-081da2e9d3ce",
"logged_ip": "176.41.42.87",
},
"phone": "0000000",
"date_of_birth": "1999-06-10",
"attributes_kwargs": {},
"user_type": "registered",
"modified_date": "2024-07-31T10:56:45.221522Z"
},
"is_corporate": false,
"primary": false
},
"billing_address": <address_data>,
"shipping_company": null,
"client_type": "ios",
"payment_option": {
"pk": 69,
"name": "Kredi Kartı İle Öde",
"payment_type": "masterpass",
"slug": "masterpass"
},
"amount_without_discount": "999.00",
"is_payable": false,
"tracking_url": null,
"bank": <bank_data>,
"loyaltytransaction_set": [],
"created_date": "2024-11-14T10:39:48.599642Z",
"modified_date": "2024-11-14T11:18:56.641719Z",
"number": "2763587084514370",
"amount": "599.40",
"discount_amount": "399.60",
"shipping_amount": "0.00",
"shipping_tax_rate": null,
"refund_amount": "599.40",
"discount_refund_amount": "0.00",
"shipping_refund_amount": "0.00",
"invoice_number": null,
"invoice_date": null,
"e_archive_url": null,
"tracking_number": null,
"defined_tracking_url": null,
"remote_addr": "95.7.2.199",
"has_gift_box": false,
"gift_box_note": null,
"language_code": "tr-tr",
"notes": null,
"delivery_range": null,
"extra_field": {},
"user_email": "test.test@test.com",
"shipping_option_slug": "yurtici",
"payment_option_slug": "masterpass",
"bin_number": "454",
"installment_count": 1,
"installment_interest_amount": "0.00",
"shipping_tracking_url": null,
"user": 558297,
"basket": 4149068,
"shipping_option": 1,
"card": 18,
"installment": 18,
"segment": null,
"checkout_provider": null
}
POST
User Bulk Create Cancellation Requests
This endpoint allows for creating cancellation requests for multiple orders at once.
Path: /users/orders/bulk_cancellation_requests/
Authentication Required: Yes
Headers:
Content-Type: application/json
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
x-csrftoken: <token>
Body Parameters
Property | Data Type | Required | Description |
---|---|---|---|
cancel_order_items.cancellation_type | enum | True | Type of cancellations. Possible values are “cancel” and “refund”. |
cancel_order_items.quantity | integer | False | Specifies the quantity of the order items that are to be cancelled. This field is optional and can be left empty unless a specific quantity is required for the cancellation. |
cancel_order_items.description | string | False | An optional description or message explaining the reason for cancellation. |
cancel_order_items.order_item | integer | True | The ID of the order item to be cancelled. |
cancel_order_items.shipping_company | integer | False | The ID of the Shipping Company (if applicable). |
cancel_order_items.iban | String | False | The IBAN number for the refund (if applicable). |
cancel_order_items.holder_name | String | False | The name of the account holder for refunding (if applicable). |
cancel_order_items.pickup_date.date | date | False | Represents the specific date for the pickup of the cancelled order item. This field is expected to follow a date format (e.g., YYYY-MM-DD). |
cancel_order_items.pickup_date.hour_range.start | string | False | Indicates the starting time of the pickup window, usually in the format of HH:MM (e.g., "09:00"). |
cancel_order_items.pickup_date.hour_range.end | string | False | Represents the ending time of the pickup window, usually in the format of HH:MM (e.g., "12:00"). |
pickup_address | Integer | False | The ID of the address where the item should be picked up for return. |
fully_refund_as_loyalty_money | Boolean | False | Indicates whether the refund should be processed as loyalty money. |
Request Body
{
"cancel_order_items": [
{
"description": "test",
"reason": 1,
"pickup_address": 3,
"cancellation_type": "refund",
"order_item": 1,
"shipping_company": 1,
"pickup_date": {
"date": "2024-01-01",
"hour_range": {
"start": "09:00",
"end": "12:00"
}
}
}
]
}
Example Request
import requests
import json
url = "https://{commerce_url}/users/orders/bulk_cancellation_requests/"
payload = json.dumps({
"cancel_order_items": [
{
"order_item": 271,
"reason": 3,
"cancellation_type": "refund"
}
]
})
headers = {
'Content-Type': 'application/json',
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>',
'x-csrftoken': '<token>'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)
Example Response (201 Created)
[
{
"id": 18,
"cancellation_type": "refund",
"status": {
"value": "open",
"label": "Open"
},
"easy_return": null,
"created_date": "2023-01-16T19:39:35.592560Z",
"modified_date": "2023-01-16T19:39:35.592575Z",
"uuid": "62eeea09-2f48-4db8-9ca5-83168a8647e6",
"description": null,
"iban": null,
"holder_name": null,
"reason": 3,
"order_item": 271
}
]
GET
List User Order Cancellation Reasons
This endpoint retrieves a list of cancellation reasons associated with user orders. Cancellation reasons define why an order or item was canceled or returned, such as receiving the wrong product, changing one's mind, or other reasons. This can help in processing and managing cancellations more effectively.
Path: /users/orders/cancellation_reasons/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/orders/cancellation_reasons/"
headers = {
'Accept-Language: '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.text)
Example Response (200 OK)
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"cancellation_type": "cancel",
"translations": {
"en-us": {
"subject": "I got the wrong product"
}
},
"created_date": "2021-05-28T08:26:58.140000Z",
"modified_date": "2021-05-28T08:27:01.826000Z",
"uuid": "cfce77a6-14cb-489c-b81f-72d565529737",
"subject": "Yanlış Ürün Aldım",
"extra_information_needed": false,
"order": 100,
"is_active": true
}
]
}
Body Parameters
Property | Data Type | Description |
---|---|---|
cancellation_type | Enum | The type of cancellation. Possible values are: “cancel” and “refund”. |
translations | Dict | Translations for the subject of the cancellation reason in different languages. |
uuid | String | A unique identifier (UUID) for the cancellation reason. |
subject | String | The subject of the cancellation reason, which describes why the order or product is being canceled. |
extra_information_needed | Boolean | Indicates if any additional information is needed from the user to process the cancellation |
order | Integer | The ID of the order that this cancellation reason is associated with. |
GET
List User Order Cancellation Requests
This endpoint is used to retrieve a list of order cancellation requests for a user. Each cancellation request includes details like the reason for cancellation, the status of the request, and any related order details.
Path: /users/orders/cancellation_requests/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/orders/cancellation_requests/"
headers = {
'Accept-Language: '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.text)
Example Response (200 OK)
{
"count": 6,
"next": null,
"previous": null,
"results": [
{
"id": 6,
"cancellation_type": "cancel",
"status": {
"value": "open",
"label": "Open"
},
"easy_return": null,
"created_date": "2019-11-12T11:07:36.721777Z",
"modified_date": "2019-11-12T11:07:36.721806Z",
"uuid": "1a2b3456-7cd4-49bb-9bf4-9495e9af845d",
"description": "",
"iban": null,
"holder_name": null,
"reason": 2,
"order_item": 284
},
{
"id": 5,
"cancellation_type": "cancel",
"status": {
"value": "open",
"label": "Open"
},
"easy_return": null,
"created_date": "2019-11-12T11:05:32.022364Z",
"modified_date": "2019-11-12T11:05:32.022422Z",
"uuid": "1a2b3456-7cd4-49bb-9bf4-9495e9af845d",
"description": "",
"iban": null,
"holder_name": null,
"reason": 2,
"order_item": 285
},
]
}
POST
Create User Order Cancellation Request
This endpoint is used to create a new cancellation request for an order item. Users can request either a full cancellation of the order or a refund for the order item, with additional options for specifying shipping logistics, refund details, and the reason for the cancellation.
Path: /users/orders/cancellation_requests/
Authentication Required: Yes
Headers:
Content-Type: application/json
Accept-Language: <iso_language_code>
Cookie: <cookie-name>=<session_id>
x-csrftoken: <token>
Body Parameters
Property | Data Type | Required | Description |
---|---|---|---|
cancellation_type | Enum | True | Indicates the type of cancellation: "cancel" for order cancellation, "refund" for refund request. |
reason | Integer | True | The ID of the cancellation reason. |
order_item | Integer | True | The ID of the order item being canceled. |
shipping_company | Integer | False | The ID of the shipping company handling the return, if applicable. |
pickup_address | Integer | False | The ID of the address where the item should be picked up for return. |
pickup_date | Dict | False | The scheduled date and time for pickup of the returned item. Includes date and hour_range (start and end times). { "date": "2024-01-01", "hour_range": { "start": "09:00", "end": "12:00" } } |
quantity | Integer | False | The number of items to be canceled (should not exceed the quantity ordered). |
description | String | False | An optional description or message explaining the reason for cancellation. |
iban | String | False | The IBAN number for the refund (if applicable). |
holder_name | String | False | The name of the account holder for refunding (if applicable). |
fully_refund_as_loyalty_money | Boolean | False | Indicates whether the refund should be processed as loyalty money. |
Request Body
{
"order_item": 12345,
"reason": 67890,
"cancellation_type": "refund",
"description": "Test description",
"shipping_company": 1,
"pickup_address": 101,
"pickup_date": {
"date": "2024-01-01",
"hour_range": {
"start": "09:00",
"end": "12:00"
}
},
"iban": "TR330006100519786457841326",
"holder_name": "John Doe",
"fully_refund_as_loyalty_money": true,
"quantity": 2
}
Example Request
import requests
import json
url = "https://{commerce_url}/users/registration/"
headers = {
'Content-Type': 'application/json',
'Accept-Language: '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>',
'x-csrftoken': '<token>'
}
payload = json.dumps({
"order_item": 12345,
"reason": 67890,
"cancellation_type": "refund",
"description": "Test description",
"shipping_company": 1,
"pickup_address": 101,
"pickup_date": {
"date": "2024-01-01",
"hour_range": {
"start": "09:00",
"end": "12:00"
}
},
"iban": "TR330006100519786457841326",
"holder_name": "John Doe",
"fully_refund_as_loyalty_money": true
})
response = requests.post(url, headers=headers, data=payload)
print(response.text)
Example Response (200 OK)
{
"status": {
"value": "open",
"label": "Open"
},
"modified_date": "2024-11-19T22:35:54.246633Z",
"holder_name": "John Doe",
"uuid": "8187c360-66da-4959-9f0b-9aa2ccac9001",
"easy_return": {
"status": {
"value": "active",
"label": "Active"
},
"code": "14223",
"end_date": null,
"tracking_url": "https://wwww.test.com",
"tracking_number": "12352355",
"shipping_company": {
"value": "extension",
"label": "Extension Cargo"
},
"pickup_date": {
"date": "2024-01-01",
"hour_range": {
"start": "09:00",
"end": "12:00"
}
},
"start_date": "2024-11-19T22:35:54.246615Z"
},
"description": "test",
"fully_refund_as_loyalty_money": true,
"reason": 2,
"iban": "test-iban",
"cancellation_type": "refund",
"created_date": "2024-11-19T22:35:54.246615Z",
"order_item": 126,
"id": 1,
"quantity": 2
}
Example Response (406 Not Acceptable)
If the pickup_address
is not provided:
{
"non_field_errors": "Pickup address is required.",
"error_code": "cancellation_request_100_8"
}
Example Response (400 Bad Request)
If the quantity
is provided and is greater than the available quantity of the order item
{
"quantity": "Quantity can not be greater than order item quantity."
}
GET
Retrieve User’s All Old Orders
This endpoint retrieves a list of previously placed orders for a user.
Path: /users/old-orders/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Content-Type: 'application/json'
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/old-orders/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
'Content-Type': 'application/json',
}
response = requests.get(url, headers=headers)
print(response.json())
Example Response (200 OK)
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 5,
"currency": {
"value": "try",
"label": "TL"
},
"shipping_company": null,
"oldorderitem_set": [],
"number": "12345",
"user_email": "test_8@akinon.com",
"status": "pasive",
"created_date": "2023-01-16T19:35:12.330019Z",
"amount": "10.00",
"discount_amount": "8.00",
"payment_type": "credit card",
"bank": "garanti",
"installment_count": 3,
"tracking_number": "testtrack123",
"shipping_address": "dene adress",
"billing_address": "deneme address",
"extra_field": {},
"user": 1
}
]
}
GET
Retrieve User’s Old Order
This endpoint retrieves the details of a specific previously placed order.
Path: /users/old-orders/<pk>/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Content-Type: application/json
Cookie: <cookie-name>=<session_id>
Example Request
import requests
url = "https://{commerce_url}/users/old-orders/<pk>/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
'Content-Type': 'application/json',
}
response = requests.get(url, headers=headers)
print(response.json())
Example Response (200 OK)
{
"id": 5,
"currency": {
"value": "try",
"label": "TL"
},
"shipping_company": null,
"oldorderitem_set": [],
"number": "12345",
"user_email": "test_8@akinon.com",
"status": "pasive",
"created_date": "2023-01-16T19:35:12.330019Z",
"amount": "10.00",
"discount_amount": "8.00",
"payment_type": "credit card",
"bank": "garanti",
"installment_count": 3,
"tracking_number": "testtrack123",
"shipping_address": "dene adress",
"billing_address": "deneme address",
"extra_field": {},
"user": 1
}
GET
Approve Trade-in
This endpoint confirms the approval of a trade offer for an item. The URL is sent via email, and clicking it confirms the trade.
Path: /users/order_item/<pk>/tradein_approved/
Authentication Required: Yes
Headers:
Accept-Language: <iso_language_code>
Cookie: '<cookie-name>=<session_id>'
Example Request
import requests
url = "https://{commerce_url}/users/order_item/<pk>/tradein_approved/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id>'
}
response = requests.get(url, headers=headers)
print(response.json())
Example Response (200 OK)
Onaylama isleminiz gönderilmiştir.
GET
Reject Trade-in
This endpoint rejects a trade offer made for an item. The URL is sent to the user via email, and clicking the link confirms the rejection of the trade.
Path: /users/order_item/<pk>/tradein_rejected/
Authentication Required: No
Headers:
Accept-Language: <iso_language_code>
Cookie: '<cookie-name>=<session_id
Example Request
import requests
url = "https://{commerce_url}/users/order_item/<pk>/tradein_rejected/"
headers = {
'Accept-Language': '<iso_language_code>',
'Cookie': '<cookie-name>=<session_id'
}
response = requests.get(url, headers=headers)
print(response.json())
Example Response (200 OK)
Reddetme işleminiz gönderilmiştir.