Query a mutace

Níže je seznam všech query a mutací, které můžete na našem API používat.

V ukázce jsou // komentáře pro okomentování jednotlivých částí kódu. Před spuštěním dotazu je odebrte, jinak volání dotazu do API skončí chybou.

Také můžete používat vlastní měnu (pokud se tedy nejedná o testovací prostředí, kde některé brány povolují pouze určitou měnu).

 Gateway Action (mutation)

Spuštění události pomocí platební brány:

mutation gatewayAction($input: GatewayActionMutationInput!) {
  gatewayAction(input: $input) {
    result {
      status
      description
      data
    }
  }
}

proměnné:

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "braintree",
    "action": "clientToken",
    "parameters": {}
  }
}

Adyen

Získej detail platby

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "adyen",
    "action": "paymentDetails",
    "parameters": {
      "details": {
        "MD": "", //given from Pay mutation
        "PaRes": "" //given from Pay mutation
      },
      "paymentData": "" //optional
    }
  }
}

Získej platební metody

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "adyen",
    "action": "paymentMethods",
    "parameters": {
      "countryCode": "CZ", //optional
      "channel": "", //optional
      "amount": { //optional
        "currency": "EUR",
        "value": "1000"
      }
    }
  }
}

Získej výsledek platby

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "adyen",
    "action": "paymentResult",
    "parameters": {
      "payload": "" //given from Pay mutation
    }
  }
}

Braintree

Vytvoř uživatelský token

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "braintree",
    "action": "clientToken",
    "parameters": {
      "customerId": "123" //optional ID from gateway
    }
  }
}

PayU

Získej seznam všech platebních metod

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "action": "payMethods",
    "parameters": {
      "lang": "en" //optional
    }
  }
}

Ukonči platbu

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "action": "cancel",
    "parameters": {
      "orderId": "xxx" //returned id from gateway after Pay mutation
    }
  }
}

Získej informace o platbě

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "action": "retrieve",
    "parameters": {
      "orderId": "xxx" //returned id from gateway after Pay mutation
    }
  }
}

Získej informace o transakci

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "action": "retrieveTransaction",
    "parameters": {
      "orderId": "xxx" //returned id from gateway after Pay mutation
    }
  }
}

Změň stav objednávky

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "action": "statusUpdate",
    "parameters": {
      "orderId": "xxx", //returned id from gateway after Pay mutation
      "orderStatus": "COMPLETED" //or REJECTED
    }
  }
}

Stripe

Načti poplatek

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "stripe",
    "action": "chargeRetrieve",
    "parameters": {
      "id": "" //ID given from gateway
    }
  }
}

Pay (mutation)

Zaplať pomocí platební brány:

mutation pay($input: PayMutationInput!) {
  pay(input: $input) {
    result {
      status
      description
      data
    }
  }
}

s proměnnými:

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "braintree",
    "payment": "nonce",
    "orderId": "AB012345",
    "parameters": {
      "amount": 10,
      "nonce": "fake-valid-nonce"
    }
  }
}

Adyen

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "adyen",
    "payment": "payments",
    "orderId": "1977200894",
    "parameters": {
      "paymentMethod": "", //data from JS gateway plugin
      "returnUrl": "https://www.example.com/successful-payment",
      "amount": {
        "currency": "EUR",
        "value": 10000
      }
    }
  }
}

Braintree

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "braintree",
    "payment": "nonce",
    "orderId": "1977200894",
    "parameters": {
      "amount": "10000",
      "nonce": "", //nonce from JS gateway plugin
      "customer": { //optional
        "firstName": "John",
        //...
      },
      "billing": { //optional
        "firstName": "John",
        //...
      },
      "shipping": { //optional
        "firstName": "John",
        //...
      }
    }
  }
}

PayU

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "pay_u",
    "payment": "order",
    "orderId": "1977200894",
    "parameters": {
      "continueUrl": "https://www.example.com/successful-payment",
      "currencyCode": "PLN",
      "totalAmount": "10000",
      "products": [
        {
          "name": "Red t-shirt",
          "unitPrice": "10000",
          "quantity": 1
        }
      ],
      "buyer": { //optional
        "email": "john.doe@example.com",
        "phone": "123123123",
        "firstName": "John",
        "lastName": "Doe",
        "language": "en"
      },
      "delivery": { //optional
        "recipientName": "John Doe",
        "recipientEmail": "john.doe@example.com",
        "recipientPhone": "123123123",
        "street": "Rybná 123",
        "postalBox": "",
        "postalCode": "11100",
        "city": "Prague",
        "state": "Czech Republic",
        "countryCode": "CZ"
      },
      "payMethod": { //optional
        "type": "PBL", //or "CARD_TOKEN", "INSTALLMENTS"
        "value": "c" //see GatewayAction "payMethods"
      }
    }
  }
}

Stripe

{
  "input": {
    "token": "Q84lNQyLl?nBGvKxxbcdc!nWFKEZrK?L_Is2r9IaOJo14ONbXw1SMlPIeptcaFza",
    "environment": "sandbox",
    "gateway": "stripe",
    "payment": "charge",
    "orderId": "1977200894",
    "parameters": {
      "amount": "10000",
      "currency": "EUR",
      "source": "" //source from JS gateway plugin
    }
  }
}

 

Vytvořte si e-shop do 5 minut

Zkuste to. Je to zdarma.