younifyd
Menu

Create Cart Payment Intent

Create Stripe Payment Intent for a Cart

POST/v2/carts/{cartID}/payments

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Create Cart Payment Intent action (under Carts).
  3. Fill in the fields below, then reference the result from later steps as {{createCartPaymentIntent.response.data}}.

Request

Path parameters

cartIDstringrequired

The universally unique identifier of the cart for which you want to create a payment intent.

Request body

Enter the body as JSON in the step's Body field.

dataany
json
{
  "data": null
}

Response

Returns 201 with an object. Read it in later steps with {{createCartPaymentIntent.response.data.<field>}}.

dataany
includedobject

Related objects that are included in the response.

custom_discountsarray<object>8 fields
promotionsarray<object>9 fields
metaobject

Additional metadata for the cart response.

payment_intentobject

Payment intent details with nested structure including status and other Stripe payment intent fields

errorsarray<object>

Array of error objects, if any errors occurred.

titlestringrequired

A brief summary of the error.

statusstring | integerrequired

The HTTP response code of the error.

detailstring

Optional additional detail about the error.

sourcestring

The field or location that caused the validation error. For JSON schema validation errors, this contains the JSON path to the invalid field (e.g., 'data.name', 'request', 'data.items[0].quantity').

metaobject13 fields

Additional metadata associated with the error. May include arbitrary keys.

json
{
  "data": null,
  "included": {
    "custom_discounts": [
      {
        "type": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "external_id": "string",
        "discount_engine": "string",
        "amount": {
          "amount": 0,
          "currency": "string",
          "formatted": "string"
        },
        "description": "string",
        "discount_code": "string",
        "relationships": {
          "item": {
            "data": {
              "id": null,
              "type": null
            }
          }
        }
      }
    ],
    "promotions": [
      {
        "type": "string",
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "description": "string",
        "automatic": false,
        "promotion_type": "string",
        "promotion_source": "string",
        "start": "2025-01-01T00:00:00Z",
        "end": "2025-01-01T00:00:00Z"
      }
    ]
  },
  "meta": {
    "payment_intent": {}
  },
  "errors": [
    {
      "title": "string",
      "status": "string",
      "detail": "string",
      "source": "string",
      "meta": {
        "id": "string",
        "ids": [
          "string"
        ],
        "item_ids": [
          "string"
        ],
        "shipping_group_id": "string",
        "shipping_group_ids": [
          "string"
        ],
        "cart_id": "string",
        "code": "string",
        "order_id": "string",
        "sku": "string",
        "email": "name@example.com",
        "component_product_id": "00000000-0000-0000-0000-000000000000",
        "error-meta-key": "string"
      }
    }
  ]
}

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