# Updated Issuance return

Use a PATCH method for updating the status of an existing order, enabling actions such as RETURN, PARTIAL RETURN. Utilize the PATCH method within the Issuance API to modify the order status of a shipment to return status as specified in the input parameter.
Note: For all date-time fields in the request and response, if the timestamp contains a timezone offset after the + symbol (for example, 2024-07-21T12:30:45+05:30), the value after + will be ignored during processing. Only the date and time portion before the + sign will be considered.

Endpoint: PATCH /issuance- Updated Issuance return
Version: 3.0.0
Security: MuseumPlaceholderAuth

## Security:

  - `MuseumPlaceholderAuth` (unknown)

## Request fields (application/json):

  - `orderId` (string, required)
    Enter the order ID for the order.
    Example: 12345

  - `userId` (string, required)
    Enter the unique user ID of the loyalty member.
    Example: user@domain.com

  - `actionId` (integer, required)
    Enter the action ID.
    Example: 174

  - `source` (string)
    Enter the source of where the order was placed by the loyalty member, such as web or store.
    Example: Web

  - `coupon` (string)
    Enter the name of the coupon.
    Example: acdb2344

  - `orderTotalSpend` (integer, required)
    Enter the total amount spent on the order in dollars..
    Example: 100

  - `orderTotalPoints` (integer, required)
    Enter the total number of points users earned on a particular order.
    Example: 500

  - `orderDiscountAmount` (integer)
    Enter the total discount amount on the placed order.
    Example: 50

  - `orderStatus` (string, required)
    Enter the order status as RETURN.
    Example: Return

  - `pointType` (string)
    Enter the point type.
    Example: Regular

  - `orderDate` (string)
    Enter the order date in yyyy-MM-dd format. It becomes a required field when backdated orders are enabled.
    Example: 2024-06-19

  - `orderShipDate` (string)
    Enter the shipping date for the order in yyyy-MM-dd format.
    Example: 2024-06-19

  - `storeId` (string)
    Enter the unique ID of the store.
    Example: IN12369

  - `productDetails` (object)
    Enter the array of product details presented in the productDetail object as follows.

  - `productDetails.productId` (string)
    Enter the product ID.
    Example: p1

  - `productDetails.productName` (string)
    Enter the product name.
    Example: wool sweater

  - `productDetails.productQuantity` (integer)
    Enter the quantity of the product that has been purchased.
    Example: 23

  - `productDetails.productPrice` (integer)
    Enter the price per unit for the product.
    Example: 100

  - `productDetails.productDiscountAmount` (integer)
    Enter the total product discount amount applied to the transaction.
    Example: 10

  - `productDetails.productCouponCode` (string)
    Enter the name of a product coupon code applied to the order.
    Example: abcd2344

  - `productDetails.productTotalAmount` (integer)
    Enter the total amount of the order placed by the loyalty member.
    Example: 200

  - `productDetails.productTotalPoints` (integer)
    Enter the total points.
    Example: 200

  - `productDetails.productDescription` (string)
    Enter the product description.
    Example: iPad came with p10 chip and one week battery support.

  - `productDetails.productShipDate` (string)
    Enter the date when the product will be shipped in the format yyyy-MM-dd.
    Example: 22023-12-11

  - `productDetails.issuanceProductAttribute` (object)
    issuanceProductAttribute may have multiple dynamic product attributes and values.

  - `productDetails.issuanceProductAttribute.issuanceOrderAttribute` (object)
    This object contain multiple dynamic attributes and its values.

  - `productDetails.issuanceProductAttribute.issuanceOrderAttribute.attribute` (string)
    Enter attribute name and value information.
    Example: Quantity

## Response 200:

  - `200` (unknown)
    successful operation

