← Retour à la liste des opérations
Mutation

updateProduct

updateProduct(id: ID!, input: UpdateProductInput!): Product!

Informations d'appel

Point d'accès

https://api.revclic.com/

Méthode

POST

Authentification

Jeton Bearer (JWT)

Retourne

Product!

Arguments

ParamètreTypeValeur par défautStatut
idID!Obligatoire
inputUpdateProductInput!Obligatoire

Exemple de requête GraphQL

mutation ExecuteUpdateProduct($id: ID!, $input: UpdateProductInput!) {
  updateProduct(id: $id, input: $input) {
    id
    name { fr es }
    description { fr es }
    price
    pricingType { code label }
    imageUrls
  }
}

Exemple de variables

{
  "id": "1",
  "input": {
    "name": {
      "fr": "example",
      "es": "example"
    },
    "description": {
      "fr": "example",
      "es": "example"
    },
    "price": "example",
    "pricingType": "ONE_TIME_PURCHASE",
    "imageUrls": [
      "https://example.com"
    ],
    "url": "https://example.com",
    "originalName": "example",
    "requiresTranslation": true,
    "targetedMarkets": [
      "example"
    ],
    "categoryIds": [
      "1"
    ]
  }
}

Payload JSON complet

{
  "query": "mutation ExecuteUpdateProduct($id: ID!, $input: UpdateProductInput!) {\n  updateProduct(id: $id, input: $input) {\n    id\n    name { fr es }\n    description { fr es }\n    price\n    pricingType { code label }\n    imageUrls\n  }\n}",
  "variables": {
    "id": "1",
    "input": {
      "name": {
        "fr": "example",
        "es": "example"
      },
      "description": {
        "fr": "example",
        "es": "example"
      },
      "price": "example",
      "pricingType": "ONE_TIME_PURCHASE",
      "imageUrls": [
        "https://example.com"
      ],
      "url": "https://example.com",
      "originalName": "example",
      "requiresTranslation": true,
      "targetedMarkets": [
        "example"
      ],
      "categoryIds": [
        "1"
      ]
    }
  }
}

Exemple cURL à tester

curl -X POST https://api.revclic.com/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{
  "query": "mutation ExecuteUpdateProduct($id: ID!, $input: UpdateProductInput!) {\n  updateProduct(id: $id, input: $input) {\n    id\n    name { fr es }\n    description { fr es }\n    price\n    pricingType { code label }\n    imageUrls\n  }\n}",
  "variables": {
    "id": "1",
    "input": {
      "name": {
        "fr": "example",
        "es": "example"
      },
      "description": {
        "fr": "example",
        "es": "example"
      },
      "price": "example",
      "pricingType": "ONE_TIME_PURCHASE",
      "imageUrls": [
        "https://example.com"
      ],
      "url": "https://example.com",
      "originalName": "example",
      "requiresTranslation": true,
      "targetedMarkets": [
        "example"
      ],
      "categoryIds": [
        "1"
      ]
    }
  }
}'

Types associés