Hi, team!
I'm trying to create new order and link existing customer to it.
Expected result: customer is linked to new order.
Actual result: customer is not linked to new order.
This is a Python script to test:
import click import requests @click.command(help='Create an order.') @click.option('--access-token', required=True) @click.option('--merchant-id', required=True) @click.option('--order-type-id', required=True) @click.option('--order-number', required=True) @click.option('--order-notes', required=False) @click.option('--order-title', required=True) @click.option('--customer-id', required=True) @click.option('--charges-total', required=True) def create_order( access_token, merchant_id, order_type_id, order_number, order_notes, order_title, customer_id, charges_total, ): data = { 'orderType': { 'id': order_type_id, }, 'currency': 'USD', 'title': order_title, 'total': int(charges_total), 'externalReferenceId': order_number, 'state': 'open', 'customers': [{ 'id': customer_id, }] } if order_notes: data['note'] = order_notes response = requests.post( 'https://sandbox.dev.clover.com/v3/merchants/%s/orders' % merchant_id, headers={ 'authorization': 'Bearer %s' % access_token, }, json=data, ) click.echo('response status: %s' % response.status_code) click.echo('response data: %s' % response.content) if __name__ == '__main__': create_order()