## Response 200 fields (application/json):

  - `userId` (string)
    Displays the unique ID of the member.
    Example: user@domain.com

  - `orderId` (string)
    Displays the unique ID of the order.
    Example: 12345

  - `actionId` (integer)
    Displays the unique action ID for the action established in the loyalty program.
    Example: 174

  - `source` (string)
    Displays the source, meaning where the order was placed by the loyalty member, such as web or store.
    Example: Web

  - `coupon` (string)
    Displays the name of a coupon code, if a code was applied on the order.
    Example: acdb2344

  - `orderTotalSpend` (integer)
    Displays the total amount spent on the order.
    Example: 100

  - `orderTotalPoints` (integer)
    Displays the total number of points the awarded to the member for a specific order.
    Example: 500

  - `pointsAwarded` (integer)
    Displays the total points awarded for the order.
    Example: 500

  - `pointsExpirationDate` (string)
    Displays the date on which the points are set to expire in yyyy-MM-dd'T'HH:mm:ssZ format.
    Example: 2025-11-15T02:06:35+0000

  - `orderDiscountAmount` (integer)
    Displays the total discount amount applied to the order.
    Example: 50

  - `orderStatus` (string)
    Displays order status as Return.
    Example: Return

  - `pointType` (string)
    Displays the Point Type.
    Example: Regular

  - `orderDate` (string)
    Displays the order date in yyyy-MM-dd format.
    Example: 2024-06-19

  - `orderShipDate` (string)
    Displays the date the product will be shipped in yyyy-MM-dd format.
    Example: 2024-06-19

  - `storeDetails` (object)
    Store details will return the store name, and store attributes as well. The store attributes may vary store by store based on the attributes defined.

  - `storeDetails.storeId` (string)
    Displays the unique ID of the store.
    Example: IN12369

  - `storeDetails.productDetail` (object)
    Displays the following parameters.

  - `storeDetails.productDetail.productId` (string)
    Displays the Product ID.
    Example: P1

  - `storeDetails.productDetail.productName` (string)
    Displays the Product Name.
    Example: iPad

  - `storeDetails.productDetail.productQuantity` (integer)
    Displays the quantity of the product purchased in the order.
    Example: 2

  - `storeDetails.productDetail.productPrice` (integer)
    Displays the unit price for the product.
    Example: 100

  - `storeDetails.productDetail.productDiscountAmount` (integer)
    Displays the total discount amount applied to the order.
    Example: 100

  - `storeDetails.productDetail.productCouponCode` (string)
    Displays the name of a product coupon code, if a code was applied on the order.
    Example: acdb2344

  - `storeDetails.productDetail.productTotalAmount` (integer)
    Displays the total amount spent on the order.
    Example: 500

  - `storeDetails.productDetail.productTotalPoints` (integer)
    Displays the number of points the member earns.
    Example: 200

  - `storeDetails.productDetail.productDescription` (string)
    Displays the product information.
    Example: iPad came with p10 chip and one week battery support.

  - `storeDetails.productDetail.productShipDate` (string)
    Displays the date the product will be shipped in yyyy-MM-dd format.
    Example: 2023-12-11

  - `storeDetails.productDetail.issuanceProductAttribute` (object)
    Displays the product attributes for the created product.

  - `storeDetails.productDetail.issuanceProductAttribute.issuanceOrderAttribute` (object)
    Displays the order attribute which passes values while creating the order.

  - `storeDetails.productDetail.issuanceProductAttribute.issuanceOrderAttribute.attribute` (string)
    Enter attribute name and value information.
    Example: Quantity

  - `storeDetails.productDetail.campaignDetails` (object)
    Displays the following information once the campaign milestone benefit activity flag is enabled in the super admin.

  - `storeDetails.productDetail.campaignDetails.campaignGroupId` (integer)
    Displays the group ID associated with the campaign.
    Example: 1654

  - `storeDetails.productDetail.campaignDetails.campaignId` (integer)
    Displays the campaign ID.
    Example: 3692

  - `storeDetails.productDetail.campaignDetails.campaignName` (string)
    Displays the name of the campaign.
    Example: Back to School Savings

  - `storeDetails.productDetail.campaignDetails.campaignPoints` (integer)
    Displays the campaign points awarded to the member once they achieve the campaign milestones.
    Example: 200

  - `storeDetails.productDetail.campaignDetails.rewardId` (integer)
    Displays the unique ID for the reward configured in the loyalty program.
    Example: 2345

  - `storeDetails.productDetail.campaignDetails.rewardName` (string)
    Displays the name of the reward used by the member.
    Example: Jockey $15.00 off purchase

  - `storeDetails.productDetail.campaignDetails.rewardCode` (string)
    Displays the reward code used by the member.
    Example: AP232

