younifyd
Menu

updateMyPayment

Update an existing payment for the signed-in customer — pass its current version and an array of update actions.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the updateMyPayment action (under Update).
  3. Fill in the fields below, then reference the result from later steps as {{updatemypayment.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 UpdateMyPayment($id: String!, $version: Long!, $actions: [MyPaymentUpdateAction!]!) {
  updateMyPayment(id: $id, version: $version, actions: $actions) {
    id
    version
    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
    paymentMethodInfo {
      paymentInterface
      method
      nameAllLocales {
        locale
        value
      }
      token {
        value
      }
      interfaceAccount
      custom {
        typeRef
        type
      }
    }
    amountPlanned {
      type
      currencyCode
      centAmount
      fractionDigits
    }
    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
      }
    }
  }
}

Variables

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

idstringrequired
versionstringrequired
actionsarray<object>required
addTransactionobject1 fields
changeAmountPlannedobject1 fields
setCustomFieldobject2 fields
setMethodInfoCustomFieldobject2 fields
setMethodInfoCustomTypeobject4 fields
setMethodInfoInterfaceobject1 fields
setMethodInfoInterfaceAccountobject1 fields
setMethodInfoMethodobject1 fields
setMethodInfoNameobject1 fields
json
{
  "id": "string",
  "version": "string",
  "actions": [
    {
      "addTransaction": {
        "transaction": "string"
      },
      "changeAmountPlanned": {
        "amount": "string"
      },
      "setCustomField": {
        "name": "string",
        "value": "string"
      },
      "setMethodInfoCustomField": {
        "name": "string",
        "value": "string"
      },
      "setMethodInfoCustomType": {
        "fields": "string",
        "type": "string",
        "typeKey": "string",
        "typeId": "string"
      },
      "setMethodInfoInterface": {
        "interface": "string"
      },
      "setMethodInfoInterfaceAccount": {
        "interfaceAccount": "string"
      },
      "setMethodInfoMethod": {
        "method": "string"
      },
      "setMethodInfoName": {
        "name": "string"
      }
    }
  ]
}

Response

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

idstring
versionstring
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
paymentMethodInfoobject
paymentInterfacestring
methodstring
nameAllLocalesarray<object>
tokenobject1 fields
interfaceAccountstring
customobject2 fields
amountPlannedobject
typestring
currencyCodestring
centAmountstring
fractionDigitsnumber
transactionsarray<object>
idobject
timestampobject
typeobject
amountobject
interactionIdobject
stateobject
customobject
interfaceIdobject
customobject
typeRefobject2 fields
typeobject10 fields

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

Was this page helpful?