← Retour à la liste des opérations
Mutation

createProduct

createProduct(merchantId: ID!, input: CreateProductInput!): 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
merchantIdID!Obligatoire
inputCreateProductInput!Obligatoire

Exemple de requête GraphQL

mutation ExecuteCreateProduct($merchantId: ID!, $input: CreateProductInput!) {
  createProduct(merchantId: $merchantId, input: $input) {
    id
    name { fr es }
    description { fr es }
    price
    pricingType { code label }
    imageUrls
  }
}

Exemple de variables

{
  "merchantId": "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 ExecuteCreateProduct($merchantId: ID!, $input: CreateProductInput!) {\n  createProduct(merchantId: $merchantId, input: $input) {\n    id\n    name { fr es }\n    description { fr es }\n    price\n    pricingType { code label }\n    imageUrls\n  }\n}",
  "variables": {
    "merchantId": "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 ExecuteCreateProduct($merchantId: ID!, $input: CreateProductInput!) {\n  createProduct(merchantId: $merchantId, input: $input) {\n    id\n    name { fr es }\n    description { fr es }\n    price\n    pricingType { code label }\n    imageUrls\n  }\n}",
  "variables": {
    "merchantId": "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