Hi,
I’m using the CreatePaymentLink API and passing in the Order State of OPEN, but the response is DRAFT. Why does the order state not get honoured?
Request:
{
“idempotency_key”: “8519cf5f-2850-4aa9-9e1a-0d37e48ed1c3”,
“order”: {
“location_id”: “LVYAJFRZ4X6G9”,
“reference_id”: “PMO-3-3320”,
“customer_id”: “F18H88Q3C7D84BC7MA2EJZSE7C”,
“line_items”: [
{
“uid”: “3320”,
“name”: “xxxxxxx”,
“quantity”: “1”,
“base_price_money”: {
“amount”: 29500,
“currency”: “GBP”
}
}
],
“state”: “OPEN”
},
“checkout_options”: {
“allow_tipping”: false,
“redirect_url”: “xxxxx”,
“merchant_support_email”: “xxxxx”,
“ask_for_shipping_address”: false
},
“pre_populated_data”: {
“buyer_email”: “xxxxx”,
“buyer_phone_number”: “xxxxx”
}
}
Response:
{
“payment_link”: {
“id”: “UVX2LSH2RLBXDD5G”,
“version”: 1,
“order_id”: “AFeDrodxhTGbkUzVFxiW9zcZJtEZY”,
“checkout_options”: {
“allow_tipping”: false,
“redirect_url”: “xxxx”,
“merchant_support_email”: “xxxx”,
“ask_for_shipping_address”: false
},
“pre_populated_data”: {
“buyer_email”: “xxxxx”,
“buyer_phone_number”: “xxxxx”
},
“url”: “https://connect.squareupsandbox.com/v2/online-checkout/sandbox-testing-panel/ML4STSSC84TW3/UVX2LSH2RLBXDD5G”,
“created_at”: “2022-08-24T12:40:04Z”
},
“related_resources”: {
“orders”: [
{
“id”: “AFeDrodxhTGbkUzVFxiW9zcZJtEZY”,
“location_id”: “LVYAJFRZ4X6G9”,
“reference_id”: “PMO-3-3320”,
“source”: {
“name”: “Sandbox for sq0idp-GUL2D_Gizxt1Qd9FKVWSQg”
},
“customer_id”: “F18H88Q3C7D84BC7MA2EJZSE7C”,
“line_items”: [
{
“uid”: “3320”,
“name”: “xxxxxxx”,
“quantity”: “1”,
“item_type”: “ITEM”,
“base_price_money”: {
“amount”: 29500,
“currency”: “GBP”
},
“variation_total_price_money”: {
“amount”: 29500,
“currency”: “GBP”
},
“gross_sales_money”: {
“amount”: 29500,
“currency”: “GBP”
},
“total_tax_money”: {
“amount”: 0,
“currency”: “GBP”
},
“total_discount_money”: {
“amount”: 0,
“currency”: “GBP”
},
“total_money”: {
“amount”: 29500,
“currency”: “GBP”
}
}
],
“fulfillments”: [
{
“uid”: “9JVwdqjg2GG1x30FbkEpkD”,
“type”: “DIGITAL”,
“state”: “PROPOSED”
}
],
“net_amounts”: {
“total_money”: {
“amount”: 29500,
“currency”: “GBP”
},
“tax_money”: {
“amount”: 0,
“currency”: “GBP”
},
“discount_money”: {
“amount”: 0,
“currency”: “GBP”
},
“tip_money”: {
“amount”: 0,
“currency”: “GBP”
},
“service_charge_money”: {
“amount”: 0,
“currency”: “GBP”
}
},
“created_at”: “2022-08-24T12:40:04.003Z”,
“updated_at”: “2022-08-24T12:40:04.003Z”,
“state”: “DRAFT”,
“version”: 1,
“total_money”: {
“amount”: 29500,
“currency”: “GBP”
},
“total_tax_money”: {
“amount”: 0,
“currency”: “GBP”
},
“total_discount_money”: {
“amount”: 0,
“currency”: “GBP”
},
“total_tip_money”: {
“amount”: 0,
“currency”: “GBP”
},
“total_service_charge_money”: {
“amount”: 0,
“currency”: “GBP”
},
“net_amount_due_money”: {
“amount”: 29500,
“currency”: “GBP”
}
}
]
}
}