Paycose Docs
Payment Links
POST/onetime/payment_link/pay

Pay Payment Link (Hosted)

Customer-facing pay. Body — 1:1 with PayPaymentLinkDTO. No merchant auth — the token in the body IS the credential. payment_method reuses the checkout PaymentMethodSelector. Resolves the provider from the method, mints + pays a target-linked charge, returns next_action[] (3DS redirect / hosted card entry / PromptPay QR). Rate limit: 30/min per IP.

FieldRequiredNotes
token✓the link's public token
payment_method.type✓e.g. card, promptpay
payment_method.id—🚫 a stored saved-card id is rejected → 400 (new-card-entry only on a bearer link)
payment_method.provideroptionalonly for multi-provider methods (bank-app deeplinks)
return_urloptionalhttps; 3DS return
metadataoptionalthreaded onto the charge

Errors (shape: { location, object, message, code, key, i18n_key?, request_id? }, object = error): saved payment_method.id → 400 (code 1100 / E1100); link canceled / expired / already-paid → 409 (code 1400 / E1400).

Request

Example

curl -X POST 'https://api.paycose.com/api/v1/app1/platform/wallet/onetime/payment_link/pay' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "{{payment_link_token}}",
  "payment_method": {
    "type": "card"
  },
  "return_url": "https://example.com/thanks",
  "payer_email": "<string>",
  "promotion_code": "<string>",
  "billing_details": {
    "name": "<string>",
    "email": "<string>",
    "phone": "<string>",
    "business_name": "<string>",
    "tax_id_type": "<string>",
    "tax_id_value": "<string>",
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postal_code": "<string>",
    "country": "<string>"
  },
  "metadata": {}
}'

Headers

NameValue
Content-Typeapplication/json

Body

NameTypeValue
tokenstring{{payment_link_token}}
payment_methodobject{…}
return_urlstringhttps://example.com/thanks
payer_emailstring<string>
promotion_codestring<string>
billing_detailsobject{…}
metadataobject{…}
{
  "token": "{{payment_link_token}}",
  "payment_method": {
    "type": "card"
  },
  "return_url": "https://example.com/thanks",
  "payer_email": "<string>",
  "promotion_code": "<string>",
  "billing_details": {
    "name": "<string>",
    "email": "<string>",
    "phone": "<string>",
    "business_name": "<string>",
    "tax_id_type": "<string>",
    "tax_id_value": "<string>",
    "line1": "<string>",
    "line2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postal_code": "<string>",
    "country": "<string>"
  },
  "metadata": {}
}

Responses

200200 OK

Headers

NameValue
Content-Typeapplication/json

Body

{
  "id": "<string>",
  "object": "<string>",
  "resource": "<string>",
  "created_at": "<RFC3339 timestamp>",
  "errors": [
    {
      "code": "<string>",
      "message": "<string>"
    }
  ],
  "next_action": [
    {
      "type": "<string>",
      "title": "<string>",
      "description": "<string>",
      "i18n_key": "<string>",
      "url": "<string>",
      "client_secret": "<string>",
      "payment_method": "<string>",
      "qr_data": "<string>"
    }
  ],
  "paid": false,
  "status": "<string>",
  "charge_session": "<string>",
  "promptpay": {
    "raw": "<string>",
    "image": "<string>",
    "ref1": "<string>",
    "ref2": "<string>",
    "ref3": "<string>",
    "expires_at": "<RFC3339 timestamp>"
  },
  "merchant_id": "<string>",
  "merchant_name": "<string>"
}

On this page