Trigger payments without using the Checkout UI.
The Checkout Transactions API lets you initiate payments managed by Checkout without using the Checkout UI. For example, you can leverage the Checkout Transactions API to process recurring payments for subscription-based orders.
Use the Checkout Transactions API to trigger only payments managed by Checkout.
Scope
| Scope | Permission granted | 
|---|---|
| manage_checkout_transactions:{projectKey} | Manage Transactions | 
| view_checkout_transactions:{projectKey} | View Transactions | 
Representations
Transaction
| idString | Unique identifier of the Transaction. | 
| versionInt | Current version of the Transaction. | 
| keyString | User-defined unique identifier of the Transaction.MinLength: 2MaxLength:256Pattern:^[A-Za-z0-9_-]+$ | 
| application | Application for which the payment must be executed. | 
| transactionItemsArray of TransactionItem | Transaction Item associated with the Transaction.MinItems: 1MaxItems:1 | 
| cart | Reference to the Cart for which the payment must be executed. | 
| transactionStatus | Status of the Transaction. | 
| order | Reference to the Order created from the Cart when the Transaction is completed. | 
| createdAtDateTime | Date and time (UTC) the Transaction was initially created. | 
| lastModifiedAtDateTime | Date and time (UTC) the Transaction was last updated. | 
TransactionDraft
| keyString | User-defined unique identifier of the Transaction.MinLength: 2MaxLength:256Pattern:^[A-Za-z0-9_-]+$ | 
| application | Application for which the payment is executed. | 
| transactionItemsArray of TransactionItemDraft | Transaction Item associated with the Transaction.MinItems: 1MaxItems:1 | 
| cart | Cart for which the payment must be executed. | 
TransactionItem
| amount | Money value of the Transaction Item. | 
| payment | Reference to the Payment associated with the Transaction Item. | 
| paymentIntegration | Reference to the Payment Integration to use to execute the payment. | 
TransactionItemDraft
| paymentIntegration | Resource Identifier of the Payment Integration to use to execute the payment. | 
| amount | Money value of the Transaction Item. | 
TransactionStatus
| state | State of the Transaction. | 
| errorsArray of TransactionError | Errors returned if the Transaction is in the  Failedstate. | 
TransactionState
- Initial
- Pending
- The Transaction is in progress. The PSP or gift card management system is processing the payment. 
- Completed
- The Transaction completed successfully. The PSP or gift card management system processed the payment and Checkout created an Order from the Cart.
- Failed
- The Transaction failed. 
TransactionError
| codeString | Error identifier. | 
| messageString | Plain text description of the cause of the error. | 
Get Transaction
Get Transaction by ID
id. Specific Error Codes:view_checkout_transactions:{projectKey}manage_projects:{projectKey}| projectKeyString | Identifier of your Checkout entity and  keyof your Project. | 
| idString | idof the Transaction. | 
| regionString | 
application/jsoncurl --get https://checkout.{region}.commercetools.com/{projectKey}/transactions/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
  "id": "6d95b6c6-5ef0-4091-8478-b26077ca2b2f",
  "version": 1,
  "key": "transaction-key",
  "application": {
    "typeId": "application",
    "id": "a84d4fe7-ae82-4c3f-8c6c-435e54204fdd"
  },
  "cart": {
    "typeId": "cart",
    "id": "a0e60229-441c-44b0-952b-981a67cbd8c4"
  },
  "order": {
    "typeId": "order",
    "id": "39ccda28-47f9-41bf-8dde-e1d720c19000"
  },
  "transactionItems": [
    {
      "paymentIntegration": {
        "typeId": "payment-integration",
        "id": "4c24762b-87df-4bd3-898a-bafed913a9ca"
      },
      "amount": {
        "centAmount": 1000,
        "currencyCode": "EUR"
      },
      "payment": {
        "typeId": "payment",
        "id": "d1fec278-22c2-4a1d-8190-8f1e8af5ccfb"
      }
    }
  ],
  "transactionStatus": {
    "state": "Failed",
    "errors": [
      {
        "code": "PaymentRejected",
        "message": "Payment d1fec278-22c2-4a1d-8190-8f1e8af5ccfb has been rejected."
      }
    ]
  },
  "createdAt": "1970-01-01T00:00:00.001Z",
  "lastModifiedAt": "1970-01-01T00:00:00.001Z"
}Get Transaction by Key
key. Specific Error Codes:view_checkout_transactions:{projectKey}manage_projects:{projectKey}| projectKeyString | Identifier of your Checkout entity and  keyof your Project. | 
| keyString | keyof the Transaction. | 
| regionString | 
application/jsoncurl --get https://checkout.{region}.commercetools.com/{projectKey}/transactions/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"{
  "id": "6d95b6c6-5ef0-4091-8478-b26077ca2b2f",
  "version": 1,
  "key": "transaction-key",
  "application": {
    "typeId": "application",
    "id": "a84d4fe7-ae82-4c3f-8c6c-435e54204fdd"
  },
  "cart": {
    "typeId": "cart",
    "id": "a0e60229-441c-44b0-952b-981a67cbd8c4"
  },
  "order": {
    "typeId": "order",
    "id": "39ccda28-47f9-41bf-8dde-e1d720c19000"
  },
  "transactionItems": [
    {
      "paymentIntegration": {
        "typeId": "payment-integration",
        "id": "4c24762b-87df-4bd3-898a-bafed913a9ca"
      },
      "amount": {
        "centAmount": 1000,
        "currencyCode": "EUR"
      },
      "payment": {
        "typeId": "payment",
        "id": "d1fec278-22c2-4a1d-8190-8f1e8af5ccfb"
      }
    }
  ],
  "transactionStatus": {
    "state": "Failed",
    "errors": [
      {
        "code": "PaymentRejected",
        "message": "Payment d1fec278-22c2-4a1d-8190-8f1e8af5ccfb has been rejected."
      }
    ]
  },
  "createdAt": "1970-01-01T00:00:00.001Z",
  "lastModifiedAt": "1970-01-01T00:00:00.001Z"
}Create Transaction
Creates a Transaction on Checkout. Specific Error Codes:
manage_checkout_transactions:{projectKey}manage_projects:{projectKey}| projectKeyString | Identifier of your Checkout entity and  keyof your Project. | 
| regionString | 
application/jsonapplication/jsoncurl https://checkout.{region}.commercetools.com/{projectKey}/transactions -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "key" : "transaction-key",
  "application" : {
    "typeId" : "application",
    "id" : "a84d4fe7-ae82-4c3f-8c6c-435e54204fdd"
  },
  "cart" : {
    "typeId" : "cart",
    "id" : "a0e60229-441c-44b0-952b-981a67cbd8c4"
  },
  "transactionItems" : [ {
    "paymentIntegration" : {
      "typeId" : "payment-integration",
      "id" : "4c24762b-87df-4bd3-898a-bafed913a9ca"
    },
    "amount" : {
      "centAmount" : 1000,
      "currencyCode" : "EUR"
    }
  } ]
}
DATA{
  "id": "6d95b6c6-5ef0-4091-8478-b26077ca2b2f",
  "version": 1,
  "key": "transaction-key",
  "application": {
    "typeId": "application",
    "id": "a84d4fe7-ae82-4c3f-8c6c-435e54204fdd"
  },
  "cart": {
    "typeId": "cart",
    "id": "a0e60229-441c-44b0-952b-981a67cbd8c4"
  },
  "order": {
    "typeId": "order",
    "id": "39ccda28-47f9-41bf-8dde-e1d720c19000"
  },
  "transactionItems": [
    {
      "paymentIntegration": {
        "typeId": "payment-integration",
        "id": "4c24762b-87df-4bd3-898a-bafed913a9ca"
      },
      "amount": {
        "centAmount": 1000,
        "currencyCode": "EUR"
      },
      "payment": {
        "typeId": "payment",
        "id": "d1fec278-22c2-4a1d-8190-8f1e8af5ccfb"
      }
    }
  ],
  "transactionStatus": {
    "state": "Failed",
    "errors": [
      {
        "code": "PaymentRejected",
        "message": "Payment d1fec278-22c2-4a1d-8190-8f1e8af5ccfb has been rejected."
      }
    ]
  },
  "createdAt": "1970-01-01T00:00:00.001Z",
  "lastModifiedAt": "1970-01-01T00:00:00.001Z"
}