Headers

See also: PayID API Reference.

The PayID 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 PayID is therefore capable of returning a user's address information for any network in which that user participates.

An example request has this form.

GET /{user} HTTP/1.1
Accept: application/xrpl-testnet+json

Some different header options are shown here, with example values.

CurrencyHeaderAddress payload
BTCapplication/btc-mainnet+json{ address: '1BvBMSEYstWetAu4m4GFg7xJaNVN2' }
XRPapplication/xrpl-mainnet+json{ address: "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", tag: "67298042"}
ACHapplication/ach+json{ account: '363023456079',routing: '011302838'}
Allapplication/payid+jsonVariable, depending on the contents of each address

If you create your own Accept header for another currency:

  1. Follow the pattern for BTC Accept headers and use the currency code for the currency, as shown.
  2. Consider creating a PR on the PayID docs site to update this list.
  3. Consider updating IANA registration section in the PayID protocol RFC for supported Media-types by sending an email to rfcs@payid.org.

Headers for GET requests

This launch of PayID 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 headerDescription
application/payid+jsonReturns all addresses for a PayID

Headers for XRP

Accept headerDescription
application/xrpl-mainnet+jsonReturns XRPL mainnet classic address (and tag if provided)
application/xrpl-testnet+jsonReturns XRPL testnet classic address (and tag if provided)
application/xrpl-devnet+jsonReturns XRPL devnet xAddress classic address (and tag if provided)

Headers for ACH

Accept headerDescription
application/ach+jsonReturns account and routing number

Headers for BTC

Accept headerDescription
application/btc-mainnet+jsonReturns mainnet address
application/btc-testnet+jsonReturns testnet address

Headers for ETH

Accept headerDescription
application/eth-mainnet+jsonReturns mainnet address
application/eth-ropsten+jsonReturns testnet address
application/eth-kovan+jsonReturns testnet address
application/eth-rinkeby+jsonReturns testnet address

Ethernet has a number of different testnets. Refer to EIP 155.

Headers for ILP

Accept headerDescription
application/interledger-mainnet+jsonReturns mainnet address
application/interledger-testnet+jsonReturns testnet address