Create and change customer
Create a new customer and associate them with the order.
Authorization
applicationPassword AuthorizationBasic <token>
WordPress Application Password authentication. Generate one at wp-admin > Users > Application Passwords. Use as Basic Auth with username:application_password (base64-encoded).
In: header
Path Parameters
order_id*integer
Order ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://your-site.com/wp-json/fluent-cart/v2/orders/0/create-and-change-customer" \ -H "Content-Type: application/json" \ -d '{ "email": "user@example.com" }'{
"order": {
"id": 0,
"status": "pending",
"parent_id": 0,
"receipt_number": "string",
"invoice_no": "string",
"fulfillment_type": "digital",
"type": "payment",
"mode": "test",
"shipping_status": "pending",
"customer_id": 0,
"payment_method": "string",
"payment_status": "pending",
"payment_method_title": "string",
"currency": "string",
"subtotal": 0,
"discount_tax": 0,
"manual_discount_total": 0,
"coupon_discount_total": 0,
"shipping_tax": 0,
"shipping_total": 0,
"tax_total": 0,
"total_amount": 0,
"total_paid": "string",
"total_refund": "string",
"rate": "string",
"tax_behavior": "string",
"note": "string",
"ip_address": "string",
"completed_at": "2019-08-24T14:15:22Z",
"refunded_at": "2019-08-24T14:15:22Z",
"uuid": "string",
"config": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"parent_order": {},
"subscriptions": [
{
"id": 0,
"parent_id": 0,
"customer_id": 0,
"status": "active",
"payment_method": "string",
"vendor_subscription_id": "string",
"billing_interval": "weekly",
"bill_times": 0,
"recurring_amount": 0,
"trial_days": 0,
"initial_amount": 0,
"currency": "string",
"uuid": "string",
"next_billing_date": "2019-08-24T14:15:22Z",
"expiry_date": "2019-08-24T14:15:22Z",
"activated_at": "2019-08-24T14:15:22Z",
"canceled_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"activities": [
{
"id": 0,
"status": "info",
"log_type": "string",
"module_type": "string",
"module_id": 0,
"module_name": "string",
"user_id": "string",
"title": "string",
"content": "string",
"read_status": "read",
"created_by": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"user": {
"ID": 0,
"display_name": "string",
"user_email": "user@example.com"
}
}
],
"labels": [
{
"id": 0,
"value": "string",
"color": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"customer": {
"id": 0,
"user_id": "string",
"contact_id": "string",
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"status": "active",
"purchase_value": "string",
"purchase_count": "string",
"ltv": "string",
"first_purchase_date": "2019-08-24T14:15:22Z",
"last_purchase_date": "2019-08-24T14:15:22Z",
"aov": "string",
"notes": "string",
"uuid": "string",
"country": "string",
"city": "string",
"state": "string",
"postcode": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"selected_labels": [
0
],
"full_name": "string",
"photo": "http://example.com",
"country_name": "string",
"formatted_address": {
"country": "string",
"state": "string",
"city": "string",
"postcode": "string",
"address_1": "string",
"address_2": "string",
"type": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"email": "user@example.com",
"company_name": "string",
"label": "string",
"phone": "string",
"full_address": "string"
},
"user_link": "http://example.com",
"labels": [
{
"id": 0,
"value": "string",
"color": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
},
"children": [
{}
],
"order_items": [
{
"id": 0,
"order_id": "string",
"post_id": "string",
"fulfillment_type": "digital",
"payment_type": "onetime",
"post_title": "string",
"title": "string",
"object_id": "string",
"cart_index": "string",
"quantity": "string",
"unit_price": 0,
"cost": 0,
"subtotal": 0,
"tax_amount": 0,
"shipping_charge": 0,
"discount_total": 0,
"line_total": 0,
"refund_total": 0,
"rate": "string",
"other_info": {},
"line_meta": {},
"fulfilled_quantity": "string",
"referrer": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"payment_info": "string",
"setup_info": "string",
"is_custom": true,
"formatted_total": "string",
"variants": {
"id": 0,
"post_id": 0,
"media_id": 0,
"serial_index": 0,
"sold_individually": 0,
"variation_title": "string",
"variation_identifier": "string",
"sku": "string",
"manage_stock": "string",
"payment_type": "onetime",
"stock_status": "in-stock",
"backorders": 0,
"total_stock": 0,
"on_hold": 0,
"committed": 0,
"available": 0,
"fulfillment_type": "digital",
"item_status": "active",
"manage_cost": "string",
"item_price": 0,
"item_cost": 0,
"compare_price": 0,
"shipping_class": "string",
"other_info": {},
"downloadable": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"thumbnail": "http://example.com",
"formatted_total": "string",
"media": {}
}
}
],
"transactions": [
{
"id": 0,
"order_id": "string",
"order_type": "string",
"transaction_type": "charge",
"subscription_id": 0,
"card_last_4": "string",
"card_brand": "string",
"vendor_charge_id": "string",
"payment_method": "string",
"payment_mode": "test",
"payment_method_type": "string",
"status": "succeeded",
"currency": "string",
"total": "string",
"rate": "string",
"uuid": "string",
"meta": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"url": "http://example.com"
}
],
"order_addresses": [
{
"id": 0,
"order_id": "string",
"type": "billing",
"name": "string",
"address_1": "string",
"address_2": "string",
"city": "string",
"state": "string",
"postcode": "string",
"country": "string",
"meta": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"formatted_address": {
"country": "string",
"state": "string",
"city": "string",
"postcode": "string",
"address_1": "string",
"address_2": "string",
"type": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"email": "user@example.com",
"company_name": "string",
"label": "string",
"phone": "string",
"full_address": "string"
},
"company_name": "string",
"phone": "string",
"label": "string"
}
],
"billing_address": {
"id": 0,
"order_id": "string",
"type": "billing",
"name": "string",
"address_1": "string",
"address_2": "string",
"city": "string",
"state": "string",
"postcode": "string",
"country": "string",
"meta": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"formatted_address": {
"country": "string",
"state": "string",
"city": "string",
"postcode": "string",
"address_1": "string",
"address_2": "string",
"type": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"email": "user@example.com",
"company_name": "string",
"label": "string",
"phone": "string",
"full_address": "string"
},
"company_name": "string",
"phone": "string",
"label": "string"
},
"shipping_address": {
"id": 0,
"order_id": "string",
"type": "billing",
"name": "string",
"address_1": "string",
"address_2": "string",
"city": "string",
"state": "string",
"postcode": "string",
"country": "string",
"meta": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"email": "user@example.com",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"formatted_address": {
"country": "string",
"state": "string",
"city": "string",
"postcode": "string",
"address_1": "string",
"address_2": "string",
"type": "string",
"name": "string",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"email": "user@example.com",
"company_name": "string",
"label": "string",
"phone": "string",
"full_address": "string"
},
"company_name": "string",
"phone": "string",
"label": "string"
},
"applied_coupons": [
{}
],
"custom_checkout_url": "http://example.com",
"has_missing_licenses": true,
"order_operation": {
"id": 0,
"order_id": "string",
"created_via": "string",
"emails_sent": "string",
"sales_recorded": "string",
"utm_campaign": "string",
"utm_term": "string",
"utm_source": "string",
"utm_medium": "string",
"utm_content": "string",
"utm_id": "string",
"cart_hash": "string",
"refer_url": "string",
"meta": {},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
},
"receipt_url": "http://example.com"
}
}{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": {
"status": 401
}
}{
"code": "fluent_cart_entity_not_found",
"message": "Order not found",
"data": {
"status": 404
}
}