Developer Discussions
I try to create customer and I get this error.
over 1 year ago by Cloud-Service
NOTE: Already try different Key from this https://developers.maya.ph/reference/sandbox-credentials-and-cards
Request:
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
authorization: 'Basic cGstZW80c0wzOTNDV1U1S212ZUpVYVc4VjczMFRUZWkyelk4ekU0ZEhKRHhrRjpzay1LZm1mTEpYRmRWNXQxaW5ZTjhsSU93U3J1ZUMxRzI3U0NBa2xCcVlDZHJV'
},
body: JSON.stringify({
firstName: 'Maya',
middleName: 'Jose',
lastName: 'Juan',
birthday: '1987-07-28',
sex: 'F',
contact: {phone: '+63(2)1234567890', email: '[email protected]'},
billingAddress: {
line1: '6F Launchpad',
line2: 'Sheridan Street',
city: 'Mandaluyong City',
state: 'Metro Manila',
zipCode: '1552',
countryCode: 'PH'
},
shippingAddress: {
firstName: 'Maya',
middleName: 'Jose',
lastName: 'Juan',
line1: '6F Launchpad',
line2: 'Sheridan Street',
city: 'Mandaluyong City',
state: 'Metro Manila',
zipCode: '1552',
countryCode: 'PH',
phone: '+63(2)1234567890',
email: '[email protected]',
shippingType: 'ST'
},
customerSince: '2020-12-25'
})
};
fetch('<https://pg-sandbox.paymaya.com/payments/v1/customers'>, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response
}
"error": "Invalid endpoint. Please check if you are accessing the correct endpoint/resource.",
"code": "K004",
"reference": "8d905b2d-e0d3-41fc-ba86-b414e03a345f"
}