Skip to main content
POST
/
v1
/
payment_links
Create Payment Link
curl --request POST \
  --url https://api.withflex.com/v1/payment_links \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payment_link": {
    "label": "Example",
    "shipping_address_collection": false,
    "shipping_options": {},
    "metadata": {},
    "payment_intent_data": {},
    "after_completion": {},
    "allow_promotion_codes": false,
    "origin": "shopify",
    "tax_rate": {},
    "mode": "payment",
    "setup_future_use": "on_session"
  }
}
'
{
  "payment_link": {
    "payment_link_id": "obj_01EXAMPLE00000000000000000",
    "label": "Example",
    "active": false,
    "allow_promotion_codes": false,
    "shipping_address_collection": false,
    "shipping_options": {},
    "metadata": {},
    "url": "https://example.com",
    "created_at": "2024-01-01T00:00:00Z",
    "payment_intent_data": {},
    "after_completion": {},
    "origin": "shopify",
    "tax_rate": {},
    "setup_future_use": "on_session",
    "test_mode": false
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access this API.

Body

application/json
Example:
{
"label": "Example",
"shipping_address_collection": false,
"shipping_options": {
"shipping_rate_id": "obj_01EXAMPLE00000000000000000"
},
"metadata": {},
"payment_intent_data": {
"capture_method": "automatic",
"metadata": {}
},
"after_completion": { "type": "redirect" },
"allow_promotion_codes": false,
"origin": "shopify",
"tax_rate": { "amount": 0 },
"mode": "payment",
"setup_future_use": "on_session"
}

Response

Success

Example:
{
"payment_link_id": "obj_01EXAMPLE00000000000000000",
"label": "Example",
"active": false,
"allow_promotion_codes": false,
"shipping_address_collection": false,
"shipping_options": {
"shipping_rate_id": "obj_01EXAMPLE00000000000000000",
"shipping_amount": 0,
"display_name": "Example"
},
"metadata": {},
"url": "https://example.com",
"created_at": "2024-01-01T00:00:00Z",
"payment_intent_data": {
"capture_method": "automatic",
"metadata": {}
},
"after_completion": {
"type": "redirect",
"hosted_confirmation": {},
"redirect": {}
},
"origin": "shopify",
"tax_rate": { "amount": 0 },
"setup_future_use": "on_session",
"test_mode": false
}