Checkout
useFetchCheckoutQuery
import { useFetchCheckoutQuery } from '@akinon/next/data/client/checkout';const {
data: checkoutData,
isFetching,
isError,
isSuccess,
refetch: refetchCheckout
} = useFetchCheckoutQuery(null, {
refetchOnMountOrArgChange: true
});{
"context_list": [{
"page_context": {
"is_user_logged_in": true,
"can_guest_purchase": true,
"has_gift_box": true
},
"page_name": "IndexPage",
"page_slug": "indexpage"
},
{
"page_context": {
"delivery_options": [{
"pk": 2,
"slug": "store",
"name": "Mağazadan Teslimat",
"delivery_option_type": "retail_store",
"sort_order": 1
},
{
"pk": 1,
"slug": "delivery_point",
"name": "Teslim Noktasına Teslimat",
"delivery_option_type": "customer",
"sort_order": 2
},
{
"pk": 3,
"slug": "address",
"name": "Eve Teslim",
"delivery_option_type": "customer",
"sort_order": 3
}
]
},
"page_name": "DeliveryOptionSelectionPage",
"page_slug": "deliveryoptionselectionpage"
},
{
"page_context": {
"addresses": [{
"pk": 84,
"email": "[email protected]",
"phone_number": "05555555555",
"first_name": "Firsname",
"last_name": "Lastname",
"country": {
"pk": 1,
"name": "Test Country",
"code": "tr"
},
"city": {
"pk": 2,
"name": "Test City 1",
"country": 1
},
"line": "this is a test address.",
"title": "Test Title",
"township": {
"pk": 2,
"name": "Test Township 1",
"city": 2
},
"district": {
"pk": 2,
"name": "Test District 1",
"city": 2,
"township": 2
},
"postcode": "00000",
"notes": null,
"company_name": null,
"tax_office": null,
"tax_no": null,
"e_bill_taxpayer": false,
"is_corporate": false,
"primary": false,
"identity_number": null,
"extra_field": null
}],
"retail_stores": [{
"pk": 1,
"name": "Shop 2",
"township": {
"pk": 1,
"name": "Test Township 3",
"city": {
"pk": 1,
"name": "Test City 2",
"country": 1
}
},
"district": {
"pk": 1,
"name": "Test District 3",
"city": 1,
"township": 1
},
"address": "Shop 2 Address"
},
{
"pk": 2,
"name": "Shop 1",
"township": {
"pk": 2,
"name": "Test Township 1",
"city": {
"pk": 2,
"name": "Test City 1",
"country": 1
}
},
"district": {
"pk": 2,
"name": "Test District 1",
"city": 2,
"township": 2
},
"address": "Shop Test Address"
},
{
"pk": 5,
"name": "Shop 4",
"township": {
"pk": 2,
"name": "Test Township 1",
"city": {
"pk": 2,
"name": "Test City 1",
"country": 1
}
},
"district": {
"pk": 2,
"name": "Test District 1",
"city": 2,
"township": 2
},
"address": "Istanbul Turkey"
},
{
"pk": 4,
"name": "Shop 3",
"township": {
"pk": 3,
"name": "Test Township 4",
"city": {
"pk": 3,
"name": "Test City 3",
"country": 1
}
},
"district": {
"pk": 3,
"name": "Test District 4",
"city": 3,
"township": 3
},
"address": "Boston Marriott Quincy"
},
{
"pk": 3,
"name": "Shop 3",
"township": {
"pk": 3,
"name": "Test Township 4",
"city": {
"pk": 3,
"name": "Test City 3",
"country": 1
}
},
"district": {
"pk": 3,
"name": "Test District 4",
"city": 3,
"township": 3
},
"address": "Boston Marriott Quincy 1000"
}
],
"country": {
"pk": 1,
"name": "Test Country",
"code": "tr"
}
},
"page_name": "RetailStoreSelectionPage",
"page_slug": "retailstoreselectionpage"
},
{
"page_context": {
"shipping_options": [{
"pk": 2,
"name": "UPS",
"slug": "ups",
"logo": null,
"shipping_amount": "8.50",
"description": null,
"kwargs": {}
},
{
"pk": 1,
"name": "MNG Kargo",
"slug": "Mng",
"logo": null,
"shipping_amount": "0",
"description": "{}",
"kwargs": {}
}
]
},
"page_name": "ShippingOptionSelectionPage",
"page_slug": "shippingoptionselectionpage"
},
{
"page_context": {
"checkout_url": null,
"status_url": null,
"payment_options": [{
"pk": 1,
"name": "Credit Card",
"slug": "credit-card",
"payment_type": "credit_card",
"payment_type_label": "Credit Card"
},
{
"pk": 34,
"name": "Masterpass",
"slug": "masterpass",
"payment_type": "masterpass",
"payment_type_label": "Masterpass"
},
{
"pk": 4,
"name": "havale",
"slug": "havale",
"payment_type": "funds_transfer",
"payment_type_label": "Funds Transfer"
},
{
"pk": 5,
"name": "İyzico ile Öde",
"slug": "pay_with_iyzico",
"payment_type": "redirection",
"payment_type_label": "Redirect to Bank"
},
{
"pk": 3,
"name": "Pay On Delivery",
"slug": "pay-on-delivery",
"payment_type": "pay_on_delivery",
"payment_type_label": "Pay On Delivery"
}
],
"unavailable_options": []
},
"page_name": "PaymentOptionSelectionPage",
"page_slug": "paymentoptionselectionpage"
},
{
"page_context": {},
"page_name": "BinNumberPage",
"page_slug": "binnumberpage"
}
],
"template_name": "orders/checkout.html",
"errors": [],
"pre_order": {
"basket": {
"basketitem_set": [{
"quantity": 1,
"unit_price": "54.49",
"tax_rate": "20.00",
"currency_type": "eur",
"product": {
"pk": 212,
"name": "Driving Shoes Soft Leather Brown",
"sku": "AKN-010-brown001-43",
"base_code": "AKN-010",
"attributes": {
...
},
"attribute_set": 7,
"attributes_kwargs": {
...
},
"extra_attributes": {},
"productimage_set": [{
"pk": 255,
"status": "active",
"image": "https://image-url.jpg",
"order": 0,
"created_date": "2023-01-09T07:02:08.250452Z",
"specialimage_set": []
}],
"price": "54.49",
"in_stock": true,
"currency_type": "eur",
"retail_price": "69.99",
"unit_type": "qty",
"absolute_url": "/product/212/",
"productvideo_set": [],
"product_type": "0",
"price_type": "default",
"form_schema": null,
"is_ready_to_basket": false,
"stock": 997,
"data_source": null
},
"total_amount": "54.49",
"shipping_discount": null,
"currency_type_label": "EUR",
"image": null,
"datasource": null,
"datasource_detailed": null,
"extra_product_stock_detailed": null,
"extra_product_price_detailed": null
}],
"total_quantity": 1,
"total_amount": "54.49",
"total_discount_amount": "0.00",
"discounts": [],
"upsell_messages": [],
"total_product_amount": "54.49",
"pk": 73,
"created_date": "2023-02-03T09:03:04.791076Z",
"modified_date": "2023-04-10T11:30:26.634021Z"
},
"shipping_address": {
"pk": null,
"email": "[email protected]",
"phone_number": "+321321321",
"first_name": "Firsname",
"last_name": "Lastname",
"country": {
"pk": 1,
"name": "Test Country",
"code": "tr"
},
"city": {
"pk": 1,
"name": "Test City 2",
"country": 1
},
"line": "Shop 2 Address",
"title": "Shop 2",
"township": {
"pk": 1,
"name": "Test Township 3",
"city": 1
},
"district": {
"pk": 1,
"name": "Test District 3",
"city": 1,
"township": 1
},
"postcode": null,
"notes": null,
"company_name": null,
"tax_office": null,
"tax_no": null,
"e_bill_taxpayer": false,
"primary": null,
"identity_number": null,
"extra_field": null
},
"billing_address": {
"pk": 84,
"email": "[email protected]",
"phone_number": "05555555555",
"first_name": "Firsname",
"last_name": "Lastname",
"country": {
"pk": 1,
"name": "Test Country",
"code": "tr"
},
"city": {
"pk": 2,
"name": "Test City 1",
"country": 1
},
"line": "this is a test address.",
"title": "Test Title",
"township": {
"pk": 2,
"name": "Test Township 1",
"city": 2
},
"district": {
"pk": 2,
"name": "Test District 1",
"city": 2,
"township": 2
},
"postcode": "00000",
"notes": null,
"company_name": null,
"tax_office": null,
"tax_no": null,
"e_bill_taxpayer": false,
"is_corporate": false,
"primary": false,
"identity_number": null,
"extra_field": null
},
"shipping_option": {
"pk": 2,
"name": "UPS",
"slug": "ups",
"logo": null,
"shipping_amount": "8.50",
"description": null,
"kwargs": {}
},
"billing_and_shipping_same": false,
"payment_option": {
"pk": 1,
"name": "Credit Card",
"slug": "credit-card",
"payment_type": "credit_card",
"payment_type_label": "Credit Card"
},
"notifications": null,
"shipping_amount": "8.50",
"total_amount": "62.99",
"unpaid_amount": "62.99",
"loyalty_money": "0.00",
"currency_type_label": "TL",
"installment": null,
"redirect_to_three_d": null,
"delivery_option": {
"pk": 2,
"slug": "store",
"name": "Mağazadan Teslimat",
"delivery_option_type": "retail_store",
"sort_order": 1
},
"retail_store": {
"pk": 1,
"name": "Shop 2",
"township": {
"pk": 1,
"name": "Test Township 3",
"city": {
"pk": 1,
"name": "Test City 2",
"country": 1
}
},
"district": {
"pk": 1,
"name": "Test District 3",
"city": 1,
"township": 1
},
"address": "Shop 2 Address"
},
"payment_choice": null,
"phone_number": null,
"gift_box": null,
"delivery_range": null,
"user_phone_number": "05555555555",
"total_amount_with_interest": "62.99",
"is_guest": false,
"is_post_order": false
}
}useFetchCheckoutResultQuery
useGetContractQuery
useGet3dRedirectFormQuery
useGetCouponsQuery
useGetCheckoutLoyaltyBalanceQuery
useResetCheckoutStateQuery
Last updated
Was this helpful?

