Change order of products in campaign

    Change order of products in campaign


    Article summary

    Put
    /v2/{accessKey}/campaign/{campaignKey}/product/order

    This API will first sort the products in the order specified in the request body, and then append the remaining products registered in the campaign in their original order.


    Example of the ordering by customerProductIds

    The original order of customerProductIds registered in the campaign: sl09, sl08, sl07, sl06, sl05, sl04
    Order of customerProductIds after processing the request: sl04, sl05, sl07, sl09, sl08, sl06 \

     curl --location --request PUT 
    'https://private.shopliveapi.com/v2/{accessKey}/campaign/{campaignKey}/product/order'
     --header 'Accept: application/json'
     --header 'Authorization: Bearer {JWT_TOKEN}'
     --header 'Content-Type: application/json'
     --data-raw
     '[
        {"customerProductId": "sl04"},
        {"customerProductId": "sl05"},
        {"customerProductId": "sl07"}
    ]' 
    

    Error code

    HTTP Status CodeError code(_s)Error Message(_e)
    404710Campaign does not exist
    400-839One of productId or customerProductId required
    400-840Either the list does not exist or the data does not exist
    Header parameters
    Authorization
    stringRequired

    Authorization: Bearer

    Path parameters
    accessKey
    stringRequired

    Customer access key

    campaignKey
    stringRequired

    Campaign key

    Body parameters
    example

    Example body of the ordering by customerProductIds

    The original order of customerProductIds registered in the campaign: sl09, sl08, sl07, sl06, sl05, sl04 Order of customerProductIds after processing the request to be: sl04, sl05, sl07, sl09, sl08, sl06

    [
      {
        "customerProductId": "sl04"
      },
      {
        "customerProductId": "sl05"
      },
      {
        "customerProductId": "sl07"
      }
    ]
    example2

    Example of the ordering by productIds

    The original order of productIds registered in the campaign: 1239, 1238, 1237, 1236, 1235, 1234 Order of productIds after processing the request to be: 1234, 1235, 1237, 1239, 1238, 1236

    [
      {
        "productId": 1234
      },
      {
        "productId": 1235
      },
      {
        "productId": 1237
      }
    ]
    Array of object
    object
    productId
    integer (int64)

    Automatically generated unique product ID

    customerProductId
    string

    Customer's product ID and must be unique(defined by the customer).

    Responses
    200

    200

    Result
    ""
    4XX

    4XX

    Result
    "{\n    \"_s\": -000,\n    \"_e\": \"Error message\"\n}"