Receive Coupons

🔒

Requires price_rules access scope. More access scope

The Receive Coupons API enables assigning specific coupons to a customer.

This API is especially useful for:

  1. Distributing promotional coupons to targeted customers.
  2. Managing coupon assignments for specific users.
  3. Automating coupon distribution in bulk.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Body Parameters

NameTypeRequiredDescription
customer_idstringYesCustomer's unique ID to assign the coupons.
coupon_idsarray of stringsYesArray of coupon IDs to be assigned to the customer.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeDescription
statusintOperation status code.
itemsarrayList of assigned coupons and their details.
items.idstringThe ID of the assigned coupon.
items.statusintThe status of the coupon.
items.valuefloatThe value of the coupon.
items.stockintThe available stock of the coupon.
items.coupon_statusintThe current status of the coupon.
items.received_countintThe count of times the coupon has been received.
items.discount_textstringDescription of the discount applied by the coupon.
items.prerequisite_textstringAny prerequisite details for using the coupon.
items.is_first_orderboolIndicates if the coupon is for first orders only.
limitintThe maximum number of coupons that can be received.
has_moreboolIndicates if there are more coupons to receive.
cursorstringCursor for pagination.

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 Customer's ID provided is not existed.customer not exist
422CouponIds is requiredEmpty Coupon IdCouponIds is required

API Structure Overview

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