Saltar al contingut principal
GET

Obtenir un mètode de pagament per ID

Scope:sales:invoicing-settings.read
https://api.holded.com/api/v2/payment-methods/{paymentMethodId}

Retorna un mètode de pagament configurat pel seu ID. L'ID s'obté del camp 'id' a la resposta de l'endpoint de llistat. Nota: retorna un mètode de pagament configurat (manual o passarel·la connectada com Stripe, PayPal, GoCardless, Square, Monei o Wallet), no una transacció individual. Utilitza /api/v2/payments/{id} per obtenir una transacció de pagament concreta.

Paràmetres

Paràmetres de ruta

paymentMethodIdstringobligatori

ID del mètode de pagament (ObjectId hexadecimal de 24 caràcters)

Petició

python
import requests

url = "https://api.holded.com/api/v2/payment-methods/507f1f77bcf86cd799439011"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respostes

Resposta

json
{
  "id": "507f1f77bcf86cd799439011",
  "name": "string",
  "type": "manual",
  "status": "connected",
  "isDefault": false,
  "bankingAccountId": "507f1f77bcf86cd799439011",
  "dueDays": 0,
  "connectionId": "507f1f77bcf86cd799439011"
}

Respostes exitoses

200Mètode de pagament trobatapplication/json
object
idstringrequired

Unique identifier of the payment method

namestringrequired

Display name of the payment method

typestringrequired

Discriminator for the payment method kind: 'manual' for manually created methods, or the provider slug for connected gateways (stripe, paypal, gocardless, square, monei, wallet)

Enum:manualstripepaypalgocardlesssquaremoneiwallet
statusstringrequired

Current status of the payment method: 'connected' means active and usable. Online gateways may also have disconnected, access_denied, verification_required, or verification_in_review.

Enum:connecteddisconnectedaccess_deniedverification_requiredverification_in_review
isDefaultbooleanrequired

Whether this method is the account default for online payments

bankingAccountIdstring | nullrequired

Associated banking account ID, if configured

dueDaysinteger | nullrequired

Number of days until payment is due (manual methods only)

connectionIdstring | nullrequired

Gateway connection identifier (online methods only)

Respostes d'error

401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Mètode de pagament no trobatapplication/json
429Límit de sol·licituds exceditapplication/json