Requires write_orders access scope.
For more info , refer to:
POST https://{handle}.myshopline.com/admin/openapi/v20230301/orders/:id/cancel.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .
Cancel order
Path Parameters
  • id string required
    Order number
    Example: "21050342939778451436179579"
Request Headers
  • Content-Type required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
  • amount double
    amount
    Example: 100
  • cancel_reason string
    cancelReason
    Example: I don't want to buy it.
  • currency string
    currency
    Example: "CNY"
  • email boolean
    Send mail or not
  • processed_at string
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • orderobject
    For order information, field descriptions and examples, please refer to the response result of the order list
  • app_id string
    App ID
  • billing_addressobject
    billingAddress
  • address1 string
    address1
  • address2 string
    address2
  • city string
    city
  • company string
    Company name
  • country string
    country
  • country_code string
    countryCode
  • first_name string
    firstName
  • last_name string
    lastName
  • name string
    name
  • phone string
    phone
  • province string
    province
  • province_code string
    provinceCode
  • zip string
    zip
  • browser_ip string
    browserIp
  • cancel_reason string
    cancelReason
  • cancelled_at string
    cancelledAt
  • cart_token string
    cartToken
  • checkout_id string
    Discard id
    Example: 2404785166526352972864
  • checkout_token string
    checkoutToken
  • client_detailsobject
    clientDetails
  • browser_ip string
    browserIp
  • session_hash string
    sessionHash
  • user_agent string
    userAgent
  • created_at string
    createdAt
  • currency string
    currency
  • current_subtotal_price string
    currentSubtotalPrice
  • current_subtotal_price_setobject
    currentSubtotalPriceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • current_total_discounts string
    currentTotalDiscounts
  • current_total_discounts_setobject
    currentTotalDiscountsSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • current_total_price string
    currentTotalPrice
  • current_total_price_setobject
    currentTotalPriceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • current_total_tax string
    currentTotalTax
  • current_total_tax_setobject
    currentTotalTaxSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • customerobject
    customer
  • addressesobject
    addresses
  • address1 string
    address1
  • address2 string
    address2
  • city string
    city
  • country string
    country
  • country_code string
    countryCode
  • first_name string
    firstName
  • last_name string
    lastName
  • name string
    name
  • phone string
    phone
  • province string
    province
  • province_code string
    provinceCode
  • zip string
    zip
  • area_code string
    areaCode
  • created_at string
    createdAt
  • currency string
    currency
  • email string
    email
  • first_name string
    firstName
  • id string
    id
  • last_name string
    lastName
  • phone string
    phone
  • updated_at string
    updatedAt
  • customer_locale string
    customerLocale
  • deduct_member_point_amount string
    Current order membership credit
  • discount_applicationsobject[]
    All discount information for this order application
  • allocation_method string
    Discount application range 1 ) across ( the value is distributed in all authorized lines ) 2 ) the echo ( the value is applied to each authorized line )
    Example: across
  • code string
    Specific description of the event
    Example: 1Q3UMQM8RBP5
  • description string
    Specific description of the event
    Example: Description
  • target_selection string
    Discount application for event specific object 1 ) explicit ( discount distribution to clear selected Product or shipping ) 2 ) all ( discount distribution to all Product or shipping ) 3 ) ENTITLED ( discount only distribution to its right to the shipping line ) 3 ) ENTITLED ( discount only to the shipping line of the
    Example: explicit
  • target_type string
    Discount application for event object 1 ) line_item 2 ) shipping_line
    Example: line_item
  • title string
    Specific description of the event
    Example: Description
  • type string
    Event discount type 1 ) manual 2 ) automatic ( auto discount type ) 3 ) discount_code ( discount code type )
    Example: manual
  • value string
    Discount value for event
    Example: 20
  • value_type string
    Activity discount value type , containing percentage and fixed amount two types
    Example: fixed_amount
  • discount_codesobject[]
    discountCodes
  • amount string
    amount
  • code string
    code
  • type string
    type
  • email string
    email
  • financial_status string
    financialStatus
    Example: "paid"
  • fulfillment_status string
    fulfillmentStatus
  • fulfillmentsobject[]
    fulfillments
  • created_at string
    createdAt
  • id string
    id
  • line_itemsobject[]
    lineItems
  • fulfillable_quantity integer
    fulfillableQuantity
  • fulfillment_service string
    fulfillmentService
  • fulfillment_status string
    fulfillmentStatus
  • grams double
    grams
  • id string
    id
  • name string
    name
  • price string
    price
  • product_id string
    productId
  • quantity integer
    quantity
  • requires_shipping boolean
    requiresShipping
  • sku string
    sku
  • tax_linesobject[]
    taxLines
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • rate double
    rate
  • title string
    title
  • taxable boolean
    taxable
  • title string
    title
  • variant_id string
    variantId
  • variant_title string
    variantTitle
  • vendor string
    vendor
  • order_id string
    orderId
  • shipment_status string
    shipmentStatus
  • status string
    status
  • tracking_company string
    trackingCompany
  • tracking_number string
    trackingNumber
  • tracking_url string
    trackingUrl
  • updated_at string
    updatedAt
  • id string
    id
  • line_itemsobject[]
    lineItems
  • discount_allocationsobject[]
    Marketing discount detail amount multi-currency
  • amount string
    Discount details
    Example: 8.00
  • amount_setobject
    Discount details multi-currency
  • presentment_moneyobject
    Payment currency
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • shop_moneyobject
    Store currency
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • discount_application_index integer
    Discount index information : marked in the position of the discount details
    Example: 1
  • fulfillable_quantity integer
    fulfillableQuantity
  • fulfillment_service string
    fulfillmentService
  • fulfillment_status string
    fulfillmentStatus
  • gift_card boolean
    Whether it is a gift card product
  • grams double
    grams
  • id string
    id
  • location_id string
    Pos location
    Example: 5327026538935748524
  • name string
    name
  • price string
    price
  • product_id string
    productId
  • quantity integer
    quantity
  • requires_shipping boolean
    requiresShipping
  • sku string
    sku
  • tax_linesobject[]
    taxLines
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • rate double
    rate
  • title string
    title
  • type string
    Tax fee type , used to distinguish whether it is a product tax or a shipping tax , the value of the item is as follows : product_tax : product tax shipping_tax : shipping tax
    Example: shipping_tax
  • taxable boolean
    taxable
  • title string
    title
  • variant_id string
    variantId
  • variant_title string
    variantTitle
  • vendor string
    vendor
  • name string
    name
  • note string
    note
  • note_attributesobject[]
    noteAttributes
  • create_time string
    createTime
  • name string
    name
  • value string
    value
  • order_status_url string
    orderStatusUrl
  • payment_detailsobject[]
    paymentDetails
  • create_time string
    createTime
  • order_seq string
    orderSeq
  • pay_amount double
    payAmount
  • pay_channel_deal_id string
    payChannelDealId
  • pay_seq string
    paySeq
  • pay_status string
    payStatus
  • payment_gateway_names array
    paymentGatewayNames
    Example: ``
  • phone string
    phone
  • presentment_currency string
    presentmentCurrency
  • processed_user_id string
    Order creator
    Example: 4201057495
  • refundsobject[]
    refunds
  • created_at string
    createdAt
  • id string
    id
  • note string
    note
  • order_id string
    orderId
  • processed_at string
    processedAt
  • refund_line_itemsobject[]
    refundLineItems
  • id string
    id
  • line_itemobject
    lineItem
  • fulfillable_quantity integer
    fulfillableQuantity
  • fulfillment_service string
    fulfillmentService
  • fulfillment_status string
    fulfillmentStatus
  • grams double
    grams
  • id string
    id
  • name string
    name
  • price string
    price
  • product_id string
    productId
  • quantity integer
    quantity
  • requires_shipping boolean
    requiresShipping
  • sku string
    sku
  • tax_linesobject[]
    taxLines
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • rate double
    rate
  • title string
    title
  • taxable boolean
    taxable
  • title string
    title
  • variant_id string
    variantId
  • variant_title string
    variantTitle
  • vendor string
    vendor
  • line_item_id string
    lineItemId
  • quantity integer
    quantity
  • restock_type string
    restockType
  • subtotal double
    subtotal
  • subtotal_setobject
    subtotalSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • total_tax double
    totalTax
  • total_tax_setobject
    totalTaxSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • transactionsobject[]
    transactions
  • amount string
    amount
  • created_at string
    createdAt
  • currency string
    currency
  • id string
    id
  • kind string
    kind
  • order_id string
    orderId
  • processed_at string
    processedAt
  • status string
    status
  • user_id string
    userId
  • user_id string
    userId
  • shipping_addressobject
    shippingAddress
  • address1 string
    address1
  • address2 string
    address2
  • city string
    city
  • company string
    Company name
  • country string
    country
  • country_code string
    countryCode
  • first_name string
    firstName
  • last_name string
    lastName
  • latitude string
    Latitude
  • longitude string
    Longitude
  • name string
    name
  • phone string
    phone
  • province string
    province
  • province_code string
    provinceCode
  • zip string
    zip
  • shipping_linesobject[]
    shippingLines
  • code string
    code
  • discount_allocationsobject[]
    Discount details
  • amount string
    Discount amount, precision 2
    Example: 8.00
  • amount_setobject
    Discount multi-currency amount
  • presentment_moneyobject
    Buyer side amount information
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • shop_moneyobject
    Store side amount information
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • discount_application_index integer
    Discount index information : marked in the position of the discount details
    Example: 1
  • discounted_price string
    discountedPrice
  • discounted_price_setobject
    Discount multi-currency amount
  • presentment_moneyobject
    Buyer side amount information
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • shop_moneyobject
    Store side amount information
  • amount string
    Amount, Precision 2
    Example: 8.00
  • currency_code string
    Currency
    Example: USD
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • requested_fulfillment_service_id string
    Transportation service code
  • shipping_price string
    Original shipping value ( non-discounted amount )
    Example: 8.00
  • source string
    Shipping source
    Example: SHOPLINE
  • tax_linesobject[]
    taxLines
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • rate double
    rate
  • title string
    title
  • title string
    title
  • store_id string
    storeId
  • subtotal_price string
    subtotalPrice
  • subtotal_price_setobject
    subtotalPriceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • tags string
    tags
  • tax_linesobject[]
    taxLines
  • price string
    price
  • price_setobject
    priceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • rate double
    rate
  • title string
    title
  • tax_number string
    taxNumber
  • tax_type string
    taxType
  • taxes_included boolean
    taxesIncluded
  • total_discounts string
    totalDiscounts
  • total_discounts_setobject
    totalDiscountsSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • total_line_items_price string
    totalLineItemsPrice
  • total_line_items_price_setobject
    totalLineItemsPriceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • total_outstanding string
    totalOutstanding
  • total_shipping_price_setobject
    totalShippingPriceSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • total_tax string
    totalTax
  • total_tax_setobject
    totalTaxSet
  • presentment_moneyobject
    presentmentMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • shop_moneyobject
    shopMoney
  • amount string
    amount
  • currency_code string
    currencyCode
  • total_tip_received string
    totalTipReceived
  • total_weight double
    totalWeight
  • updated_at string
    updatedAt
  • user_id string
    userId
    Example: 4201057495
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20230301

ParamOptions

— path required
— header required

Body

required
{
  "amount": 100,
  "cancel_reason": "I don't want to buy it.",
  "currency": "\"CNY\"",
  "email": false,
  "processed_at": ""
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20230301/orders/id/cancel.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Was this article helpful to you?

Error loading component.

Error loading component.