Delivery Options API (v0)
Download OpenAPI specification:Download
API for creating and updating delivery options token key pair. Upload an RSA key pair in PEM format.
Create or update a shipping option token key pair
Create or update the public/private key pair used to generate shipping offer tokens.
Authorizations:
newStoreAccessToken
Request Body schema: application/json
public_key required | string non-empty A PEM formatted RSA public key |
private_key required | string non-empty A PEM formatted RSA private key |
Responses
Request samples
- Payload
Content type
application/json
Generate a private key and certificate request with the following command:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes
Extract the public key from the certificate request using the following command:
openssl x509 -pubkey -noout -in cert.pem > pubkey.pem
Prepare strings to use in the
private_key
andpublic_key
request body fields:
cat key.pem | awk '{printf "%s\\n", $0}' | sed 's,.\{2\}$,,'
(same for pubkey.pem)
{- "public_key": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0C4knVfllYex03XzEwV6\nV9psB6y6sm+gMaeI==\n-----END PUBLIC KEY-----",
- "private_key": "(similar to public key)"
}
Response samples
- 400
- 500
Content type
application/json
{- "message": "Invalid public/private key pair.",
- "request_id": "123456",
- "error_code": "invalid_key_pair"
}