0% found this document useful (0 votes)
59 views

Clover API Flow

The document outlines API requests and responses for common operations like creating a customer, order, and paying for an order. It includes JSON examples of requests to generate a card token, create a customer, create an order, and pay for an order. Responses provide details on the created resources like customer info, order total, line items, and payment confirmation.

Uploaded by

Khurram Shehzad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Clover API Flow

The document outlines API requests and responses for common operations like creating a customer, order, and paying for an order. It includes JSON examples of requests to generate a card token, create a customer, create an order, and pay for an order. Responses provide details on the created resources like customer info, order total, line items, and payment confirmation.

Uploaded by

Khurram Shehzad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1

Contents
Card Token Request...............................................................................................................................2
Card Token Response.............................................................................................................................2
Create Customer Request......................................................................................................................3
Create Customer Response....................................................................................................................4
Create Order Request............................................................................................................................4
Create Order Response..........................................................................................................................6
Pay For Order Request.........................................................................................................................10
Pay for Order Response.......................................................................................................................11
2

Card Token Request

curl --request POST \

--url https://token-sandbox.dev.clover.com/v1/tokens \

--header 'accept: application/json' \

--header 'apikey: 8daa365764019533b95fb2f368219ea8' \

--header 'content-type: application/json' \

--data '

"card": {

"brand": "VISA",

"number": "4242424242424242",

"exp_month": "12",

"exp_year": "28",

"cvv": "222",

"first6": "424242",

"last4": "4242"

'

Card Token Response


{

"id": "clv_1TSTSmK3B56n9RZDXJnjitGF",

"object": "token",

"card": {

"exp_month": "12",

"exp_year": "2028",

"first6": "424242",

"last4": "4242",

"brand": "VISA"
3

Create Customer Request

curl --request POST \

--url https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/customers \

--header 'authorization: Bearer 97997608-a042-8c73-42cb-a315f81fcace' \

--header 'content-type: application/json' \

--data '

"cards": [

"first6": "424242",

"last4": "4242",

"token": "clv_1TSTSmK3B56n9RZDXJnjitGF",

"tokenType": "CTOKEN"

],

"firstName": "FirstC1",

"lastName": "LastC1",

"emailAddresses": [

"emailAddress": "[email protected]"

],

"phoneNumbers": [

"phoneNumber": "+923334568821"

}
4

'

Create Customer Response


{

"href": "https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/customers/
T429GDYEQW7X4",

"id": "T429GDYEQW7X4",

"firstName": "FirstC1",

"lastName": "LastC1",

"marketingAllowed": false,

"customerSince": 1698219751000,

"metadata": {}

Create Order Request

curl --request POST \

--url https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/atomic_order/orders \

--header 'accept: application/json' \

--header 'authorization: Bearer 97997608-a042-8c73-42cb-a315f81fcace' \

--header 'content-type: application/json' \

--data '

"orderCart": {

"orderType": {

"taxable": "false",

"isDefault": "false",

"filterCategories": "false",

"isHidden": "false",

"isDeleted": "false",

"id": "RJ8K80W9QS6HR",

"labelKey": "com.clover.order.type.dine_in",

"label": "Dine In"


5

},

"merchant": {

"id": "JTM5GB79NN2B1"

},

"groupLineItems": "false",

"currency": "USD",

"title": "Table 3",

"note": "Create An Atomic Order",

"lineItems": [

"item": {

"id": "RV3J2CBNA2582"

},

"printed": "false",

"exchanged": "false",

"refunded": "false",

"refund": {

"transactionInfo": {

"isTokenBasedTx": "false",

"emergencyFlag": "false"

},

"isRevenue": "false",

"id": "RV3J2CBNA2582",

"modifications": [

"modifier": {

"available": "true",

"price": "0",

"modifierGroup": {

"id": "Y0E3RJF11H0SC"
6

},

"id": "Q6PW21RDDY4VW"

},

"id": "Q6PW21RDDY4VW",

"name": "RED BULL",

"amount": 150

},

"modifier": {

"available": "true",

"price": "0",

"id": "Y0E3RJF11H0SC"

},

"id": "Y0E3RJF11H0SC",

"name": "Double",

"amount": 500

'

Create Order Response

"href": "https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/orders/
0E1SDRMHRTG24",

"id": "0E1SDRMHRTG24",

"currency": "USD",
7

"employee": {

"href": "https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/employees/
M2MCFTG7EHS4W",

"id": "M2MCFTG7EHS4W",

"name": "Naqash Choudhery",

"nickname": "Naqash C.",

"customId": "",

"role": "ADMIN",

"orders": {

"href": "https://sandbox.dev.clover.com/v3/merchants/JTM5GB79NN2B1/employees/
M2MCFTG7EHS4W/orders"

},

"total": 1301,

"title": "Table 3",

"note": "Create An Atomic Order",

"orderType": {

"id": "RJ8K80W9QS6HR",

"labelKey": "com.clover.order.type.dine_in",

"label": "Online Order",

"taxable": true,

"isDefault": false,

"filterCategories": false,

"isHidden": false,

"fee": 0,

"minOrderAmount": 0,

"maxOrderAmount": 0,

"maxRadius": 0,

"avgOrderTime": 0,

"hoursAvailable": "BUSINESS",

"isDeleted": false,

"systemOrderTypeId": "DINE-IN-TYPE"
8

},

"taxRemoved": false,

"isVat": false,

"state": "OPEN",

"manualTransaction": false,

"groupLineItems": false,

"testMode": false,

"createdTime": 1698219254000,

"clientCreatedTime": 1698219254000,

"modifiedTime": 1698219253000,

"lineItems": {

"elements": [{

"id": "C1A2ZK8K9TJQA",

"orderRef": {

"id": "0E1SDRMHRTG24"

},

"item": {

"id": "RV3J2CBNA2582"

},

"name": "Old Crow",

"alternateName": "",

"price": 525,

"itemCode": "",

"printed": false,

"createdTime": 1698219254000,

"orderClientCreatedTime": 1698219254000,

"exchanged": false,

"modifications": {

"elements": [{

"id": "3K7X308A7ZZ0Y",

"lineItemRef": {
9

"id": "C1A2ZK8K9TJQA"

},

"name": "RED BULL",

"amount": 150,

"modifier": {

"id": "Q6PW21RDDY4VW"

}, {

"id": "TN8238NFK8Q6R",

"lineItemRef": {

"id": "C1A2ZK8K9TJQA"

},

"name": "Double",

"amount": 500,

"modifier": {

"id": "Y0E3RJF11H0SC"

}]

},

"refunded": false,

"isRevenue": true,

"taxRates": {

"elements": [{

"id": "JHBP9ZYTZSPQM",

"lineItemRef": {

"id": "C1A2ZK8K9TJQA"

},

"name": "NC/ Sales Tax",

"rate": 675000,

"isDefault": true

}, {
10

"id": "F6V5KC4HEYH0G",

"lineItemRef": {

"id": "C1A2ZK8K9TJQA"

},

"name": "CC Fee",

"rate": 399000,

"isDefault": true

}]

}]

Pay For Order Request

curl --request POST \

--url https://scl-sandbox.dev.clover.com/v1/orders/0E1SDRMHRTG24/pay \

--header 'accept: application/json' \

--header 'authorization: Bearer 9e10076a-611d-47ed-c68e-8aeadd67d2ec' \

--header 'content-type: application/json' \

--data '

"ecomind": "ecom",

"customer": "T429GDYEQW7X4",

"email": "[email protected]",

"amount": 1301,

"currency": "USD"

'
11

Pay for Order Response

"id": "0E1SDRMHRTG24",

"object": "order",

"amount": 1301,

"tax_amount": 126,

"amount_paid": 1301,

"tax_amount_paid": 126,

"currency": "USD",

"charge": "DCXG54WZ3JRRR",

"warning_message": "Subsequent credential on file pay request sent for without Initial credential
on file pay request.",

"created": 1698219254000,

"customer": "T429GDYEQW7X4",

"email": "[email protected]",

"ref_num": "329800500120",

"auth_code": "OK9479",

"items": [

"parent": "RV3J2CBNA2582",

"inventory_id": "RV3J2CBNA2582",

"amount": 525,

"description": "Old Crow",

"tax_rates": [

"name": "NC/ Sales Tax",

"rate": 675000

},

"name": "CC Fee",


12

"rate": 399000

],

"source": {

"brand": "VISA",

"exp_month": "12",

"exp_year": "2028",

"first6": "424242",

"last4": "4242"

},

"status": "paid",

"status_transitions": {

"paid": 1698219781465

},

"ecomind": "ecom"

You might also like