Weav Docsv1

API reference / Payment methods

List saved payment methods

GET/v1/payment-methods

Newest first. Filter by your customer's ID to show their saved cards.

Query parameters

  • per_pageinteger
    Items per page, 25 by default; values above 100 become 100.
    At least 1Default: 25
  • cursorstring
    The next_cursor or prev_cursor from the previous page.
    Up to 1024 characters
  • date_fromstring (date)
    Start date (Asia/Manila), inclusive. Send with date_to.
  • date_tostring (date)
    End date (Asia/Manila), inclusive.
  • customer_idstring
    Your own ID for the customer, exact match.
    Up to 64 characters
  • statusstring
    PENDING until your customer saves it and their bank confirms it; ACTIVE (chargeable); FAILED when that never happens; REMOVED.
    One of: PENDING ACTIVE FAILED REMOVED
  • expires_bystring
    Only cards that expire in this month or earlier (YYYY-MM). Run it each month to ask those customers for a new card.
    Pattern: ^\d{4}-\d{2}$

Headers

  • AuthorizationstringRequired
    Bearer plus your API key. See Authentication.

Responses

200 OK

A page of saved payment methods.

What data holds
  • payment_methodsarray of objects
    16 fields in payment_methods
    • idstring
    • typestring
      One of: CARD
    • statusstring
      PENDING until your customer saves it and their bank confirms it; ACTIVE (chargeable); FAILED when that never happens; REMOVED.
      One of: PENDING ACTIVE FAILED REMOVED
    • customerobject
      3 fields in customer
      • idstring
      • namestring | null
      • emailstring | null
    • cardobject | null
      Once saved. Never the card number.
      4 fields in card
      • brandstring
        From the card processor.
        One of: VISA MASTERCARD JCB
      • last4string
      • exp_monthinteger | null
        The expiry month your customer typed. Ask them for a new card before it passes (expires_by on the list).
        At least 1At most 12
      • exp_yearinteger | null
        Four digits.
    • labelstring | null
      To show your customer.
    • next_actionobject
      2 fields in next_action
      • typestring | null
        One of: REDIRECT
      • checkout_urlstring (uri) | null
        Weav's save page, while PENDING.
    • success_urlstring (uri) | null
    • cancel_urlstring (uri) | null
    • webhook_urlstring | null
    • expires_atstring (date-time) | null
      When the save link ends, while PENDING.
    • activated_atstring (date-time) | null
    • failed_atstring (date-time) | null
    • removed_atstring (date-time) | null
    • created_atstring (date-time)
    • updated_atstring (date-time)
  • paginationobject
    4 fields in pagination
    • per_pageintegerRequired
    • next_cursorstring | nullRequired
    • prev_cursorstring | nullRequired
    • is_last_pagebooleanRequired

401 Unauthorized

Missing, malformed or unknown API key (code 4010000).

403 Forbidden

The key can't make this request (code 4030000): an address outside the key's IP allowlist, a live key before your live mode is on, or an account that isn't active. A live key sent from a browser is refused (code 4030001): keep live keys on your server.

422 Unprocessable Content

One or more fields are invalid (code 4220000), or the channel is off (4220101) or doesn't take the currency (4220102).

GET

Try it: List saved payment methods

Test mode
Authorization
Query Optional
cURL

Uses $WEAV_API_KEY, never your key. Paste it into a terminal, or import it into Postman.

Response

Send the request to see Weav's answer here.

curl -X GET https://api.weavpayments.com/v1/payment-methods \
    -H "Authorization: Bearer $WEAV_API_KEY"
{
    "code": "2000000",
    "success": true,
    "message": "OK",
    "data": {
        "payment_methods": [
            {
                "id": "PM8K2Q7X9KBAT4MZ3N",
                "type": "CARD",
                "status": "ACTIVE",
                "customer": {
                    "id": "USER-123",
                    "name": "Juan dela Cruz",
                    "email": "juan@example.com"
                },
                "card": {
                    "brand": "VISA",
                    "last4": "1381",
                    "exp_month": 12,
                    "exp_year": 2030
                },
                "label": "Visa •••• 1381",
                "…": "…"
            }
        ],
        "pagination": {
            "per_page": 25,
            "next_cursor": null,
            "prev_cursor": null,
            "is_last_page": true
        }
    }
}