Remplacer une unité libre
Remplacez le code ou fichier sans changer sa place. La modification figure dans l’historique du stock.
POST
/api/v1/inventory/products/{product_id}/digital-units/{unit_id}/replacementRequête cURL
curl --disable --globoff --fail-with-body --silent --show-error \
--proto '=https' --connect-timeout 5 --max-time 30 \
--request POST \
--url https://shop.onshopently.com/api/v1/inventory/products/example/digital-units/00000000-0000-4000-8000-000000000003/replacement \
--header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN' \
--header 'Idempotency-Key: b8d3ed25-9cdc-581d-9008-5d215c7cd1c3' \
--header 'Content-Type: application/json' \
--data-raw '{"code":"SYNTHETIC-REPLACEMENT","expected_version":1,"reason":"Replace an invalid activation code"}'
Réponse
{
"data": {
"deleted": false,
"id": "00000000-0000-4000-8000-000000000003",
"version": 2
},
"meta": {
"request_id": "example-request"
}
}
Autorisations requises
- Authentification
- Jeton d’accès
- Disponible à partir de
- STANDARD
- Autorisation de la clé
- Gérer les codes et fichiers disponibles
inventory.digital_unit:write