Cancel Order
PATCH/orders/{orderIdOrNumber}/cancel
The PATCH /orders/{orderIdOrNumber}/cancel
endpoint is used to cancel a specific order by updating its status to CANCELLED. This endpoint is typically used when an order needs to be stopped before it is fulfilled or processed. Write access is required to use this endpoint.
Request Method: PATCH
Endpoint URL: https://api.fungies.io/v0/orders/{orderIdOrNumber}/cancel
Headers:
x-fngs-public-key: <api-key>
x-fngs-secret-key: <api-key>
Example:
Note: This endpoint requires an API key for authentication. Refer to this guide to generate your API key.
Path Parameters
The Path Parameters are required to specify the order that needs to be canceled.
orderIdOrNumber (string) required: Identifies the specific order to cancel. This parameter accepts either the unique order ID (Option 1) or the order number (Option 2) to process the cancellation request.
Request Body
The request body for the Cancel Order API is of type object
. This body structure allows the system to process the order cancellation request, ensuring the specified order is updated accordingly.
Responses Body
Response (200) - Success
The response confirms that the order cancellation request was successfully processed.
status (string) required: Indicates the outcome of the API request. The allowed value is success, confirming that the cancellation was applied.
data (object) required: The data object contains details related to the canceled order. It includes the following children:
— data.order (object) required: This object holds the details of the order and other relevant information. It includes the following children:
data.order.id (string) required: A unique identifier assigned to the order.
data.order.number (string) required: The order number is used for reference and tracking.
data.order.status (enum) required: Represents the current status of the order. Available options:
PENDING
,PAID
,FAILED
,UNPAID
,CANCELLED
,REFUNDED
,PARTIALLY_REFUNDED
,EXPIRED
.data.order.createdAt (integer) required: The timestamp represents when the order was created. Required range: 0 <= x <= 9007199254740991
data.order.userId (string) required: The unique identifier of the user associated with the order.
data.order.orderNumber (string) required: The reference number assigned to the order for tracking purposes.
data.order.object (enum) default: order: Represents the type of object. Available options:
order
data.order.value (integer | null) default: 0: Represents the monetary value of the order. Required range: -9007199254740991 <= x <= 9007199254740991
data.order.tax (integer | null) default: 0: The amount of tax applied to the order. Required range: -9007199254740991 <= x <= 9007199254740991
data.order.fee (integer | null) default: 0: The additional fee associated with the order, such as processing or service fees. Required range: -9007199254740991 <= x <= 9007199254740991
data.order.totalItems (integer | null) default: 0: The total number of items included in the order. Required range: 0 <= x <= 9007199254740991
data.order.country (string | null): The country associated with the order, typically where it was placed or where it will be delivered.
data.order.currency (enum | null): The currency used for the order transaction. Available options:
AFN
(Afghanistan),ALL
(Albania),DZD
(Algeria),AOA
(Angola),ARS
(Argentina),AMD
(Armenia),AWG
(Aruba),AUD
(Australia),AZN
(Azerbaijan),BSD
(Bahamas),BDT
(Bangladesh),BBD
(Barbados),BZD
(Belize),BMD
(Bermuda),BOB
(Bolivia),BAM
(Bosnia and Herzegovina),BWP
(Botswana),BRL
(Brazil),BHD
(Bahrain),GBP
(United Kingdom),BND
(Brunei),BGN
(Bulgaria),BIF
(Burundi),BYN
(Belarus),KHR
(Cambodia),CAD
(Canada),CVE
(Cape Verde),KYD
(Cayman Islands),KWD
(Kuwait),XAF
(Central African CFA),XPF
(CFP Franc),CLP
(Chile),CNY
(China),COP
(Colombia),KMF
(Comoros),CDF
(Congo - Kinshasa),CRC
(Costa Rica),HRK
(Croatia),CZK
(Czech Republic),DKK
(Denmark),DJF
(Djibouti),DOP
(Dominican Republic),XCD
(East Caribbean Dollar),EGP
(Egypt),ETB
(Ethiopia),EUR
(Eurozone),FKP
(Falkland Islands),FJD
(Fiji),GMD
(Gambia),GEL
(Georgia),GIP
(Gibraltar),GTQ
(Guatemala),GNF
(Guinea),GYD
(Guyana),HTG
(Haiti),HNL
(Honduras),HKD
(Hong Kong),HUF
(Hungary),ISK
(Iceland),INR
(India),IDR
(Indonesia),ILS
(Israel),JMD
(Jamaica),JPY
(Japan),JOD
(Jordan),KZT
(Kazakhstan),KES
(Kenya),KGS
(Kyrgyzstan),LAK
(Laos),LBP
( Lebanon),LSL
(Lesotho),LRD
(Liberia),MOP
(Macau),MKD
(North Macedonia),MGA
(Madagascar),MWK
(Malawi),MYR
(Malaysia),MVR
(Maldives),MRO
(Mauritania),MUR
(Mauritius),MXN
(Mexico),MDL
(Moldova),MNT
(Mongolia),MAD
(Morocco),MZN
(Mozambique),MMK
(Myanmar),NAD
(Namibia),NPR
(Nepal),ANG
(Netherlands Antilles),TWD
(Taiwan),NZD
(New Zealand),NIO
(Nicaragua),NGN
(Nigeria),NOK
(Norway),OMR
(Oman),PKR
(Pakistan),PAB
(Panama),PGK
(Papua New Guinea),PYG
(Paraguay),PEN
(Peru),PHP
(Philippines),PLN
(Poland),QAR
(Qatar),RON
(Romania),RUB
(Russia),RWF
(Rwanda),SHP
(Saint Helena),SVC
(El Salvador),WST
(Samoa),STD
(São Tomé and Príncipe),SAR
(Saudi Arabia),RSD
(Serbia),SCR
(Seychelles),SLL
(Sierra Leone),SGD
(Singapore),SBD
(Solomon Islands),SOS
(Somalia),ZAR
(South Africa),KRW
(South Korea),LKR
(Sri Lanka),SRD
(Suriname),SZL
(Eswatini),SEK
(Sweden),CHF
(Switzerland),TJS
(Tajikistan),TZS
( Tanzania),THB
( Thailand),TND
(Tunisia),TOP
(Tonga),TTD
(Trinidad and Tobago),TRY
(Turkey),UGX
(Uganda),UAH
(Ukraine),AED
(United Arab Emirates),UYU
(Uruguay),USD
(United States),UZS
(Uzbekistan),VUV
(Vanuatu),VEF
(Venezuela),VND
(Vietnam),XOF
(West African CFA),YER
(Yemen),ZMW
(Zambia),SLE
(Sierra Leone).data.order.currencyDecimals (integer | null): Specifies the number of decimal places used in the currency format for the order. Required range: -9007199254740991 <= x <= 9007199254740991
data.order.user (object | null): Contains user-related details associated with the order. It includes the following children:
data.order.user.id (string) required: A unique identifier is assigned to the user.
data.order.user.object (enum) default: user: Specifies the type of object. The available option is user
data.order.user.username (string | null): The username of the user associated with the order.
Response (400) - Error
status (string) required: Represents the outcome of the API request. The allowed value is an error, indicating that the request was unsuccessful.
error (object) required: Contains details about the error encountered during the request. It includes the following child attributes:
error.message (string) required: A descriptive message explaining the reason for the error.
Example of Endpoint Usage
Examples of how to use the endpoint across different programming languages.
cURL
Python
JavaScript
PHP
Go
Java
Example of a Successful Response (200)
200 OK – The list of orders is successfully retrieved.
Example of Error Response (400)
400 Bad Request – Invalid query parameters.
Last updated