xendit-node
xendit-node copied to clipboard
Create Customer validation error 400, message "There was an error with the format submitted to the server."
ketika menambahkan customer baru selalu terdapat eror 400, misal format yang dikirim { referenceID:'demo_1475801962607', givenNames: 'John', mobileNumber: '+628324234324', email: '[email protected]', } response server selalu muncul "statusCode": 400, "message": "There was an error with the format submitted to the server.", "status": 400, "code": "API_VALIDATION_ERROR" } padahal sudah mengikuti setandar format parameter yang diberikan , saya pikir format ini masih menggunakan standar api xendit versi 1 bukan yang terbaru mohon diupdate dan mohon pencerahannya
Selamat siang @denialfarizi1 ,
Setelah saya melakukan pengecekan menggunakan data yang terlampir, saya tidak menemukan error tersebut
Apakah boleh diinformasikan request payload (body dan header) nya untuk kami bantu cek lebih lanjut?
Dan apakah ada response array errors
yang menunjukkan lokasi kesalahan pada message nya?
Saya mengikuti example tautan ini menggunakan akun test https://github.com/xendit/xendit-node/blob/master/examples/with_promises/customer.js
const x = new Xendit({ secretKey: '...', }); dengan request paramter customer referenceID: new Date().toISOString(), givenNames: 'customer 1', email: '[email protected]', mobileNumber: '+6281212345678', description: 'dummy customer', middleName: 'middle', surname: 'surname', addresses: [],
akhirnya mendapatkan error message seperti ini { "error": { "statusCode": 400, "message": "There was an error with the format submitted to the server.", "status": 400, "code": "API_VALIDATION_ERROR" } } adakah solusi lain ?
It seems like apiVersion is required field, when I add apiVersion: '2020-05-19', this error disappeared. Thanks.
Good Day!
I have the same issue and already added apiVersion: '2020-05-19' but the still got
{ "error_code": "API_VALIDATION_ERROR", "message": "There was an error with the format submitted to the server.", "errors": [ { "message": ""client_reference" is required", "path": [ "body", "client_reference" ], "type": "any.required", "context": { "key": "client_reference", "label": "client_reference" } } ] }
Input: const x = new Xendit({ secretKey: 'apiKey', }) const { Customer } = x const customerSpecification = {} const c = new Customer(customerSpecification) ... c.createCustomer({ referenceID: 'dummy_id', givenNames: 'dummy', email: "[email protected]", mobileNumber:"+639123456789", description: 'dummy customer', middleName: 'middlename', surname: 'surname', addresses: [], apiVersion: '2020-15-19',
tried to pud client_reference but still got same error. I would appreciate the help. Thank you.
Your API Version here is apiVersion: '2020-15-19',
but it should be apiVersion: '2020-*0*5-19',
Closing this issue as answered, thanks!