API ReferenceapipaymentsPOST /v1/checkout

POST /v1/checkout

Service: payments · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "customer_id": {
      "type": "string",
      "minLength": 1
    },
    "currency": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "default": "usd"
    },
    "order_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "stripe_customer_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {}
    },
    "promo_code": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1
    },
    "amount_cents": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "subscription_plan_id": {
      "type": "string",
      "minLength": 1
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "minLength": 1
          },
          "variant_id": {
            "type": "string",
            "minLength": 1
          },
          "qty": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "unit_amount_cents": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "product_id",
          "variant_id",
          "qty",
          "unit_amount_cents"
        ]
      },
      "minItems": 1
    }
  },
  "required": [
    "customer_id"
  ]
}

Responses

201 Payment created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "customer_id": {
      "type": "string"
    },
    "order_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "amount_cents": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "stripe_payment_intent_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "mode": {
      "type": "string",
      "enum": [
        "one_shot",
        "subscription"
      ]
    },
    "subscription_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "customer_id",
    "order_id",
    "amount_cents",
    "currency",
    "status",
    "stripe_payment_intent_id",
    "mode",
    "subscription_id",
    "created_at",
    "updated_at"
  ]
}

400 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://payments.platform.loop.health/v1/checkout \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'