Menu
createMyPayment
Create a new payment for the signed-in customer.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the createMyPayment action (under Create).
- Fill in the fields below, then reference the result from later steps as
{{createmypayment.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.
mutation CreateMyPayment($draft: MyPaymentDraft!) {
createMyPayment(draft: $draft) {
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.
{
"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"
]
},
"transaction": {
"type": "Authorization",
"amount": {
"currencyCode": "string",
"centAmount": "string"
},
"timestamp": "string",
"interactionId": "string",
"custom": {
"typeId": "string",
"typeKey": "string",
"type": "string",
"fields": "string"
},
"interfaceId": "string"
}
}
}
Response
Read the result with {{createmypayment.response.data.data.createMyPayment}}. If the API returns errors, the step fails and they are at {{createmypayment.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?