Skip to main content

create Method

Overview​

The create method creates a customer record in the payment processor system.

Business Use Case: A new user signs up. Create their profile for faster checkout.

Purpose​

ScenarioBenefit
Faster checkoutSkip entering details
Payment historyTrack payments

Request Fields​

FieldTypeRequiredDescription
merchantCustomerIdstringYesYour unique customer reference
emailstringNoCustomer email
namestringNoCustomer name
phonestringNoCustomer phone

Response Fields​

FieldTypeDescription
merchantCustomerIdstringYour reference
connectorCustomerIdstringConnector's customer ID
statusCustomerStatusACTIVE
statusCodeintHTTP status code

Example​

SDK Setup​

use OrchestratorXPrism\CustomerClient;

$customerClient = new CustomerClient([
'connector' => 'stripe',
'apiKey' => 'YOUR_API_KEY',
'environment' => 'SANDBOX'
]);

Request​

$request = [
'merchantCustomerId' => 'cust_user_12345',
'email' => 'john.doe@example.com',
'name' => 'John Doe',
'phone' => '+1-555-123-4567'
];

$response = $customerClient->create($request);

Response​

[
'merchantCustomerId' => 'cust_user_12345',
'connectorCustomerId' => 'cus_xxx',
'status' => 'ACTIVE',
'statusCode' => 200
]

Next Steps​