younifyd
Menu

createPayment

Create a new payment.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the createPayment action (under Create).
  3. Fill in the fields below, then reference the result from later steps as {{createpayment.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CreatePayment($draft: PaymentDraft!) {
  createPayment(draft: $draft) {
    key
    customerRef {
      typeId
      id
    }
    customer {
      id
      customerNumber
      email
      addresses {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      defaultShippingAddressId
      defaultBillingAddressId
      shippingAddressIds
      billingAddressIds
      isEmailVerified
      customerGroupRef {
        typeId
        id
      }
      externalId
      key
      authenticationMode
      firstName
      lastName
      middleName
      title
      locale
      salutation
      dateOfBirth
      companyName
      vatId
      password
      customerGroup {
        id
        version
        name
        key
        createdAt
        lastModifiedAt
        custom
        createdBy
        lastModifiedBy
      }
      defaultShippingAddress {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      defaultBillingAddress {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      shippingAddresses {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      billingAddresses {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      storesRef {
        typeId
        key
      }
      stores {
        id
        version
        key
        nameAllLocales
        languages
        countries
        productSelections
        distributionChannelsRef
        distributionChannels
        supplyChannelsRef
        supplyChannels
        storefront
        createdAt
        lastModifiedAt
        custom
        createdBy
        lastModifiedBy
      }
      customerGroupAssignments {
        customerGroupRef
        customerGroup
      }
      custom {
        typeRef
        type
      }
      version
      createdAt
      lastModifiedAt
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    anonymousId
    interfaceId
    amountPlanned {
      type
      currencyCode
      centAmount
      fractionDigits
    }
    paymentMethodInfo {
      paymentInterface
      method
      nameAllLocales {
        locale
        value
      }
      token {
        value
      }
      interfaceAccount
      custom {
        typeRef
        type
      }
    }
    paymentStatus {
      interfaceCode
      interfaceText
      stateRef {
        typeId
        id
      }
      state {
        id
        version
        key
        type
        roles
        nameAllLocales
        descriptionAllLocales
        builtIn
        transitionsRef
        transitions
        initial
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
    }
    transactions {
      id
      timestamp
      type
      amount {
        type
        currencyCode
        centAmount
        fractionDigits
      }
      interactionId
      state
      custom {
        typeRef
        type
      }
      interfaceId
    }
    custom {
      typeRef {
        typeId
        id
      }
      type {
        key
        nameAllLocales
        descriptionAllLocales
        resourceTypeIds
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
    }
    id
    version
    createdAt
    lastModifiedAt
    createdBy {
      isPlatformClient
      clientId
      externalUserId
      anonymousId
      customerRef {
        typeId
        id
      }
      userRef {
        typeId
        id
      }
      associateRef {
        typeId
        id
      }
      attributedTo {
        clientId
        source
        userRef
      }
    }
    lastModifiedBy {
      isPlatformClient
      clientId
      externalUserId
      anonymousId
      customerRef {
        typeId
        id
      }
      userRef {
        typeId
        id
      }
      associateRef {
        typeId
        id
      }
      attributedTo {
        clientId
        source
        userRef
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

draftobjectrequired
amountPlannedobjectrequired2 fields
paymentMethodInfoobject6 fields
customobject4 fields
keystring
customerobject3 fields
anonymousIdstring
interfaceIdstring
paymentStatusobject3 fields
transactionsarray<object>7 fields
interfaceInteractionsarray<object>4 fields
json
{
  "draft": {
    "amountPlanned": {
      "currencyCode": "string",
      "centAmount": "string"
    },
    "paymentMethodInfo": {
      "paymentInterface": "string",
      "method": "string",
      "name": [
        "string"
      ],
      "token": {
        "value": "string"
      },
      "interfaceAccount": "string",
      "custom": {
        "typeId": "string",
        "typeKey": "string",
        "type": "string",
        "fields": "string"
      }
    },
    "custom": {
      "typeId": "string",
      "typeKey": "string",
      "type": {
        "typeId": "string",
        "id": "string",
        "key": "string"
      },
      "fields": [
        "string"
      ]
    },
    "key": "string",
    "customer": {
      "typeId": "string",
      "id": "string",
      "key": "string"
    },
    "anonymousId": "string",
    "interfaceId": "string",
    "paymentStatus": {
      "interfaceCode": "string",
      "interfaceText": "string",
      "state": {
        "typeId": "string",
        "id": "string",
        "key": "string"
      }
    },
    "transactions": [
      {
        "type": "string",
        "amount": "string",
        "timestamp": "string",
        "interactionId": "string",
        "state": "string",
        "custom": "string",
        "interfaceId": "string"
      }
    ],
    "interfaceInteractions": [
      {
        "typeId": "string",
        "typeKey": "string",
        "type": "string",
        "fields": "string"
      }
    ]
  }
}

Response

Read the result with {{createpayment.response.data.data.createPayment}}. If the API returns errors, the step fails and they are at {{createpayment.response.data.errors}}.

keystring
customerRefobject
typeIdstring
idstring
customerobject
idstring
customerNumberstring
emailstring
addressesarray<object>
defaultShippingAddressIdstring
defaultBillingAddressIdstring
shippingAddressIdsarray<object>
billingAddressIdsarray<object>
isEmailVerifiedboolean
customerGroupRefobject2 fields
externalIdstring
keystring
authenticationModestring

One ofExternalAuthPassword

firstNamestring
lastNamestring
middleNamestring
titlestring
localestring
salutationstring
dateOfBirthstring
companyNamestring
vatIdstring
passwordstring
customerGroupobject9 fields
defaultShippingAddressobject26 fields
defaultBillingAddressobject26 fields
shippingAddressesarray<object>
billingAddressesarray<object>
storesRefarray<object>
storesarray<object>
customerGroupAssignmentsarray<object>
customobject2 fields
versionstring
createdAtstring
lastModifiedAtstring
createdByobject8 fields
lastModifiedByobject8 fields
anonymousIdstring
interfaceIdstring
amountPlannedobject
typestring
currencyCodestring
centAmountstring
fractionDigitsnumber
paymentMethodInfoobject
paymentInterfacestring
methodstring
nameAllLocalesarray<object>
tokenobject1 fields
interfaceAccountstring
customobject2 fields
paymentStatusobject
interfaceCodestring
interfaceTextstring
stateRefobject2 fields
stateobject15 fields
transactionsarray<object>
idobject
timestampobject
typeobject
amountobject
interactionIdobject
stateobject
customobject
interfaceIdobject
customobject
typeRefobject2 fields
typeobject10 fields
idstring
versionstring
createdAtstring
lastModifiedAtstring
createdByobject
isPlatformClientboolean
clientIdstring
externalUserIdstring
anonymousIdstring
customerRefobject2 fields
userRefobject2 fields
associateRefobject2 fields
attributedToobject3 fields
lastModifiedByobject
isPlatformClientboolean
clientIdstring
externalUserIdstring
anonymousIdstring
customerRefobject2 fields
userRefobject2 fields
associateRefobject2 fields
attributedToobject3 fields

Need more? See the Commercetools guide for connection setup and behaviour shared by every action.