A subscription order will look like this:
{
"order": {
"id": "xP2CcqcQx1h8VHkKOm2yQtBelGYZY",
"location_id": "3Z4V4WHQK64X9",
"line_items": [
{
"uid": "8e73sZ5LAPJbWt5HLwsdwC",
"quantity": "1",
"name": "Coffee membership fees",
"base_price_money": {
"amount": 100,
"currency": "USD"
},
"gross_sales_money": {
"amount": 100,
"currency": "USD"
},
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 100,
"currency": "USD"
},
"variation_total_price_money": {
"amount": 100,
"currency": "USD"
},
"item_type": "ITEM",
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
}
}
],
"fulfillments": [
{
"uid": "QRZZlLL7DYJ8NHXlzpyBKC",
"type": "DIGITAL",
"state": "PROPOSED"
}
],
"created_at": "2024-09-30T21:03:04.846Z",
"updated_at": "2024-09-30T21:06:52.784Z",
"state": "DRAFT",
"version": 7,
"total_tax_money": {
"amount": 0,
"currency": "USD"
},
"total_discount_money": {
"amount": 0,
"currency": "USD"
},
"total_tip_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 100,
"currency": "USD"
},
"total_service_charge_money": {
"amount": 0,
"currency": "USD"
},
"net_amounts": {
"total_money": {
"amount": 100,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"tip_money": {
"amount": 0,
"currency": "USD"
},
"service_charge_money": {
"amount": 0,
"currency": "USD"
}
},
"source": {
"name": "Boats"
},
"customer_id": "JNABMXH5HN7597FTNH3FD4GX78",
"net_amount_due_money": {
"amount": 100,
"currency": "USD"
}
}
}
You can then use SearchSubscriptions
with the customer_id
to get the subscription:
{
"include": [
"actions"
],
"query": {
"filter": {
"customer_ids": [
"JNABMXH5HN7597FTNH3FD4GX78"
],
"location_ids": [
"{{location_id}}"
]
}
}
}
The subscription will look like:
{
"subscriptions": [
{
"id": "30481d56-e677-4800-b5f9-8ad42ec5fc78",
"location_id": "3Z4V4WHQK64X9",
"customer_id": "JNABMXH5HN7597FTNH3FD4GX78",
"start_date": "2023-10-26",
"charged_through_date": "2024-10-26",
"status": "ACTIVE",
"invoice_ids": [
"inv:0-ChCQFDnz32BIPwrahm5o8CrAEOcN"
],
"buyer_self_management_token": "EJ3CVMhlEt8YxZipt5L0UvM0auxAd7zJnnb32CuDnIGV8QCpgEGQshte6YtBfE6nQ2HJCpQr_J1LN1CVfk7AIbpw2tCpEruWCARemaSOmGMppJgFp4sKvtMVwZTbzWMD2g==",
"version": 1,
"created_at": "2023-10-26T15:11:34-07:00",
"card_id": "ccof:CA4SEGRgRl2e6_7BGrMxJPBtwCUoAg",
"timezone": "America/Los_Angeles",
"order_template_id": "JLGmll91l3iVIzdV7UsYVS1HgpKZY",
"source": {
"name": "Boats"
},
"phases": [
{
"uid": "e4e82e90-ea41-46bf-9c6f-0be0c08ad892",
"ordinal": 0,
"order_template_id": "JLGmll91l3iVIzdV7UsYVS1HgpKZY",
"plan_phase_uid": "BKGDUY7OYMSLSUPAZCM7KCP4"
}
],
"plan_variation_id": "GZZAVQXQI3I5PFFTPDI4VQVM"
},
{
"id": "130a903c-274a-4c45-90e0-660ab7f322f5",
"location_id": "3Z4V4WHQK64X9",
"customer_id": "JNABMXH5HN7597FTNH3FD4GX78",
"start_date": "2024-09-30",
"charged_through_date": "2024-10-30",
"status": "ACTIVE",
"invoice_ids": [
"inv:0-ChA3DgmOi6gcaRb3tL1RJza7EOcN"
],
"buyer_self_management_token": "EJ3CVMhlEt8YxZipt5L0UvODitFgKBvlWSA_-bMijh8qVEe5sLmBYWE0-jtYjnMOKk3ZxxhuoVY1J6xrp1QaNPoLLEk71N3W4IQCmdu3LgDwv5S19pL5IcyUOoOv78Dvmw==",
"version": 1,
"created_at": "2024-09-30T14:06:52-07:00",
"card_id": "ccof:CA4SEDs8SJescv4M3WjY-UyqAWAoAg",
"timezone": "America/Los_Angeles",
"order_template_id": "xP2CcqcQx1h8VHkKOm2yQtBelGYZY",
"source": {
"name": "Boats"
},
"monthly_billing_anchor_date": 30,
"phases": [
{
"uid": "c2db76a2-a9d1-4708-9815-e6772f977aa9",
"ordinal": 0,
"order_template_id": "xP2CcqcQx1h8VHkKOm2yQtBelGYZY",
"plan_phase_uid": "BAA4WZ63TVC3OMWMT3J6NR6I"
}
],
"plan_variation_id": "WJZ33ATP5ER36Y6Y2ZIE33SZ"
}
]
}