Skip to main content

Update Cross-sell

Sparse-update a cross-sell. Only the keys you send are changed. discount: null clears the discount. parent_id: null roots the offer. validity_minutes: null clears the timer. Sending amount or currency returns 422. Unknown keys return 422.

Live writes return 409 when the owner product has has_draft: true. Draft writes require draft_version.

Request

Live:

  • PATCH /cross-sells/{id}

Draft:

  • PATCH /products/{productId}/draft/cross-sells/{id}

Path Parameters

ParameterTypeRequiredDescription
productIdstringDraft onlyOwner product UUID.
idstringYesCross-sell UUID.

Request Body

All fields optional. Draft writes also require draft_version.

ParameterTypeRequiredDescription
product_idstringNoOffered product UUID.
variant_idstringNoOffered variant UUID.
parent_idstringNoParent cross-sell UUID. null roots.
titlestringNoOffer headline. null clears it.
main_descriptionstringNoThank-you body. null clears it.
descriptionstringNoStored override description. null clears it.
button_textstringNoCall-to-action label. null clears it.
discountobjectNoNested discount. null clears it. See Discount.
validity_minutesintegerNoThank-you window in minutes. null clears the timer. Minimum 1 when set.
one_purchasebooleanNoWhen true, the signed checkout can be used once.
send_offerbooleanNoInclude this offer in the confirmation email.
activebooleanNofalse hides at thank-you without deleting.
draft_versionintegerDraft onlyCurrent overlay version. Minimum 1.

Example Request

curl -X PATCH "https://cart.easy.tools/api/v1/cross-sells/37643a70-be0f-4f09-ae36-c36e3ddb35dc" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"button_text": "Yes, add it"
}'

Draft update adds "draft_version": 15 to the body and uses the /products/{productId}/draft/cross-sells/{id} path.

Response

Success Response (200)

Returns the updated Cross-sell Object. Draft updates also include draft_version and preview_url.

{
"id": "37643a70-be0f-4f09-ae36-c36e3ddb35dc",
"product_id": "70dbd819-fac2-4dcf-b655-fb925e24410b",
"variant_id": "5272bfcf-4e92-458d-b513-80ca474a16e4",
"parent_id": null,
"title": "Add the workbook",
"main_description": null,
"description": null,
"button_text": "Yes, add it",
"amount": 4900,
"currency": "usd",
"discount": null,
"validity_minutes": 15,
"one_purchase": true,
"send_offer": true,
"active": true
}

Error Responses

Bad Request (400)

{
"message": "Invalid cross-sell ID"
}

Not Found Error (404)

{
"message": "Cross-sell with ID 37643a70-be0f-4f09-ae36-c36e3ddb35dc not found"
}

Conflict Error (409 — Unpublished Draft)

Live write while has_draft is true:

{
"message": "This product has an unpublished draft. Publish, unpublish, or delete the draft before making live changes."
}

Conflict Error (409 — Stale Draft Version)

Draft write when draft_version does not match:

{
"message": "The draft was edited elsewhere. GET the draft and retry with the current draft_version."
}

Validation Error (422 Unprocessable Entity)

Same field rules as Create Cross-sell. Sending amount or currency also returns 422. Named-field failures use { message, errors }; failures that do not belong to one field use a flat { message }.

{
"message": "The given data was invalid.",
"errors": {
"currency": ["The currency field is not allowed."]
}
}

Unauthorized Error (401)

{
"message": "Unauthenticated."
}

Forbidden Error (403)

{
"message": "You do not have API access to the requested store."
}