Search Discount Code

🔒

Requires price_rules access scope. More access scope

The Search Discount Code API allows you to find a specific discount code by providing its code.

This API is especially useful for:

  1. Retrieving detailed information about a specific discount code.
  2. Verifying if a discount code exists in the system.
  3. Fetching metadata and usage statistics for a specific discount code.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Query Parameters

FieldTypeRequiredExampleDescription
codestringYes"SUMMERSALE100FF"The unique discount code to be searched for.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
discount_codeobjectSee below.The details of the discount code.
discount_code.idstring"f819c126-a581-4d66-a909-08282dd35916"Unique identifier for the discount code.
discount_code.price_rule_idstring"588fea0b-f15d-4c1d-9390-23661f0194fa"Identifier of the associated price rule.
discount_code.codestring"VIJK8GB0"The discount code value.
discount_code.created_atstring"2022-06-17 07:48:29"Creation timestamp of the discount code.
discount_code.updated_atstring"2022-06-17 07:48:29"Last updated timestamp of the discount code.
discount_code.use_with_otherstring"1"Indicates if the discount can be combined with others.
discount_code.usage_countstring"0"Number of times the discount code has been used.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray[ "invalid line_item id"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Not FoundThe ID provided is not existed.Not Found

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!