Chaining IDs across API calls
Paystand uses several ID types. Store the right ID from each response to avoid broken links in your ERP.
ID reference
| ID | Where you get it | Use for |
|---|---|---|
Merchant customer_id | Dashboard → Integrations | X-CUSTOMER-ID header on every call |
payerCustomer.id | Create/List/Get Customer | payerCustomerId on receivables; credit memo customer scope. Not the same as payment.payerId unless that payer is listed under your merchant — wrong IDs return 401 on Get Customer. |
extCustomerId | Your ERP customer key (sent on create) | Alternative to payerCustomerId on receivable create/update |
receivable.id | Create/Get/List Receivable | Attachments, cancel, receivable transactions |
extId / invoice key | Your ERP invoice number | Receivable create; filter helpers on receivable list |
payment.id | Payment webhooks or List Payments | Merchant fee lookup (fees[]), payer fee split (feeSplit), refunds, reconciliation |
fee.id | Fee webhooks or List Fees | GL lines for merchant processing fees (not payer recoup) |
feeSettingPlan.id | Get Fee Setting Plan when you have an ID; or infer rates via Split Fees | Pre-payment payer fee estimates |
creditMemo.id | Credit memo APIs | Cancel/activate credit memos. Create requires extKey, status, numeric amount / amountRemaining, and MM-DD-YYYY dates — see Create Credit Memo |
transfer.id | List/Get Transfer | Payout reconciliation |
Example flow
POST /payerCustomers→ saveidaspayerCustomerId.POST /receivables/createwithpayerCustomerId(orextCustomerId) → savereceivable.id.- Payment webhook includes
payment.id→GET /payments/{id}for details. - Merchant processing fee webhook references payment →
GET /feeswith filter onresourceIdwhen authorized,GET /payments/{id}embeddedfees[], or use feeidfrom the event payload. For payer-side split, readfeeSpliton the same Get Payment response. - Pre-payment payer fee split →
POST /feeSplits/splitFeeswith paymentsubtotaland optionalpayerId/invoiceId/feeSettingPlanId— see Split Fees. For single-rail estimates only,POST /feeSplits/computeFeesacceptsfeeType+subtotal+currency(no payer/invoice context).
ERP keys vs Paystand IDs
Prefer storing both your ERP key (extCustomerId, invoice extId) and Paystand’s id. If you re-sync from ERP, match on ERP keys; use Paystand id for all subsequent API paths (/receivables/{id}/cancel, etc.).