question

clover-faq avatar image
clover-faq asked clover-faq edited

How do I set a delivery address for orders?

How do I have the delivery address show up on the receipt?
Orders
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

clover-faq avatar image
clover-faq answered clover-faq edited
There are multiple ways to accomplish this goal.

Customer
You can utilize our Customer infrastructure to associate an address to an order. You can POST to /v3/merchants/{merchantId}/customers to create a customer with the address (later this customer can be searched by name or phone number if that information is also added).

{  
	"firstName": "Gary",  
	"lastName": "Oak",  
	"addresses": {                
		"elements": [                    
			{                        
				"address1": "2 Starter Ln",                  
				"city": "Pallet Town",                        
				"state": "",                        
				"zip": "",                        
				"country": ""                    
			}                
		]            
	}
}

Once you have that customer's ID you can add it to an open order by POSTing the following JSON to /v3/merchants/{ {merchantId}}/orders/{ {orderId}}:
{
	"customers": [{"id": "{customerId}"}]
}
Once the customer (and their address) is associated with the order, it can now be printed along with the order information. The simplest way is to have the merchant select the option to print Customer information on receipts (instructions for order receipts: https://help.clover.com/order-receipts/?userDevice=station#show-customer-info-order-receipt , instructions for payment receipts: https://help.clover.com/customer-receipts/?userDevice=station#show-customer-information-on-payment-receipts).

Order Note
You can add the address through the "note" field of the order. This note will simply be an arbitrary string. Other apps may be using this field as well. You can add a note by POSTing the following to /v3/merchants/{ {merchantId}}/orders/{ {orderId}}
{
  "note": "123 Brick Way\nPewter City"
}
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community