Appearance
/client/sync
Syncs client data and card information by combining the create client, create token, and add payment method calls.
If a client already exists with the same identifier
included in the request, the existing clientId
is returned.
HTTP Request
POST https://api.q2open.io/v1/client/sync
Arguments
Parameter | Description |
---|---|
client | The object used from the create client call. |
token | The object used from the create token call. |
cards | A list of cards to be added to the client, as specified in the add payment method call. You can specify the cardType and cardBrand parameters for a much faster call speed. Possible values for cardType are credit , debit . Possible values for cardBrand are american express , discover , maestro , mastercard , uatp , visa . |
Returns
Returns an object with a clientId
property that can be used for requests, an ssoToken
that can be used with white-label products, and a cards
array that includes a list of objects that include the paymentMethodId
of the created card and identifier
passed in.
Example Request
shell
curl "https://api.q2open.io/v1/client/sync" \
-H "Authorization: Bearer dc220490-e6ee-11e5-8a94-e7385a8d929e" \
-H "Content-Type: application/json" \
-d '{
"client": {
"identifier": "Bk0zwVx1Z",
"meta": {
"firstName": "Demo",
"lastName": "User",
"email": "demo@demo.com",
"phone": "123-123-1234",
"address1": "123 Api St.",
"address2": "P.O. Box 283",
"city": "Demo",
"state": "Q2",
"zipcode": "12345"
}
},
"token": {
"expiration": "2025-01-30T00:00:00.000Z"
},
"cards": [{
"identifier": "fiId123",
"cardNumber": "4111111111111111",
"cardCode": "123",
"cardType": "credit",
"cardBrand": "visa",
"expMonth": "02",
"expYear": "2040",
"zipcode": "12345",
"name": "Demo User",
"setAsDefault": "true",
"customLabel": "Entertainment Rewards Card"
}]
}'
Example Response
json
{
"clientId": "579b695decfa11012711875d",
"ssoToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0IjoiNWYwMzY1YTdhZjkyODg5NjhiNTNiM2QzIiwiaWF0IjoxNTk0MDU4OTQ1LCJleHAiOjE1OTQxNDUzNDUsImlzcyI6IlBBWUJJREVUIiwic3ViIjoiNWYwMzY1YTdhZjkyODg5NjhiNTNiM2QzIn0.kO_x9cZRlhI4dyGarOPI1w2gW2QI-ObqyKFdXKs64Ek",
"cards": [{
"paymentMethodId": "55942f330cfcfd6c4ed529d9",
"identifier": "fiId123"
}]
}