All Release Notes
Added GraphQL mutations for Payments and MyPayments
29 May 2020
Composable Commerce
HTTP API
Enhancement
GraphQLPayments
Payments and MyPayments can now be created, updated, and deleted using the GraphQL API.
- [GraphQL API] Added the following types to the GraphQL schema:
AddMyPaymentTransaction
,AddPaymentInterfaceInteraction
,AddPaymentTransaction
,ChangePaymentAmountPlanned
,ChangePaymentTransactionInteractionId
,ChangePaymentTransactionState
,ChangePaymentTransactionTimestamp
,MyPayment
,MyPaymentDraft
,MyPaymentQueryResult
,MyPaymentUpdateAction
,MyTransactionDraft
,PaymentDraft
,PaymentMethodInfoInput
,PaymentStatusInput
,PaymentUpdateAction
,SetPaymentAmountPaid
,SetPaymentAmountRefunded
,SetPaymentAnonymousId
,SetPaymentAuthorization
,SetPaymentCustomField
,SetPaymentCustomType
,SetPaymentCustomer
,SetPaymentExternalId
,SetPaymentInterfaceId
,SetPaymentKey
,SetPaymentMethodInfoInterface
,SetPaymentMethodInfoMethod
,SetPaymentMethodInfoName
,SetPaymentStatusInterfaceCode
,SetPaymentStatusInterfaceText
,SetStoreSupplyChannels
,TransactionDraft
,TransitionPaymentState
. - [GraphQL API] Changed the
Me
type:- Added the
payments
field to theMe
type. - Added the
payment
field to theMe
type.
- Added the
- [GraphQL API] Changed the
StoreUpdateAction
type:- Input field
setSupplyChannels
was added toStoreUpdateAction
type
- Input field
- [GraphQL API] Changed the
CreateStore
type:- Input field
supplyChannels
was added toCreateStore
type
- Input field
- [GraphQL API] Changed the
Mutation
type:- Added the
createPayment
field to theMutation
type. - Added the
createMyPayment
field to theMutation
type. - Added the
updatePayment
field to theMutation
type. - Added the
updateMyPayment
field to theMutation
type. - Added the
deletePayment
field to theMutation
type. - Added the
deleteMyPayment
field to theMutation
type.
- Added the
Introduced the following changes to the GraphQL schema (in SDL format):
extend type Me {payment(id: String!): MyPaymentpayments(where: String, sort: [String!], limit: Int, offset: Int): MyPaymentQueryResult!}extend type Mutation {createMyPayment(draft: MyPaymentDraft!): MyPaymentcreatePayment(draft: PaymentDraft!): PaymentdeleteMyPayment(id: String!, version: Long!): MyPaymentdeletePayment(version: Long!, personalDataErasure: Boolean = false,"Queries with specified ID"id: String,"Queries with specified key"key: String): PaymentupdateMyPayment(id: String!, version: Long!, actions: [MyPaymentUpdateAction!]!): MyPaymentupdatePayment(version: Long!, actions: [PaymentUpdateAction!]!,"Queries with specified ID"id: String,"Queries with specified key"key: String): Payment}input AddMyPaymentTransaction {transaction: MyTransactionDraft!}input AddPaymentInterfaceInteraction {fields: [CustomFieldInput!]type: ResourceIdentifierInputtypeKey: StringtypeId: String}input AddPaymentTransaction {transaction: TransactionDraft!}input ChangePaymentAmountPlanned {amount: MoneyInput!}input ChangePaymentTransactionInteractionId {transactionId: String!interactionId: String!}input ChangePaymentTransactionState {transactionId: String!state: TransactionState!}input ChangePaymentTransactionTimestamp {transactionId: String!timestamp: DateTime!}"""My Payments endpoint provides access to payments scoped to a specific user.[documentation](https://docs.commercetools.com/http-api-projects-me-payments#mypayment)"""type MyPayment {id: String!version: Long!customerRef: Referencecustomer: CustomeranonymousId: StringpaymentMethodInfo: PaymentMethodInfo!amountPlanned: Money!transactions: [Transaction!]!custom: CustomFieldsType}input MyPaymentDraft {amountPlanned: MoneyInput!paymentMethodInfo: PaymentMethodInfoInputcustom: CustomFieldsDrafttransaction: MyTransactionDraft}type MyPaymentQueryResult {offset: Int!count: Int!total: Long!results: [MyPayment!]!}input MyPaymentUpdateAction {addTransaction: AddMyPaymentTransactionchangeAmountPlanned: ChangePaymentAmountPlannedsetCustomField: SetPaymentCustomFieldsetMethodInfoInterface: SetPaymentMethodInfoInterfacesetMethodInfoMethod: SetPaymentMethodInfoMethodsetMethodInfoName: SetPaymentMethodInfoName}input MyTransactionDraft {timestamp: DateTimetype: TransactionType!amount: MoneyInput!interactionId: String}input PaymentDraft {amountPlanned: MoneyInput!paymentMethodInfo: PaymentMethodInfoInputcustom: CustomFieldsDraftkey: Stringcustomer: ResourceIdentifierInputanonymousId: StringinterfaceId: StringpaymentStatus: PaymentStatusInputtransactions: [TransactionDraft!]interfaceInteractions: [CustomFieldsDraft!]}input PaymentMethodInfoInput {paymentInterface: Stringmethod: Stringname: [LocalizedStringItemInputType!]}input PaymentStatusInput {interfaceCode: StringinterfaceText: Stringstate: ReferenceInput}input PaymentUpdateAction {addInterfaceInteraction: AddPaymentInterfaceInteractionaddTransaction: AddPaymentTransactionchangeAmountPlanned: ChangePaymentAmountPlannedchangeTransactionInteractionId: ChangePaymentTransactionInteractionIdchangeTransactionState: ChangePaymentTransactionStatechangeTransactionTimestamp: ChangePaymentTransactionTimestampsetAmountPaid: SetPaymentAmountPaidsetAmountRefunded: SetPaymentAmountRefundedsetAnonymousId: SetPaymentAnonymousIdsetAuthorization: SetPaymentAuthorizationsetCustomField: SetPaymentCustomFieldsetCustomType: SetPaymentCustomTypesetCustomer: SetPaymentCustomersetExternalId: SetPaymentExternalIdsetInterfaceId: SetPaymentInterfaceIdsetKey: SetPaymentKeysetMethodInfoInterface: SetPaymentMethodInfoInterfacesetMethodInfoMethod: SetPaymentMethodInfoMethodsetMethodInfoName: SetPaymentMethodInfoNamesetStatusInterfaceCode: SetPaymentStatusInterfaceCodesetStatusInterfaceText: SetPaymentStatusInterfaceTexttransitionState: TransitionPaymentState}input SetPaymentAmountPaid {amount: MoneyInput}input SetPaymentAmountRefunded {amount: MoneyInput}input SetPaymentAnonymousId {anonymousId: String}input SetPaymentAuthorization {amount: MoneyInputuntil: DateTime}input SetPaymentCustomField {name: String!value: String}input SetPaymentCustomType {fields: [CustomFieldInput!]type: ResourceIdentifierInputtypeKey: StringtypeId: String}input SetPaymentCustomer {customer: ReferenceInput}input SetPaymentExternalId {externalId: String}input SetPaymentInterfaceId {interfaceId: String}input SetPaymentKey {key: String}input SetPaymentMethodInfoInterface {interface: String!}input SetPaymentMethodInfoMethod {method: String}input SetPaymentMethodInfoName {name: [LocalizedStringItemInputType!]}input SetPaymentStatusInterfaceCode {interfaceCode: String}input SetPaymentStatusInterfaceText {interfaceText: String}input SetStoreSupplyChannels {supplyChannels: [ResourceIdentifierInput!]}input TransactionDraft {timestamp: DateTimetype: TransactionType!amount: MoneyInput!interactionId: Stringstate: TransactionState}input TransitionPaymentState {state: ResourceIdentifierInput!force: Boolean = false}