# Payments A Payment represents a series of logically connected financial transactions like reserving, charging, or refunding money. A Payment holds information about the payment service provider (PSP), the payment method used, any related transactions, and the current state of the Payment. An [Order](/api/projects/orders.md) or a [Cart](/api/projects/carts.md) can reference a set of Payments using the [PaymentInfo](/search.md?urn=ctp:api:type:PaymentInfo) object. A Payment can also reference a [Customer](/api/projects/customers.md), or an [anonymous session](/api/authorization.md#tokens-for-anonymous-sessions). The actual financial process is carried out by an external PSP, which is connected to the API by [PSP-specific integrations](https://marketplace.commercetools.com/integrations/payment-service-providers). If you are using [Checkout](/checkout/overview.md) for your checkout solution, the [Checkout Payment Intents API](/checkout/payment-intents-api.md) lets you request the PSP to perform actions throughout the financial process, such as payment capture, refund, and authorization cancellation. Learn more about how to implement payment integration as part of a custom checkout flow in our self-paced [Implement a custom checkout](/learning-implement-checkout/custom-checkout/overview.md) module. ## Representations #### Payment [type definition](/search.md?urn=ctp:api:type:Payment). ##### PaymentDraft [type definition](/search.md?urn=ctp:api:type:PaymentDraft). ##### PaymentPagedQueryResponse [type definition](/search.md?urn=ctp:api:type:PaymentPagedQueryResponse). ##### PaymentReference [type definition](/search.md?urn=ctp:api:type:PaymentReference). ##### PaymentKeyReference [type definition](/search.md?urn=ctp:import:type:PaymentKeyReference). ##### PaymentResourceIdentifier [type definition](/search.md?urn=ctp:api:type:PaymentResourceIdentifier). #### PaymentMethodInfo [type definition](/search.md?urn=ctp:api:type:PaymentMethodInfo). ##### PaymentMethodInfoDraft [type definition](/search.md?urn=ctp:api:type:PaymentMethodInfoDraft). #### PaymentStatus [type definition](/search.md?urn=ctp:api:type:PaymentStatus). ##### PaymentStatusDraft [type definition](/search.md?urn=ctp:api:type:PaymentStatusDraft). #### Transaction [type definition](/search.md?urn=ctp:api:type:Transaction). ##### TransactionDraft [type definition](/search.md?urn=ctp:api:type:TransactionDraft). ##### TransactionType [type definition](/search.md?urn=ctp:api:type:TransactionType). ##### TransactionState [type definition](/search.md?urn=ctp:api:type:TransactionState). ## Get Payment ### Get Payment by ID [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/{id}:GET). ### Get Payment by Key [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/key={key}:GET). ## Query Payments [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments:GET). ## Check if Payment exists ### Check if Payment exists by ID [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/{id}:HEAD). ### Check if Payment exists by Key [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/key={key}:HEAD). ### Check if Payment exists by Query Predicate [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments:HEAD). ## Create Payment [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments:POST). ## Update Payment ### Update Payment by ID [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/{id}:POST). ### Update Payment by Key [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/key={key}:POST). ## Update actions #### On Payment ##### Set Key [type definition](/search.md?urn=ctp:api:type:PaymentSetKeyAction). ##### Change AmountPlanned [type definition](/search.md?urn=ctp:api:type:PaymentChangeAmountPlannedAction). ##### Set Customer [type definition](/search.md?urn=ctp:api:type:PaymentSetCustomerAction). ##### Set AnonymousId [type definition](/search.md?urn=ctp:api:type:PaymentSetAnonymousIdAction). ##### Set InterfaceId [type definition](/search.md?urn=ctp:api:type:PaymentSetInterfaceIdAction). ##### Set MethodInfo [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoAction). ##### Set MethodInfo Interface [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoInterfaceAction). ##### Set MethodInfo Method [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoMethodAction). ##### Set MethodInfo Name [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoNameAction). ##### Set MethodInfo Token [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoTokenAction). ##### Set MethodInfo InterfaceAccount [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoInterfaceAccountAction). ##### Set MethodInfo Custom Type [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoCustomTypeAction). ##### Set MethodInfo CustomField [type definition](/search.md?urn=ctp:api:type:PaymentSetMethodInfoCustomFieldAction). ##### Set StatusInterfaceCode [type definition](/search.md?urn=ctp:api:type:PaymentSetStatusInterfaceCodeAction). ##### Set StatusInterfaceText [type definition](/search.md?urn=ctp:api:type:PaymentSetStatusInterfaceTextAction). ##### Transition State [type definition](/search.md?urn=ctp:api:type:PaymentTransitionStateAction). ##### Add Transaction [type definition](/search.md?urn=ctp:api:type:PaymentAddTransactionAction). ##### Add InterfaceInteraction [type definition](/search.md?urn=ctp:api:type:PaymentAddInterfaceInteractionAction). ##### Set Custom Type [type definition](/search.md?urn=ctp:api:type:PaymentSetCustomTypeAction). ##### Set CustomField [type definition](/search.md?urn=ctp:api:type:PaymentSetCustomFieldAction). #### On Transaction ##### Change TransactionState [type definition](/search.md?urn=ctp:api:type:PaymentChangeTransactionStateAction). ##### Change TransactionTimestamp [type definition](/search.md?urn=ctp:api:type:PaymentChangeTransactionTimestampAction). ##### Change TransactionInteractionId [type definition](/search.md?urn=ctp:api:type:PaymentChangeTransactionInteractionIdAction). ##### Set TransactionInterfaceId [type definition](/search.md?urn=ctp:api:type:PaymentSetTransactionInterfaceIdAction). ##### Set Transaction Custom Type [type definition](/search.md?urn=ctp:api:type:PaymentSetTransactionCustomTypeAction). ##### Set Transaction CustomField [type definition](/search.md?urn=ctp:api:type:PaymentSetTransactionCustomFieldAction). ## Delete Payment ### Delete Payment by ID [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/{id}:DELETE). ### Delete Payment by Key [endpoint definition](/search.md?urn=ctp:api:endpoint:/{projectKey}/payments/key={key}:DELETE). ## Related pages - [Area overview page with navigation](/api.md) - [Previous page: Payment Methods](/api/projects/payment-methods.md) - [Next page: Shopping Lists](/api/projects/shoppingLists.md) - [Search documentation and API specs](/search.md)