Skip to main content
POST
/
order-received
/
{order_id}
/
pay
Pay for existing order
curl --request POST \
  --url {protocol}://{host}/wp-json/cocart/preview/order-received/{order_id}/pay \
  --header 'Content-Type: application/json' \
  --data '{
  "order_key": "<string>",
  "payment_method": "<string>",
  "payment_data": [
    {
      "key": "wc-stripe-payment-token",
      "value": "<string>"
    }
  ]
}'
{
  "success": true,
  "order_id": 789,
  "order_status": "processing",
  "redirect_url": "https://example.com/checkout/order-received/789/?key=wc_order_abc123xyz"
}
This endpoint is currently shown as a preview of what’s currently in development and is subject to change.

Authorizations

Authorization
string
header
required

WordPress username and password

Path Parameters

order_id
integer
required

Unique identifier for the order

Body

application/json

Payment details for the order

order_key
string
required

Order key for verification

payment_method
string
required

Payment method ID

payment_data
object[]

Payment data for the gateway

Response

Payment processed successfully

success
boolean

Whether payment was successful

order_id
integer

Order ID

order_status
string

Updated order status

redirect_url
string<uri>

Redirect URL after payment

I