## Response 201:

  - `201` (unknown)
    successful operation

## Response 400:

  - `400` (unknown)
    AC 6057 Insufficient points balance to process the return. | AC6058 Insufficient group points balance to process the return. | AC6001 The Order ID Is Already Exist | AC6002 The Order ID Cannot Be Blank | AC6003 User ID Is Missing | AC6004 User ID Cannot Be Blank | AC6005	Action ID Is Missing| AC6006	Source Is Missing| AC6007	Coupon Is Missing | AC6008	Order Total Spend Is Missing | AC6009	The Order Status Is Missing | AC6010	Point Type Is Missing | AC6011	The Product Details Are Missing | AC6012	Product ID Is Missing | AC6013	Product ID Cannot Be Blank | AC6014	The Order Date Cannot Be A Future Date | AC6015	Product Quantity Is Missing | AC6016	Incorrect Product Total Points | AC6017	Incorrect Product Total Amount | AC6018	Product Total Amount Is Missing | AC6019	Product Total Points Is Missing | AC6020	User ID Does Not Exist | AC6023	The Order Status Cannot Be Blank | AC6024	Invalid Order Status | AC6025	The Order Is Already Cancelled | AC6026	Invalid Point Type | AC6027	Store ID Can Not Be Blank | AC6028	Order Total Points Is Missing | AC6029	Incorrect Order Total Spend | AC6030	Insufficiant Quantity | AC6031	Incorrect Order Total Points | AC6032	Incorrect Order Discount Amount | AC6034	The Order Is Already Shipped | AC6035	The Product Is Already Shipped | AC6036	The Product Is Already Cancelled | AC6037	Order Ship Date Is Missing | AC6039	Cannot Return This Order | AC6041	Unable To Deduct Points As Debit Points Are More Than Available Points | AC6042	Order Must Ship Before Return |  AC6043	Incorrect Product Quantity | AC6044	Incorrect Product Price | AC6045	Incorrect Product Discount Amount | AC6046	Product Price Is Missing | AC6047	Order Total Spend Cannot Be In Negative | AC6048	Order Total Points Cannot Be In Negative | AC6049	Order Discount Amount Cannot Be In Negative | AC6050	Product Quantity Cannot Be In Negative | AC6051	Product Price Cannot Be In Negative | AC6052	Product Discount Amount Cannot Be Negative |AC6053	Product Total Amount Cannot Be In Negative | AC6054	Product Total Points Cannot Be In Negative | AC6055	Product ID Not Found Against This Order ID | AC1001	Oops! Something went wrong | AC1003	Method Not Allowed | AC1004	Missing Parameters | AC1005	No data found | AC1012	User not found | AC4004	User has Opted out | AC4007	Order ID is missing | AC4009	Order ID does not exist  | AC4014	Invalid Order Date format

## Response 401:

  - `401` (unknown)
    Invalid Product Ship Date Format

## Response 404:

  - `404` (unknown)
    AC6021	The Action Is Not Configured | AC6022	The Order ID Is Already Exist | AC6033	Invalid Order Ship Date format | AC6040	The Order Is Already Returned

## Response 422:

  - `422` (unknown)
    Invalid Order ID

