Skip to main content

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

Content type
application/json
  1. 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

  2. Extract the public key from the certificate request using the following command:

    openssl x509 -pubkey -noout -in cert.pem > pubkey.pem

  3. Prepare strings to use in the private_key and public_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

Content type
application/json
{
  • "message": "Invalid public/private key pair.",
  • "request_id": "123456",
  • "error_code": "invalid_key_pair"
}

Get the public key for a shipping option token

Gets the public/private key for a shipping option token

Authorizations:
newStoreAccessToken
header Parameters
tenant
required
string

Responses

Response samples

Content type
application/json
{
  • "public_key": "string"
}