xendit-php icon indicating copy to clipboard operation
xendit-php copied to clipboard

When I create new customer this error was caused. "There was an error with the format submitted to the server".

Open tabish-ali opened this issue 3 years ago • 1 comments

Request ==>

{
	"customer": {
		"addresses": [
			{
				"city": "Jakarta Selatan",
				"country": "PH",
				"postal_code": "12160",
				"province": "Daerah Khusus Ibukota Jakarta",
				"street_line1": "Jalan Makan",
				"street_line2": "Kecematan Kebayoran Baru"
			}
		],
		"date_of_birth": "2000-01-01",
		"email": "[email protected]",
		"given_names": "John",
		"mobile_number": "+6323123123",
		"nationality": "PH",
		"phone_number": "+6323123123",
		"reference_id": "demo_1475801962607",
		"surname": "Doe"
	}
}

Response ==>

{
    "message": "There was an error with the format submitted to the server.",
    "exception": "Xendit\\Exceptions\\ApiException",
    "file": "/home/tabish/programming/laravel/sabong/vendor/xendit/xendit-php/src/HttpClient/GuzzleClient.php",
    "line": 171,
 }

tabish-ali avatar Feb 12 '22 13:02 tabish-ali

same here

hungphan91 avatar Jul 20 '22 03:07 hungphan91

same problem here, is there any solution or workaround for this one?

Dagzu avatar Dec 20 '22 23:12 Dagzu

facing same issue when creating customer, is there any solution for it?

prem-c247 avatar Mar 27 '23 11:03 prem-c247

Try this format for saving customers.

$customerParamsNew = [ 'reference_id' => referenceID(25), 'type' => $customer->type, 'email' => $customer->email, 'mobile_number' => $customer->tel, 'kyc_documents' => [], 'individual_detail' => [ 'given_names' => $customer->name, ], 'identity_accounts' => [], 'api-version' => '2020-10-31' ];

    you should see what is customer type, i coded this long time, i don't know what it should be and also update the api version to your installed one or try to remove api-version. Generate your own ref id according to your choice. 

tabish-ali avatar Mar 27 '23 14:03 tabish-ali

Closing this as resolved

adityarx avatar May 24 '23 07:05 adityarx