Headers
note
PayString was previously known as PayID.
See also: PayString API Reference.
The PayString protocol has specific header requirements for requests and responses.
Request headers#
When you make a request, the HTTP Accept header of the request specifies the payment network and environment, and PayString is therefore capable of returning a user's address information for any network in which that user participates.
An example request has this form.
Some different header options are shown here, with example values.
| Currency | Header | Address payload |
|---|---|---|
| BTC | application/btc-mainnet+json | { address: '1BvBMSEYstWetAu4m4GFg7xJaNVN2' } |
| XRP | application/xrpl-mainnet+json | { address: "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", tag: "67298042"} |
| ACH | application/ach+json | { account: '363023456079',routing: '011302838'} |
| CRO | application/cro-mainnet+json | { address: "cro1w2kvwrzp23aq54n3amwav4yy4a9ahq2kz2wtmj", memo: "3979714512"} |
| All | application/payid+json | Variable, depending on the contents of each address |
If you create your own Accept header for another currency:
- Follow the pattern for BTC Accept headers and use the currency code for the currency, as shown.
- Consider creating a PR on the PayString docs site to update this list.
- Consider updating IANA registration section in the PayString protocol RFC for supported Media-types by sending an email to rfcs@paystring.org.
Headers for GET requests#
This launch of PayString includes those headers specific to the XRPL community. Each payment network is free to establish its own standard headers. These headers should be submitted with every GET request, but not POST.
Header for all addresses#
| Accept header | Description |
|---|---|
application/payid+json | Returns all addresses for a PayString |
Headers for XRP#
| Accept header | Description |
|---|---|
application/xrpl-mainnet+json | Returns XRPL mainnet classic address (and tag if provided) |
application/xrpl-testnet+json | Returns XRPL testnet classic address (and tag if provided) |
application/xrpl-devnet+json | Returns XRPL devnet xAddress classic address (and tag if provided) |
Headers for ACH#
| Accept header | Description |
|---|---|
application/ach+json | Returns account and routing number |
Headers for BTC#
| Accept header | Description |
|---|---|
application/btc-mainnet+json | Returns mainnet address |
application/btc-testnet+json | Returns testnet address |
Headers for ETH#
| Accept header | Description |
|---|---|
application/eth-mainnet+json | Returns mainnet address |
application/eth-ropsten+json | Returns testnet address |
application/eth-kovan+json | Returns testnet address |
application/eth-rinkeby+json | Returns testnet address |
Ethernet has a number of different testnets. Refer to EIP 155.
Headers for ILP#
| Accept header | Description |
|---|---|
application/interledger-mainnet+json | Returns mainnet address |
application/interledger-testnet+json | Returns testnet address |
Headers for CRO#
| Accept header | Description |
|---|---|
application/cro-mainnet+json | Returns CRO mainnet address (and memo if provided) |
application/cro-testnet+json | Returns CRO testnet address (and memo if provided) |